Skip to content

Commit

Permalink
Exos: Deprecate APIs and add changelog entry
Browse files Browse the repository at this point in the history
This is in addition to 067a4a1
  • Loading branch information
ghernadi authored and Gabor Hernadi committed Jan 29, 2024
1 parent a7a3e0d commit aaab868
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 37 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- NetCom SSL reimplementation: Fixed buffer handling, SSL handshake/negotiation/renegotiation
- Prohibit disk accesses in DrbdLayer while SkipDisk is set

### Deprecated

- Support for EXOS

### Removed

- Support for OpenFlex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1717,15 +1717,17 @@ public static class EventNodeModified
* Default settings for EXOS enclosures
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@Deprecated(forRemoval = true)
public static class ExosDefaults
{
public String username;
public String username_env;
public String password;
public String password_env;
@Deprecated(forRemoval = true) public String username;
@Deprecated(forRemoval = true) public String username_env;
@Deprecated(forRemoval = true) public String password;
@Deprecated(forRemoval = true) public String password_env;
}

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@Deprecated(forRemoval = true)
public static class ExosDefaultsModify
extends ExosDefaults
{
Expand All @@ -1739,52 +1741,56 @@ public static class ExosDefaultsModify
* EXOS enclosure name, controller IPs and health status
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@Deprecated(forRemoval = true)
public static class ExosEnclosureHealth
{
public String name;
public String ctrl_a_ip;
public String ctrl_b_ip;
public String health;
public String health_reason;
@Deprecated(forRemoval = true) public String name;
@Deprecated(forRemoval = true) public String ctrl_a_ip;
@Deprecated(forRemoval = true) public String ctrl_b_ip;
@Deprecated(forRemoval = true) public String health;
@Deprecated(forRemoval = true) public String health_reason;
}

/**
* EXOS enclosure
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@Deprecated(forRemoval = true)
public static class ExosEnclosure
{
public String name;
public String ctrl_a_ip;
public String ctrl_b_ip;
public String username;
public String username_env;
public String password;
public String password_env;
@Deprecated(forRemoval = true) public String name;
@Deprecated(forRemoval = true) public String ctrl_a_ip;
@Deprecated(forRemoval = true) public String ctrl_b_ip;
@Deprecated(forRemoval = true) public String username;
@Deprecated(forRemoval = true) public String username_env;
@Deprecated(forRemoval = true) public String password;
@Deprecated(forRemoval = true) public String password_env;
}

/**
* EXOS event
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@Deprecated(forRemoval = true)
public static class ExosEnclosureEvent
{
public String severity;
public String event_id;
public String controller;
public String time_stamp;
public Long time_stamp_numeric;
public String message;
public String additional_information;
public String recommended_action;
@Deprecated(forRemoval = true) public String severity;
@Deprecated(forRemoval = true) public String event_id;
@Deprecated(forRemoval = true) public String controller;
@Deprecated(forRemoval = true) public String time_stamp;
@Deprecated(forRemoval = true) public Long time_stamp_numeric;
@Deprecated(forRemoval = true) public String message;
@Deprecated(forRemoval = true) public String additional_information;
@Deprecated(forRemoval = true) public String recommended_action;
}

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@Deprecated(forRemoval = true)
public static class ExosConnectionMap
{
public String node_name;
public String enclosure_name;
public List<String> connections = Collections.emptyList();
@Deprecated(forRemoval = true) public String node_name;
@Deprecated(forRemoval = true) public String enclosure_name;
@Deprecated(forRemoval = true) public List<String> connections = Collections.emptyList();
}

/**
Expand Down
15 changes: 15 additions & 0 deletions docs/rest_v1_openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ info:
- Added GET /v1/files/{extFileName}/check/{node}
- Added ExtFileCheckResult
- Added storpool_rename to SnapshotRestore and BackupSchedule
- Deprecated EXOS entry points
* 1.20.2
- Added EffectivePropertiesMap, EffectivePropertiesMapValue and PropertyWithDescription objects
* 1.20.1
Expand Down Expand Up @@ -5671,6 +5672,7 @@ paths:
$ref: '#/components/schemas/EventNodeModified'
/v1/vendor/seagate/exos/defaults:
get:
deprecated: true
tags:
- developers
summary: Lists default setting for all EXOS enclosures
Expand All @@ -5685,6 +5687,7 @@ paths:
items:
$ref: '#/components/schemas/ExosDefaults'
put:
deprecated: true
tags:
- developers
summary: modify default settings of EXOS configurations
Expand All @@ -5705,6 +5708,7 @@ paths:
$ref: '#/components/schemas/ExosDefaultsModify'
/v1/vendor/seagate/exos/enclosures:
get:
deprecated: true
tags:
- developers
summary: List of EXOS enclosures
Expand All @@ -5725,6 +5729,7 @@ paths:
items:
$ref: '#/components/schemas/ExosEnclosureHealth'
post:
deprecated: true
tags:
- developers
summary: creates a new enclosure
Expand All @@ -5744,6 +5749,7 @@ paths:
$ref: '#/components/schemas/ExosEnclosure'
/v1/vendor/seagate/exos/enclosures/{enclosure}:
put:
deprecated: true
tags:
- developers
summary: modifies an existing enclosure
Expand All @@ -5769,6 +5775,7 @@ paths:
schema:
$ref: '#/components/schemas/ExosEnclosure'
delete:
deprecated: true
tags:
- developers
summary: modifies an existing enclosure
Expand All @@ -5790,6 +5797,7 @@ paths:
$ref: '#/components/schemas/ApiCallRcList'
/v1/vendor/seagate/exos/{enclosure}/events:
get:
deprecated: true
tags:
- developers
summary: Returns the last EXOS events
Expand Down Expand Up @@ -5819,6 +5827,7 @@ paths:
$ref: '#/components/schemas/ExosEnclosureEvent'
/v1/vendor/seagate/exos/map:
get:
deprecated: true
tags:
- developers
summary: Lists all EXOS Ports connected to each Linstor Node
Expand Down Expand Up @@ -8698,6 +8707,7 @@ components:
new_node:
$ref: '#/components/schemas/Node'
ExosDefaults:
deprecated: true
type: object
description: Default settings for EXOS enclosures
properties:
Expand All @@ -8710,6 +8720,7 @@ components:
password_env:
type: string
ExosDefaultsModify:
deprecated: true
allOf:
- $ref: '#/components/schemas/ExosDefaults'
- type: object
Expand All @@ -8721,6 +8732,7 @@ components:
description: |
A list of keys to unset. The keys have to exist in ExosDefaults
ExosEnclosureHealth:
deprecated: true
type: object
description: EXOS enclosure name, controller IPs and health status
properties:
Expand All @@ -8735,6 +8747,7 @@ components:
health_reason:
type: string
ExosEnclosure:
deprecated: true
type: object
description: EXOS enclosure
properties:
Expand All @@ -8753,6 +8766,7 @@ components:
password_env:
type: string
ExosEnclosureEvent:
deprecated: true
type: object
description: EXOS event
properties:
Expand All @@ -8774,6 +8788,7 @@ components:
recommended_action:
type: string
ExosConnectionMap:
deprecated: true
type: object
properties:
node_name:
Expand Down
23 changes: 13 additions & 10 deletions scripts/rest-gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def generate_class(schema_type: str, schema: OrderedDict, schema_lookup: Ordered

out = gen_description_javadoc(schema, indent, 1)
out += indent + "@JsonInclude(JsonInclude.Include.NON_EMPTY)\n"
if schema.get("deprecated"):
out += indent + "@Deprecated(forRemoval = true)\n"
out += indent + "public static class " + schema_type + "\n"
if "allOf" in schema:
out += indent * 2 + "extends " + schema["allOf"][0]["$ref"][len('#/components/schemas/'):] + "\n"
Expand All @@ -129,37 +131,38 @@ def generate_class(schema_type: str, schema: OrderedDict, schema_lookup: Ordered
field = schema["properties"][fieldname]
out += gen_description_javadoc(field, indent, 2)
t = resolve_type_str(schema_lookup, field)
depr = "@Deprecated(forRemoval = true) " if schema.get("deprecated") else ""
if t.startswith("Map"):
dval = 'null' if "default" in field and field['default'] is None else 'Collections.emptyMap()'
out += indent * 2 + "public {t} {n} = {v};\n".format(t=t, n=fieldname, v=dval)
out += indent * 2 + depr + "public {t} {n} = {v};\n".format(t=t, n=fieldname, v=dval)
elif t.startswith("List"):
dval = 'null' if "default" in field and field['default'] is None else 'Collections.emptyList()'
out += indent * 2 + "public {t} {n} = {v};\n".format(t=t, n=fieldname, v=dval)
out += indent * 2 + depr + "public {t} {n} = {v};\n".format(t=t, n=fieldname, v=dval)
else:
if "default" in field:
dval = field['default']
if t == "String":
if dval is None:
out += indent * 2 + 'public {t} {n} = null;\n'.format(
out += indent * 2 + depr + 'public {t} {n} = null;\n'.format(
t=t, n=fieldname
)
else:
out += indent * 2 + 'public {t} {n} = "{v}";\n'.format(
out += indent * 2 + depr + 'public {t} {n} = "{v}";\n'.format(
t=t, n=fieldname, v=value_to_string(dval)
)
else:
out += indent * 2 + "public {t} {n} = {v};\n".format(t=t, n=fieldname, v=value_to_string(dval))
out += indent * 2 + depr + "public {t} {n} = {v};\n".format(t=t, n=fieldname, v=value_to_string(dval))
elif "required" in schema and fieldname in schema["required"]:
if t not in ["String", "Integer", "Long", "Double", "Boolean"]:
out += indent * 2 + "public {t} {n} = new {v};\n".format(t=t, n=fieldname, v=t + "()")
out += indent * 2 + depr + "public {t} {n} = new {v};\n".format(t=t, n=fieldname, v=t + "()")
elif t == "Integer":
out += indent * 2 + "public int {n};\n".format(n=fieldname)
out += indent * 2 + depr + "public int {n};\n".format(n=fieldname)
elif t == "String":
out += indent * 2 + "public String {n};\n".format(n=fieldname)
out += indent * 2 + depr + "public String {n};\n".format(n=fieldname)
else:
out += indent * 2 + "public {t} {n};\n".format(t=t.lower(), n=fieldname)
out += indent * 2 + depr + "public {t} {n};\n".format(t=t.lower(), n=fieldname)
else:
out += indent * 2 + "public {t} {n};\n".format(t=t, n=fieldname)
out += indent * 2 + depr + "public {t} {n};\n".format(t=t, n=fieldname)
out += indent + "}\n"
return out

Expand Down

0 comments on commit aaab868

Please sign in to comment.