diff --git a/equinix-openapi-metal/.openapi-generator/FILES b/equinix-openapi-metal/.openapi-generator/FILES index f40157eec..8b6e94653 100644 --- a/equinix-openapi-metal/.openapi-generator/FILES +++ b/equinix-openapi-metal/.openapi-generator/FILES @@ -8,6 +8,8 @@ build.gradle build.sbt docs/ActivateHardwareReservationRequest.md docs/Address.md +docs/Attribute.md +docs/AttributeData.md docs/AuthToken.md docs/AuthTokenInput.md docs/AuthTokenList.md @@ -38,6 +40,7 @@ docs/CapacityCheckPerMetroList.md docs/CapacityInput.md docs/CapacityLevelPerBaremetal.md docs/CapacityList.md +docs/Component.md docs/Coordinates.md docs/CreateDeviceRequest.md docs/CreateEmailInput.md @@ -53,6 +56,7 @@ docs/DeviceCreateInFacilityInput.md docs/DeviceCreateInMetroInput.md docs/DeviceCreateInput.md docs/DeviceCreatedBy.md +docs/DeviceHealthRollup.md docs/DeviceList.md docs/DeviceMetro.md docs/DeviceProject.md @@ -79,6 +83,10 @@ docs/Filesystem.md docs/FindIPAddressById200Response.md docs/FindMetalGatewayById200Response.md docs/FindTrafficTimeframeParameter.md +docs/FirmwareSet.md +docs/FirmwareSetListResponse.md +docs/FirmwareSetResponse.md +docs/FirmwareSetsApi.md docs/GlobalBgpRange.md docs/GlobalBgpRangeList.md docs/HardwareReservation.md @@ -314,6 +322,7 @@ src/main/java/com/equinix/openapi/metal/v1/api/DevicesApi.java src/main/java/com/equinix/openapi/metal/v1/api/EmailsApi.java src/main/java/com/equinix/openapi/metal/v1/api/EventsApi.java src/main/java/com/equinix/openapi/metal/v1/api/FacilitiesApi.java +src/main/java/com/equinix/openapi/metal/v1/api/FirmwareSetsApi.java src/main/java/com/equinix/openapi/metal/v1/api/HardwareReservationsApi.java src/main/java/com/equinix/openapi/metal/v1/api/IncidentsApi.java src/main/java/com/equinix/openapi/metal/v1/api/InterconnectionsApi.java @@ -347,6 +356,8 @@ src/main/java/com/equinix/openapi/metal/v1/api/VrfsApi.java src/main/java/com/equinix/openapi/metal/v1/model/AbstractOpenApiSchema.java src/main/java/com/equinix/openapi/metal/v1/model/ActivateHardwareReservationRequest.java src/main/java/com/equinix/openapi/metal/v1/model/Address.java +src/main/java/com/equinix/openapi/metal/v1/model/Attribute.java +src/main/java/com/equinix/openapi/metal/v1/model/AttributeData.java src/main/java/com/equinix/openapi/metal/v1/model/AuthToken.java src/main/java/com/equinix/openapi/metal/v1/model/AuthTokenInput.java src/main/java/com/equinix/openapi/metal/v1/model/AuthTokenList.java @@ -373,6 +384,7 @@ src/main/java/com/equinix/openapi/metal/v1/model/CapacityCheckPerMetroList.java src/main/java/com/equinix/openapi/metal/v1/model/CapacityInput.java src/main/java/com/equinix/openapi/metal/v1/model/CapacityLevelPerBaremetal.java src/main/java/com/equinix/openapi/metal/v1/model/CapacityList.java +src/main/java/com/equinix/openapi/metal/v1/model/Component.java src/main/java/com/equinix/openapi/metal/v1/model/Coordinates.java src/main/java/com/equinix/openapi/metal/v1/model/CreateDeviceRequest.java src/main/java/com/equinix/openapi/metal/v1/model/CreateEmailInput.java @@ -388,6 +400,7 @@ src/main/java/com/equinix/openapi/metal/v1/model/DeviceCreateInFacilityInput.jav src/main/java/com/equinix/openapi/metal/v1/model/DeviceCreateInMetroInput.java src/main/java/com/equinix/openapi/metal/v1/model/DeviceCreateInput.java src/main/java/com/equinix/openapi/metal/v1/model/DeviceCreatedBy.java +src/main/java/com/equinix/openapi/metal/v1/model/DeviceHealthRollup.java src/main/java/com/equinix/openapi/metal/v1/model/DeviceList.java src/main/java/com/equinix/openapi/metal/v1/model/DeviceMetro.java src/main/java/com/equinix/openapi/metal/v1/model/DeviceProject.java @@ -410,6 +423,9 @@ src/main/java/com/equinix/openapi/metal/v1/model/Filesystem.java src/main/java/com/equinix/openapi/metal/v1/model/FindIPAddressById200Response.java src/main/java/com/equinix/openapi/metal/v1/model/FindMetalGatewayById200Response.java src/main/java/com/equinix/openapi/metal/v1/model/FindTrafficTimeframeParameter.java +src/main/java/com/equinix/openapi/metal/v1/model/FirmwareSet.java +src/main/java/com/equinix/openapi/metal/v1/model/FirmwareSetListResponse.java +src/main/java/com/equinix/openapi/metal/v1/model/FirmwareSetResponse.java src/main/java/com/equinix/openapi/metal/v1/model/GlobalBgpRange.java src/main/java/com/equinix/openapi/metal/v1/model/GlobalBgpRangeList.java src/main/java/com/equinix/openapi/metal/v1/model/HardwareReservation.java @@ -589,6 +605,7 @@ src/test/java/com/equinix/openapi/metal/v1/api/DevicesApiTest.java src/test/java/com/equinix/openapi/metal/v1/api/EmailsApiTest.java src/test/java/com/equinix/openapi/metal/v1/api/EventsApiTest.java src/test/java/com/equinix/openapi/metal/v1/api/FacilitiesApiTest.java +src/test/java/com/equinix/openapi/metal/v1/api/FirmwareSetsApiTest.java src/test/java/com/equinix/openapi/metal/v1/api/HardwareReservationsApiTest.java src/test/java/com/equinix/openapi/metal/v1/api/IncidentsApiTest.java src/test/java/com/equinix/openapi/metal/v1/api/InterconnectionsApiTest.java @@ -621,6 +638,8 @@ src/test/java/com/equinix/openapi/metal/v1/api/VlansApiTest.java src/test/java/com/equinix/openapi/metal/v1/api/VrfsApiTest.java src/test/java/com/equinix/openapi/metal/v1/model/ActivateHardwareReservationRequestTest.java src/test/java/com/equinix/openapi/metal/v1/model/AddressTest.java +src/test/java/com/equinix/openapi/metal/v1/model/AttributeDataTest.java +src/test/java/com/equinix/openapi/metal/v1/model/AttributeTest.java src/test/java/com/equinix/openapi/metal/v1/model/AuthTokenInputTest.java src/test/java/com/equinix/openapi/metal/v1/model/AuthTokenListTest.java src/test/java/com/equinix/openapi/metal/v1/model/AuthTokenProjectTest.java @@ -647,6 +666,7 @@ src/test/java/com/equinix/openapi/metal/v1/model/CapacityCheckPerMetroListTest.j src/test/java/com/equinix/openapi/metal/v1/model/CapacityInputTest.java src/test/java/com/equinix/openapi/metal/v1/model/CapacityLevelPerBaremetalTest.java src/test/java/com/equinix/openapi/metal/v1/model/CapacityListTest.java +src/test/java/com/equinix/openapi/metal/v1/model/ComponentTest.java src/test/java/com/equinix/openapi/metal/v1/model/CoordinatesTest.java src/test/java/com/equinix/openapi/metal/v1/model/CreateDeviceRequestTest.java src/test/java/com/equinix/openapi/metal/v1/model/CreateEmailInputTest.java @@ -661,6 +681,7 @@ src/test/java/com/equinix/openapi/metal/v1/model/DeviceCreateInFacilityInputTest src/test/java/com/equinix/openapi/metal/v1/model/DeviceCreateInMetroInputTest.java src/test/java/com/equinix/openapi/metal/v1/model/DeviceCreateInputTest.java src/test/java/com/equinix/openapi/metal/v1/model/DeviceCreatedByTest.java +src/test/java/com/equinix/openapi/metal/v1/model/DeviceHealthRollupTest.java src/test/java/com/equinix/openapi/metal/v1/model/DeviceListTest.java src/test/java/com/equinix/openapi/metal/v1/model/DeviceMetroTest.java src/test/java/com/equinix/openapi/metal/v1/model/DeviceProjectLiteTest.java @@ -684,6 +705,9 @@ src/test/java/com/equinix/openapi/metal/v1/model/FilesystemTest.java src/test/java/com/equinix/openapi/metal/v1/model/FindIPAddressById200ResponseTest.java src/test/java/com/equinix/openapi/metal/v1/model/FindMetalGatewayById200ResponseTest.java src/test/java/com/equinix/openapi/metal/v1/model/FindTrafficTimeframeParameterTest.java +src/test/java/com/equinix/openapi/metal/v1/model/FirmwareSetListResponseTest.java +src/test/java/com/equinix/openapi/metal/v1/model/FirmwareSetResponseTest.java +src/test/java/com/equinix/openapi/metal/v1/model/FirmwareSetTest.java src/test/java/com/equinix/openapi/metal/v1/model/GlobalBgpRangeListTest.java src/test/java/com/equinix/openapi/metal/v1/model/GlobalBgpRangeTest.java src/test/java/com/equinix/openapi/metal/v1/model/HardwareReservationListTest.java diff --git a/equinix-openapi-metal/README.md b/equinix-openapi-metal/README.md index 22e43b6a3..4e535b82a 100644 --- a/equinix-openapi-metal/README.md +++ b/equinix-openapi-metal/README.md @@ -120,7 +120,7 @@ Add this dependency to your project's POM: com.equinix equinix-openapi-metal - 0.5.0 + 0.6.0 compile ``` @@ -136,7 +136,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.equinix:equinix-openapi-metal:0.5.0" + implementation "com.equinix:equinix-openapi-metal:0.6.0" } ``` @@ -150,7 +150,7 @@ mvn clean package Then manually install the following JARs: -* `target/equinix-openapi-metal-0.5.0.jar` +* `target/equinix-openapi-metal-0.6.0.jar` * `target/lib/*.jar` ## Getting Started @@ -241,6 +241,8 @@ Class | Method | HTTP request | Description *DevicesApi* | [**findProjectDevices**](docs/DevicesApi.md#findProjectDevices) | **GET** /projects/{id}/devices | Retrieve all devices of a project *DevicesApi* | [**findTraffic**](docs/DevicesApi.md#findTraffic) | **GET** /devices/{id}/traffic | Retrieve device traffic *DevicesApi* | [**getBgpNeighborData**](docs/DevicesApi.md#getBgpNeighborData) | **GET** /devices/{id}/bgp/neighbors | Retrieve BGP neighbor data for this device +*DevicesApi* | [**getDeviceFirmwareSets**](docs/DevicesApi.md#getDeviceFirmwareSets) | **GET** /devices/{id}/firmware-sets | Get Device's associated Firmware Set +*DevicesApi* | [**getDeviceHealthRollup**](docs/DevicesApi.md#getDeviceHealthRollup) | **GET** /devices/{id}/diagnostics/health/rollup | Get Device's Health Status *DevicesApi* | [**performAction**](docs/DevicesApi.md#performAction) | **POST** /devices/{id}/actions | Perform an action *DevicesApi* | [**updateDevice**](docs/DevicesApi.md#updateDevice) | **PUT** /devices/{id} | Update the device *EmailsApi* | [**createEmail**](docs/EmailsApi.md#createEmail) | **POST** /emails | Create an email @@ -259,6 +261,8 @@ Class | Method | HTTP request | Description *FacilitiesApi* | [**findFacilities**](docs/FacilitiesApi.md#findFacilities) | **GET** /facilities | Retrieve all facilities *FacilitiesApi* | [**findFacilitiesByOrganization**](docs/FacilitiesApi.md#findFacilitiesByOrganization) | **GET** /organizations/{id}/facilities | Retrieve all facilities visible by the organization *FacilitiesApi* | [**findFacilitiesByProject**](docs/FacilitiesApi.md#findFacilitiesByProject) | **GET** /projects/{id}/facilities | Retrieve all facilities visible by the project +*FirmwareSetsApi* | [**getOrganizationFirmwareSets**](docs/FirmwareSetsApi.md#getOrganizationFirmwareSets) | **GET** /organizations/{id}/firmware-sets | Get Organization's Firmware Sets +*FirmwareSetsApi* | [**getProjectFirmwareSets**](docs/FirmwareSetsApi.md#getProjectFirmwareSets) | **GET** /projects/{id}/firmware-sets | Get Project's Firmware Sets *HardwareReservationsApi* | [**activateHardwareReservation**](docs/HardwareReservationsApi.md#activateHardwareReservation) | **POST** /hardware-reservations/{id}/activate | Activate a spare hardware reservation *HardwareReservationsApi* | [**findHardwareReservationById**](docs/HardwareReservationsApi.md#findHardwareReservationById) | **GET** /hardware-reservations/{id} | Retrieve a hardware reservation *HardwareReservationsApi* | [**findProjectHardwareReservations**](docs/HardwareReservationsApi.md#findProjectHardwareReservations) | **GET** /projects/{id}/hardware-reservations | Retrieve all hardware reservations for a given project @@ -424,6 +428,8 @@ Class | Method | HTTP request | Description - [ActivateHardwareReservationRequest](docs/ActivateHardwareReservationRequest.md) - [Address](docs/Address.md) + - [Attribute](docs/Attribute.md) + - [AttributeData](docs/AttributeData.md) - [AuthToken](docs/AuthToken.md) - [AuthTokenInput](docs/AuthTokenInput.md) - [AuthTokenList](docs/AuthTokenList.md) @@ -450,6 +456,7 @@ Class | Method | HTTP request | Description - [CapacityInput](docs/CapacityInput.md) - [CapacityLevelPerBaremetal](docs/CapacityLevelPerBaremetal.md) - [CapacityList](docs/CapacityList.md) + - [Component](docs/Component.md) - [Coordinates](docs/Coordinates.md) - [CreateDeviceRequest](docs/CreateDeviceRequest.md) - [CreateEmailInput](docs/CreateEmailInput.md) @@ -465,6 +472,7 @@ Class | Method | HTTP request | Description - [DeviceCreateInMetroInput](docs/DeviceCreateInMetroInput.md) - [DeviceCreateInput](docs/DeviceCreateInput.md) - [DeviceCreatedBy](docs/DeviceCreatedBy.md) + - [DeviceHealthRollup](docs/DeviceHealthRollup.md) - [DeviceList](docs/DeviceList.md) - [DeviceMetro](docs/DeviceMetro.md) - [DeviceProject](docs/DeviceProject.md) @@ -487,6 +495,9 @@ Class | Method | HTTP request | Description - [FindIPAddressById200Response](docs/FindIPAddressById200Response.md) - [FindMetalGatewayById200Response](docs/FindMetalGatewayById200Response.md) - [FindTrafficTimeframeParameter](docs/FindTrafficTimeframeParameter.md) + - [FirmwareSet](docs/FirmwareSet.md) + - [FirmwareSetListResponse](docs/FirmwareSetListResponse.md) + - [FirmwareSetResponse](docs/FirmwareSetResponse.md) - [GlobalBgpRange](docs/GlobalBgpRange.md) - [GlobalBgpRangeList](docs/GlobalBgpRangeList.md) - [HardwareReservation](docs/HardwareReservation.md) diff --git a/equinix-openapi-metal/api/openapi.yaml b/equinix-openapi-metal/api/openapi.yaml index f99d2fe8a..007b1cd19 100644 --- a/equinix-openapi-metal/api/openapi.yaml +++ b/equinix-openapi-metal/api/openapi.yaml @@ -178,6 +178,9 @@ tags: - description: | Facility Management. Check out the product docs to learn more about [Facilities](https://metal.equinix.com/developers/docs/locations/). name: Facilities +- description: | + Firmware Sets Management. Notice: Firmware Sets are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + name: Firmware Sets - description: | Global BGP Range Management externalDocs: @@ -1938,6 +1941,41 @@ paths: tags: - Devices x-accepts: application/json + /devices/{id}/diagnostics/health/rollup: + get: + description: Returns the health rollup status of the device. + operationId: getDeviceHealthRollup + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceHealthRollup' + description: Successful operation + "401": + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + "404": + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: Get Device's Health Status + tags: + - Devices + x-accepts: application/json /devices/{id}/events: get: description: Returns a list of events pertaining to a specific device @@ -2021,6 +2059,43 @@ paths: tags: - Events x-accepts: application/json + /devices/{id}/firmware-sets: + get: + description: "Returns the firmware set associated with the device. If a custom\ + \ firmware set is associated with the device, then it is returned. Otherwise,\ + \ if a default firmware set is available it is returned." + operationId: getDeviceFirmwareSets + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FirmwareSetResponse' + description: Successful operation + "401": + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + "404": + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: Get Device's associated Firmware Set + tags: + - Devices + x-accepts: application/json /devices/{id}/ips: get: description: Returns all ip assignments for a device. @@ -5374,6 +5449,51 @@ paths: tags: - Facilities x-accepts: application/json + /organizations/{id}/firmware-sets: + get: + description: Returns all firmware sets associated with the organization. + operationId: getOrganizationFirmwareSets + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: page number to return + in: query + name: page + schema: + type: integer + - description: items returned per page. + in: query + name: per_page + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FirmwareSetListResponse' + description: Successful operation + "401": + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + "404": + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: Get Organization's Firmware Sets + tags: + - Firmware Sets + x-accepts: application/json /organizations/{id}/invitations: get: description: Returns all invitations in an organization. @@ -8244,6 +8364,51 @@ paths: tags: - Facilities x-accepts: application/json + /projects/{id}/firmware-sets: + get: + description: Returns all firmware sets associated with the project or organization. + operationId: getProjectFirmwareSets + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: page number to return + in: query + name: page + schema: + type: integer + - description: items returned per page. + in: query + name: per_page + schema: + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FirmwareSetListResponse' + description: Successful operation + "401": + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + "404": + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: Get Project's Firmware Sets + tags: + - Firmware Sets + x-accepts: application/json /projects/{id}/global-bgp-ranges: get: description: Returns all global bgp ranges for a project @@ -12659,6 +12824,10 @@ components: $ref: '#/components/schemas/SSHKeyCreateInput' description: ssh key to create required: true + responses: + Error: + description: Error responses are included with 4xx and 5xx HTTP responses from + the API service. Either "error" or "errors" will be set. schemas: Address: example: @@ -12691,6 +12860,59 @@ components: - country - zip_code type: object + Attribute: + example: + updated_at: 2000-01-23T04:56:07.000+00:00 + data: + vendor: vendor + model: model + plan: plan + latest: true + namespace: namespace + created_at: 2000-01-23T04:56:07.000+00:00 + properties: + namespace: + description: Attribute namespace + readOnly: true + type: string + created_at: + description: Datetime when the block was created. + format: date-time + readOnly: true + type: string + updated_at: + description: Datetime when the block was updated. + format: date-time + readOnly: true + type: string + data: + $ref: '#/components/schemas/AttributeData' + type: object + AttributeData: + example: + vendor: vendor + model: model + plan: plan + latest: true + properties: + latest: + description: Boolean flag to know if the firmware set is the latest for + the model and vendor + readOnly: true + type: boolean + model: + description: Model on which this firmware set can be applied + readOnly: true + type: string + vendor: + description: Vendor on which this firmware set can be applied + readOnly: true + type: string + plan: + description: Plan where the firmware set can be applied + readOnly: true + type: string + type: object AuthToken: example: updated_at: 2000-01-23T04:56:07.000+00:00 @@ -14321,6 +14543,77 @@ components: $ref: '#/components/schemas/CapacityLevelPerBaremetal' type: object type: object + Component: + example: + component: bmc + filename: filename + updated_at: 2000-01-23T04:56:07.000+00:00 + vendor: equinix + upstream_url: upstream_url + checksum: checksum + created_at: 2000-01-23T04:56:07.000+00:00 + model: + - romed8hm3 + - romed8hm3 + repository_url: repository_url + uuid: 0516463a-47ee-4809-9a66-ece8c740eed9 + version: 1.5.0 + properties: + uuid: + description: Component UUID + example: 0516463a-47ee-4809-9a66-ece8c740eed9 + format: uuid + readOnly: true + type: string + vendor: + description: Component vendor + example: equinix + readOnly: true + type: string + model: + description: List of models where this component version can be applied + items: + example: romed8hm3 + type: string + readOnly: true + type: array + filename: + description: name of the file + readOnly: true + type: string + version: + description: Version of the component + example: 1.5.0 + readOnly: true + type: string + component: + description: Component type + example: bmc + readOnly: true + type: string + checksum: + description: File checksum + readOnly: true + type: string + upstream_url: + description: Location of the file + readOnly: true + type: string + repository_url: + description: Location of the file in the repository + readOnly: true + type: string + created_at: + description: Datetime when the block was created. + format: date-time + readOnly: true + type: string + updated_at: + description: Datetime when the block was updated. + format: date-time + readOnly: true + type: string + type: object Coordinates: example: latitude: latitude @@ -15337,6 +15630,26 @@ components: - operating_system - plan type: object + DeviceHealthRollup: + description: Represents a Device Health Status + example: + health_rollup: ok + updated_at: 2000-01-23T04:56:07.000+00:00 + properties: + health_rollup: + description: Health Status + enum: + - ok + - warning + - critical + readOnly: true + type: string + updated_at: + description: Last update of health status. + format: date-time + readOnly: true + type: string + type: object DeviceCreateInFacilityInput: allOf: - $ref: '#/components/schemas/FacilityInput' @@ -16421,6 +16734,7 @@ components: spot_instance: true network_frozen: true description: description + firmware_set_id: firmware_set_id always_pxe: true billing_cycle: billing_cycle customdata: @@ -16443,6 +16757,8 @@ components: type: string hostname: type: string + firmware_set_id: + type: string ipxe_script_url: type: string locked: @@ -16850,6 +17166,280 @@ components: $ref: '#/components/schemas/Facility' type: array type: object + FirmwareSet: + description: Represents a Firmware Set + example: + updated_at: 2000-01-23T04:56:07.000+00:00 + name: name + created_at: 2000-01-23T04:56:07.000+00:00 + attributes: + - updated_at: 2000-01-23T04:56:07.000+00:00 + data: + vendor: vendor + model: model + plan: plan + latest: true + namespace: namespace + created_at: 2000-01-23T04:56:07.000+00:00 + - updated_at: 2000-01-23T04:56:07.000+00:00 + data: + vendor: vendor + model: model + plan: plan + latest: true + namespace: namespace + created_at: 2000-01-23T04:56:07.000+00:00 + uuid: 0516463a-47ee-4809-9a66-ece8c740eed9 + component_firmware: + - component: bmc + filename: filename + updated_at: 2000-01-23T04:56:07.000+00:00 + vendor: equinix + upstream_url: upstream_url + checksum: checksum + created_at: 2000-01-23T04:56:07.000+00:00 + model: + - romed8hm3 + - romed8hm3 + repository_url: repository_url + uuid: 0516463a-47ee-4809-9a66-ece8c740eed9 + version: 1.5.0 + - component: bmc + filename: filename + updated_at: 2000-01-23T04:56:07.000+00:00 + vendor: equinix + upstream_url: upstream_url + checksum: checksum + created_at: 2000-01-23T04:56:07.000+00:00 + model: + - romed8hm3 + - romed8hm3 + repository_url: repository_url + uuid: 0516463a-47ee-4809-9a66-ece8c740eed9 + version: 1.5.0 + properties: + uuid: + description: Firmware Set UUID + example: 0516463a-47ee-4809-9a66-ece8c740eed9 + format: uuid + readOnly: true + type: string + name: + description: Firmware Set Name + readOnly: true + type: string + created_at: + description: Datetime when the block was created. + format: date-time + readOnly: true + type: string + updated_at: + description: Datetime when the block was updated. + format: date-time + readOnly: true + type: string + attributes: + description: Represents a list of attributes + items: + $ref: '#/components/schemas/Attribute' + type: array + component_firmware: + description: List of components versions + items: + $ref: '#/components/schemas/Component' + type: array + required: + - name + - uuid + type: object + FirmwareSetList: + description: Represents a list of FirmwareSets + items: + $ref: '#/components/schemas/FirmwareSet' + type: array + FirmwareSetListResponse: + description: Represents collection of Firmware Sets + example: + total_record_count: 5 + records: + - updated_at: 2000-01-23T04:56:07.000+00:00 + name: name + created_at: 2000-01-23T04:56:07.000+00:00 + attributes: + - updated_at: 2000-01-23T04:56:07.000+00:00 + data: + vendor: vendor + model: model + plan: plan + latest: true + namespace: namespace + created_at: 2000-01-23T04:56:07.000+00:00 + - updated_at: 2000-01-23T04:56:07.000+00:00 + data: + vendor: vendor + model: model + plan: plan + latest: true + namespace: namespace + created_at: 2000-01-23T04:56:07.000+00:00 + uuid: 0516463a-47ee-4809-9a66-ece8c740eed9 + component_firmware: + - component: bmc + filename: filename + updated_at: 2000-01-23T04:56:07.000+00:00 + vendor: equinix + upstream_url: upstream_url + checksum: checksum + created_at: 2000-01-23T04:56:07.000+00:00 + model: + - romed8hm3 + - romed8hm3 + repository_url: repository_url + uuid: 0516463a-47ee-4809-9a66-ece8c740eed9 + version: 1.5.0 + - component: bmc + filename: filename + updated_at: 2000-01-23T04:56:07.000+00:00 + vendor: equinix + upstream_url: upstream_url + checksum: checksum + created_at: 2000-01-23T04:56:07.000+00:00 + model: + - romed8hm3 + - romed8hm3 + repository_url: repository_url + uuid: 0516463a-47ee-4809-9a66-ece8c740eed9 + version: 1.5.0 + - updated_at: 2000-01-23T04:56:07.000+00:00 + name: name + created_at: 2000-01-23T04:56:07.000+00:00 + attributes: + - updated_at: 2000-01-23T04:56:07.000+00:00 + data: + vendor: vendor + model: model + plan: plan + latest: true + namespace: namespace + created_at: 2000-01-23T04:56:07.000+00:00 + - updated_at: 2000-01-23T04:56:07.000+00:00 + data: + vendor: vendor + model: model + plan: plan + latest: true + namespace: namespace + created_at: 2000-01-23T04:56:07.000+00:00 + uuid: 0516463a-47ee-4809-9a66-ece8c740eed9 + component_firmware: + - component: bmc + filename: filename + updated_at: 2000-01-23T04:56:07.000+00:00 + vendor: equinix + upstream_url: upstream_url + checksum: checksum + created_at: 2000-01-23T04:56:07.000+00:00 + model: + - romed8hm3 + - romed8hm3 + repository_url: repository_url + uuid: 0516463a-47ee-4809-9a66-ece8c740eed9 + version: 1.5.0 + - component: bmc + filename: filename + updated_at: 2000-01-23T04:56:07.000+00:00 + vendor: equinix + upstream_url: upstream_url + checksum: checksum + created_at: 2000-01-23T04:56:07.000+00:00 + model: + - romed8hm3 + - romed8hm3 + repository_url: repository_url + uuid: 0516463a-47ee-4809-9a66-ece8c740eed9 + version: 1.5.0 + page: 6 + total_pages: 5 + page_count: 1 + page_size: 0 + properties: + page_size: + description: Max number of items returned in a page + type: integer + page: + description: Page returned + type: integer + page_count: + description: Items returned in current page + type: integer + total_pages: + description: Total count of pages + type: integer + total_record_count: + description: Total count of items + type: integer + records: + description: Represents a list of FirmwareSets + items: + $ref: '#/components/schemas/FirmwareSet' + type: array + type: object + FirmwareSetResponse: + description: Represents single Firmware set response + example: + record: + updated_at: 2000-01-23T04:56:07.000+00:00 + name: name + created_at: 2000-01-23T04:56:07.000+00:00 + attributes: + - updated_at: 2000-01-23T04:56:07.000+00:00 + data: + vendor: vendor + model: model + plan: plan + latest: true + namespace: namespace + created_at: 2000-01-23T04:56:07.000+00:00 + - updated_at: 2000-01-23T04:56:07.000+00:00 + data: + vendor: vendor + model: model + plan: plan + latest: true + namespace: namespace + created_at: 2000-01-23T04:56:07.000+00:00 + uuid: 0516463a-47ee-4809-9a66-ece8c740eed9 + component_firmware: + - component: bmc + filename: filename + updated_at: 2000-01-23T04:56:07.000+00:00 + vendor: equinix + upstream_url: upstream_url + checksum: checksum + created_at: 2000-01-23T04:56:07.000+00:00 + model: + - romed8hm3 + - romed8hm3 + repository_url: repository_url + uuid: 0516463a-47ee-4809-9a66-ece8c740eed9 + version: 1.5.0 + - component: bmc + filename: filename + updated_at: 2000-01-23T04:56:07.000+00:00 + vendor: equinix + upstream_url: upstream_url + checksum: checksum + created_at: 2000-01-23T04:56:07.000+00:00 + model: + - romed8hm3 + - romed8hm3 + repository_url: repository_url + uuid: 0516463a-47ee-4809-9a66-ece8c740eed9 + version: 1.5.0 + properties: + record: + $ref: '#/components/schemas/FirmwareSet' + type: object GlobalBgpRange: example: address_family: 6 diff --git a/equinix-openapi-metal/build.gradle b/equinix-openapi-metal/build.gradle index d5347d7cb..f07b57dee 100644 --- a/equinix-openapi-metal/build.gradle +++ b/equinix-openapi-metal/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'com.equinix' -version = '0.5.0' +version = '0.6.0' buildscript { repositories { diff --git a/equinix-openapi-metal/build.sbt b/equinix-openapi-metal/build.sbt index 84811cc9a..4a78edfa4 100644 --- a/equinix-openapi-metal/build.sbt +++ b/equinix-openapi-metal/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "com.equinix", name := "equinix-openapi-metal", - version := "0.5.0", + version := "0.6.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), diff --git a/equinix-openapi-metal/docs/Attribute.md b/equinix-openapi-metal/docs/Attribute.md new file mode 100644 index 000000000..c5d6ca382 --- /dev/null +++ b/equinix-openapi-metal/docs/Attribute.md @@ -0,0 +1,16 @@ + + +# Attribute + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**namespace** | **String** | Attribute namespace | [optional] [readonly] | +|**createdAt** | **OffsetDateTime** | Datetime when the block was created. | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | Datetime when the block was updated. | [optional] [readonly] | +|**data** | [**AttributeData**](AttributeData.md) | | [optional] | + + + diff --git a/equinix-openapi-metal/docs/AttributeData.md b/equinix-openapi-metal/docs/AttributeData.md new file mode 100644 index 000000000..5fe4f0c9b --- /dev/null +++ b/equinix-openapi-metal/docs/AttributeData.md @@ -0,0 +1,16 @@ + + +# AttributeData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**latest** | **Boolean** | Boolean flag to know if the firmware set is the latest for the model and vendor | [optional] [readonly] | +|**model** | **String** | Model on which this firmware set can be applied | [optional] [readonly] | +|**vendor** | **String** | Vendor on which this firmware set can be applied | [optional] [readonly] | +|**plan** | **String** | Plan where the firmware set can be applied | [optional] [readonly] | + + + diff --git a/equinix-openapi-metal/docs/Component.md b/equinix-openapi-metal/docs/Component.md new file mode 100644 index 000000000..e7b33abc0 --- /dev/null +++ b/equinix-openapi-metal/docs/Component.md @@ -0,0 +1,23 @@ + + +# Component + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **UUID** | Component UUID | [optional] [readonly] | +|**vendor** | **String** | Component vendor | [optional] [readonly] | +|**model** | **List<String>** | List of models where this component version can be applied | [optional] [readonly] | +|**filename** | **String** | name of the file | [optional] [readonly] | +|**version** | **String** | Version of the component | [optional] [readonly] | +|**component** | **String** | Component type | [optional] [readonly] | +|**checksum** | **String** | File checksum | [optional] [readonly] | +|**upstreamUrl** | **String** | Location of the file | [optional] [readonly] | +|**repositoryUrl** | **String** | Location of the file in the repository | [optional] [readonly] | +|**createdAt** | **OffsetDateTime** | Datetime when the block was created. | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | Datetime when the block was updated. | [optional] [readonly] | + + + diff --git a/equinix-openapi-metal/docs/DeviceHealthRollup.md b/equinix-openapi-metal/docs/DeviceHealthRollup.md new file mode 100644 index 000000000..18d98c1b0 --- /dev/null +++ b/equinix-openapi-metal/docs/DeviceHealthRollup.md @@ -0,0 +1,25 @@ + + +# DeviceHealthRollup + +Represents a Device Health Status + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**healthRollup** | [**HealthRollupEnum**](#HealthRollupEnum) | Health Status | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | Last update of health status. | [optional] [readonly] | + + + +## Enum: HealthRollupEnum + +| Name | Value | +|---- | -----| +| OK | "ok" | +| WARNING | "warning" | +| CRITICAL | "critical" | + + + diff --git a/equinix-openapi-metal/docs/DeviceUpdateInput.md b/equinix-openapi-metal/docs/DeviceUpdateInput.md index e84215592..9fb2be030 100644 --- a/equinix-openapi-metal/docs/DeviceUpdateInput.md +++ b/equinix-openapi-metal/docs/DeviceUpdateInput.md @@ -12,6 +12,7 @@ |**customdata** | **Map<String, Object>** | | [optional] | |**description** | **String** | | [optional] | |**hostname** | **String** | | [optional] | +|**firmwareSetId** | **String** | | [optional] | |**ipxeScriptUrl** | **String** | | [optional] | |**locked** | **Boolean** | Whether the device should be locked, preventing accidental deletion. | [optional] | |**networkFrozen** | **Boolean** | If true, this instance can not be converted to a different network type. | [optional] | diff --git a/equinix-openapi-metal/docs/DevicesApi.md b/equinix-openapi-metal/docs/DevicesApi.md index 04bc8a475..69e7e9eda 100644 --- a/equinix-openapi-metal/docs/DevicesApi.md +++ b/equinix-openapi-metal/docs/DevicesApi.md @@ -20,6 +20,8 @@ All URIs are relative to *https://api.equinix.com/metal/v1* | [**findProjectDevices**](DevicesApi.md#findProjectDevices) | **GET** /projects/{id}/devices | Retrieve all devices of a project | | [**findTraffic**](DevicesApi.md#findTraffic) | **GET** /devices/{id}/traffic | Retrieve device traffic | | [**getBgpNeighborData**](DevicesApi.md#getBgpNeighborData) | **GET** /devices/{id}/bgp/neighbors | Retrieve BGP neighbor data for this device | +| [**getDeviceFirmwareSets**](DevicesApi.md#getDeviceFirmwareSets) | **GET** /devices/{id}/firmware-sets | Get Device's associated Firmware Set | +| [**getDeviceHealthRollup**](DevicesApi.md#getDeviceHealthRollup) | **GET** /devices/{id}/diagnostics/health/rollup | Get Device's Health Status | | [**performAction**](DevicesApi.md#performAction) | **POST** /devices/{id}/actions | Perform an action | | [**updateDevice**](DevicesApi.md#updateDevice) | **PUT** /devices/{id} | Update the device | @@ -1262,6 +1264,150 @@ public class Example { | **403** | forbidden | - | | **404** | not found | - | + +# **getDeviceFirmwareSets** +> FirmwareSetResponse getDeviceFirmwareSets(id) + +Get Device's associated Firmware Set + +Returns the firmware set associated with the device. If a custom firmware set is associated with the device, then it is returned. Otherwise, if a default firmware set is available it is returned. + +### Example +```java +// Import classes: +import com.equinix.openapi.ApiClient; +import com.equinix.openapi.ApiException; +import com.equinix.openapi.Configuration; +import com.equinix.openapi.auth.*; +import com.equinix.openapi.models.*; +import com.equinix.openapi.metal.v1.api.DevicesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.equinix.com/metal/v1"); + + // Configure API key authorization: x_auth_token + ApiKeyAuth x_auth_token = (ApiKeyAuth) defaultClient.getAuthentication("x_auth_token"); + x_auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //x_auth_token.setApiKeyPrefix("Token"); + + DevicesApi apiInstance = new DevicesApi(defaultClient); + UUID id = UUID.randomUUID(); // UUID | Device UUID + try { + FirmwareSetResponse result = apiInstance.getDeviceFirmwareSets(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DevicesApi#getDeviceFirmwareSets"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **UUID**| Device UUID | | + +### Return type + +[**FirmwareSetResponse**](FirmwareSetResponse.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **401** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +| **404** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +| **500** | Internal Server Error | - | + + +# **getDeviceHealthRollup** +> DeviceHealthRollup getDeviceHealthRollup(id) + +Get Device's Health Status + +Returns the health rollup status of the device. + +### Example +```java +// Import classes: +import com.equinix.openapi.ApiClient; +import com.equinix.openapi.ApiException; +import com.equinix.openapi.Configuration; +import com.equinix.openapi.auth.*; +import com.equinix.openapi.models.*; +import com.equinix.openapi.metal.v1.api.DevicesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.equinix.com/metal/v1"); + + // Configure API key authorization: x_auth_token + ApiKeyAuth x_auth_token = (ApiKeyAuth) defaultClient.getAuthentication("x_auth_token"); + x_auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //x_auth_token.setApiKeyPrefix("Token"); + + DevicesApi apiInstance = new DevicesApi(defaultClient); + UUID id = UUID.randomUUID(); // UUID | Device UUID + try { + DeviceHealthRollup result = apiInstance.getDeviceHealthRollup(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DevicesApi#getDeviceHealthRollup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **UUID**| Device UUID | | + +### Return type + +[**DeviceHealthRollup**](DeviceHealthRollup.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **401** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +| **404** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +| **500** | Internal Server Error | - | + # **performAction** > performAction(id, deviceActionInput) diff --git a/equinix-openapi-metal/docs/FirmwareSet.md b/equinix-openapi-metal/docs/FirmwareSet.md new file mode 100644 index 000000000..7d4d45489 --- /dev/null +++ b/equinix-openapi-metal/docs/FirmwareSet.md @@ -0,0 +1,19 @@ + + +# FirmwareSet + +Represents a Firmware Set + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **UUID** | Firmware Set UUID | [readonly] | +|**name** | **String** | Firmware Set Name | [readonly] | +|**createdAt** | **OffsetDateTime** | Datetime when the block was created. | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | Datetime when the block was updated. | [optional] [readonly] | +|**attributes** | [**List<Attribute>**](Attribute.md) | Represents a list of attributes | [optional] | +|**componentFirmware** | [**List<Component>**](Component.md) | List of components versions | [optional] | + + + diff --git a/equinix-openapi-metal/docs/FirmwareSetListResponse.md b/equinix-openapi-metal/docs/FirmwareSetListResponse.md new file mode 100644 index 000000000..23b782e63 --- /dev/null +++ b/equinix-openapi-metal/docs/FirmwareSetListResponse.md @@ -0,0 +1,19 @@ + + +# FirmwareSetListResponse + +Represents collection of Firmware Sets + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pageSize** | **Integer** | Max number of items returned in a page | [optional] | +|**page** | **Integer** | Page returned | [optional] | +|**pageCount** | **Integer** | Items returned in current page | [optional] | +|**totalPages** | **Integer** | Total count of pages | [optional] | +|**totalRecordCount** | **Integer** | Total count of items | [optional] | +|**records** | [**List<FirmwareSet>**](FirmwareSet.md) | Represents a list of FirmwareSets | [optional] | + + + diff --git a/equinix-openapi-metal/docs/FirmwareSetResponse.md b/equinix-openapi-metal/docs/FirmwareSetResponse.md new file mode 100644 index 000000000..154fa0e99 --- /dev/null +++ b/equinix-openapi-metal/docs/FirmwareSetResponse.md @@ -0,0 +1,14 @@ + + +# FirmwareSetResponse + +Represents single Firmware set response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**record** | [**FirmwareSet**](FirmwareSet.md) | | [optional] | + + + diff --git a/equinix-openapi-metal/docs/FirmwareSetsApi.md b/equinix-openapi-metal/docs/FirmwareSetsApi.md new file mode 100644 index 000000000..6b08f7c98 --- /dev/null +++ b/equinix-openapi-metal/docs/FirmwareSetsApi.md @@ -0,0 +1,162 @@ +# FirmwareSetsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getOrganizationFirmwareSets**](FirmwareSetsApi.md#getOrganizationFirmwareSets) | **GET** /organizations/{id}/firmware-sets | Get Organization's Firmware Sets | +| [**getProjectFirmwareSets**](FirmwareSetsApi.md#getProjectFirmwareSets) | **GET** /projects/{id}/firmware-sets | Get Project's Firmware Sets | + + + +# **getOrganizationFirmwareSets** +> FirmwareSetListResponse getOrganizationFirmwareSets(id, page, perPage) + +Get Organization's Firmware Sets + +Returns all firmware sets associated with the organization. + +### Example +```java +// Import classes: +import com.equinix.openapi.ApiClient; +import com.equinix.openapi.ApiException; +import com.equinix.openapi.Configuration; +import com.equinix.openapi.auth.*; +import com.equinix.openapi.models.*; +import com.equinix.openapi.metal.v1.api.FirmwareSetsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.equinix.com/metal/v1"); + + // Configure API key authorization: x_auth_token + ApiKeyAuth x_auth_token = (ApiKeyAuth) defaultClient.getAuthentication("x_auth_token"); + x_auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //x_auth_token.setApiKeyPrefix("Token"); + + FirmwareSetsApi apiInstance = new FirmwareSetsApi(defaultClient); + UUID id = UUID.randomUUID(); // UUID | Organization UUID + Integer page = 56; // Integer | page number to return + Integer perPage = 56; // Integer | items returned per page. + try { + FirmwareSetListResponse result = apiInstance.getOrganizationFirmwareSets(id, page, perPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FirmwareSetsApi#getOrganizationFirmwareSets"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **UUID**| Organization UUID | | +| **page** | **Integer**| page number to return | [optional] | +| **perPage** | **Integer**| items returned per page. | [optional] | + +### Return type + +[**FirmwareSetListResponse**](FirmwareSetListResponse.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **401** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +| **404** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +| **500** | Internal Server Error | - | + + +# **getProjectFirmwareSets** +> FirmwareSetListResponse getProjectFirmwareSets(id, page, perPage) + +Get Project's Firmware Sets + +Returns all firmware sets associated with the project or organization. + +### Example +```java +// Import classes: +import com.equinix.openapi.ApiClient; +import com.equinix.openapi.ApiException; +import com.equinix.openapi.Configuration; +import com.equinix.openapi.auth.*; +import com.equinix.openapi.models.*; +import com.equinix.openapi.metal.v1.api.FirmwareSetsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.equinix.com/metal/v1"); + + // Configure API key authorization: x_auth_token + ApiKeyAuth x_auth_token = (ApiKeyAuth) defaultClient.getAuthentication("x_auth_token"); + x_auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //x_auth_token.setApiKeyPrefix("Token"); + + FirmwareSetsApi apiInstance = new FirmwareSetsApi(defaultClient); + UUID id = UUID.randomUUID(); // UUID | Project UUID + Integer page = 56; // Integer | page number to return + Integer perPage = 56; // Integer | items returned per page. + try { + FirmwareSetListResponse result = apiInstance.getProjectFirmwareSets(id, page, perPage); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FirmwareSetsApi#getProjectFirmwareSets"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **UUID**| Project UUID | | +| **page** | **Integer**| page number to return | [optional] | +| **perPage** | **Integer**| items returned per page. | [optional] | + +### Return type + +[**FirmwareSetListResponse**](FirmwareSetListResponse.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **401** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +| **404** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +| **500** | Internal Server Error | - | + diff --git a/equinix-openapi-metal/pom.xml b/equinix-openapi-metal/pom.xml index ce26a3664..33140bec2 100644 --- a/equinix-openapi-metal/pom.xml +++ b/equinix-openapi-metal/pom.xml @@ -5,7 +5,7 @@ equinix-openapi-metal jar equinix-openapi-metal - 0.5.0 + 0.6.0 https://github.com/openapitools/openapi-generator OpenAPI Java diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/ApiClient.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/ApiClient.java index 5e1ef6657..0c2b31624 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/ApiClient.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/ApiClient.java @@ -140,7 +140,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("metal-java/0.5.0"); + setUserAgent("metal-java/0.6.0"); authentications = new HashMap(); } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/Configuration.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/Configuration.java index 4cdbe2945..06dbe1bc5 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/Configuration.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/Configuration.java @@ -15,7 +15,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Configuration { - public static final String VERSION = "0.5.0"; + public static final String VERSION = "0.6.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/JSON.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/JSON.java index 2c3299e9f..52cfd1415 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/JSON.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/JSON.java @@ -95,6 +95,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.ActivateHardwareReservationRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.Address.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.Attribute.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.AttributeData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.AuthToken.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.AuthTokenInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.AuthTokenList.CustomTypeAdapterFactory()); @@ -121,6 +123,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.CapacityInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.CapacityLevelPerBaremetal.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.CapacityList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.Component.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.Coordinates.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.CreateDeviceRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.CreateEmailInput.CustomTypeAdapterFactory()); @@ -136,6 +139,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.DeviceCreateInMetroInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.DeviceCreateInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.DeviceCreatedBy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.DeviceHealthRollup.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.DeviceList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.DeviceMetro.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.DeviceProject.CustomTypeAdapterFactory()); @@ -158,6 +162,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.FindIPAddressById200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.FindMetalGatewayById200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.FindTrafficTimeframeParameter.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.FirmwareSet.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.FirmwareSetListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.FirmwareSetResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.GlobalBgpRange.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.GlobalBgpRangeList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.equinix.openapi.metal.v1.model.HardwareReservation.CustomTypeAdapterFactory()); diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/DevicesApi.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/DevicesApi.java index 26ada7eca..6da5c299e 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/DevicesApi.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/DevicesApi.java @@ -34,10 +34,12 @@ import com.equinix.openapi.metal.v1.model.CreateDeviceRequest; import com.equinix.openapi.metal.v1.model.Device; import com.equinix.openapi.metal.v1.model.DeviceActionInput; +import com.equinix.openapi.metal.v1.model.DeviceHealthRollup; import com.equinix.openapi.metal.v1.model.DeviceList; import com.equinix.openapi.metal.v1.model.DeviceUpdateInput; import com.equinix.openapi.metal.v1.model.Error; import com.equinix.openapi.metal.v1.model.FindTrafficTimeframeParameter; +import com.equinix.openapi.metal.v1.model.FirmwareSetResponse; import com.equinix.openapi.metal.v1.model.IPAssignment; import com.equinix.openapi.metal.v1.model.IPAssignmentInput; import com.equinix.openapi.metal.v1.model.IPAssignmentList; @@ -2616,6 +2618,276 @@ public okhttp3.Call getBgpNeighborDataAsync(UUID id, List include, final localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getDeviceFirmwareSets + * @param id Device UUID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public okhttp3.Call getDeviceFirmwareSetsCall(UUID id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/devices/{id}/firmware-sets" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "x_auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getDeviceFirmwareSetsValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling getDeviceFirmwareSets(Async)"); + } + + return getDeviceFirmwareSetsCall(id, _callback); + + } + + /** + * Get Device's associated Firmware Set + * Returns the firmware set associated with the device. If a custom firmware set is associated with the device, then it is returned. Otherwise, if a default firmware set is available it is returned. + * @param id Device UUID (required) + * @return FirmwareSetResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public FirmwareSetResponse getDeviceFirmwareSets(UUID id) throws ApiException { + ApiResponse localVarResp = getDeviceFirmwareSetsWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Get Device's associated Firmware Set + * Returns the firmware set associated with the device. If a custom firmware set is associated with the device, then it is returned. Otherwise, if a default firmware set is available it is returned. + * @param id Device UUID (required) + * @return ApiResponse<FirmwareSetResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public ApiResponse getDeviceFirmwareSetsWithHttpInfo(UUID id) throws ApiException { + okhttp3.Call localVarCall = getDeviceFirmwareSetsValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Device's associated Firmware Set (asynchronously) + * Returns the firmware set associated with the device. If a custom firmware set is associated with the device, then it is returned. Otherwise, if a default firmware set is available it is returned. + * @param id Device UUID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public okhttp3.Call getDeviceFirmwareSetsAsync(UUID id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getDeviceFirmwareSetsValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getDeviceHealthRollup + * @param id Device UUID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public okhttp3.Call getDeviceHealthRollupCall(UUID id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/devices/{id}/diagnostics/health/rollup" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "x_auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getDeviceHealthRollupValidateBeforeCall(UUID id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling getDeviceHealthRollup(Async)"); + } + + return getDeviceHealthRollupCall(id, _callback); + + } + + /** + * Get Device's Health Status + * Returns the health rollup status of the device. + * @param id Device UUID (required) + * @return DeviceHealthRollup + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public DeviceHealthRollup getDeviceHealthRollup(UUID id) throws ApiException { + ApiResponse localVarResp = getDeviceHealthRollupWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Get Device's Health Status + * Returns the health rollup status of the device. + * @param id Device UUID (required) + * @return ApiResponse<DeviceHealthRollup> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public ApiResponse getDeviceHealthRollupWithHttpInfo(UUID id) throws ApiException { + okhttp3.Call localVarCall = getDeviceHealthRollupValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Device's Health Status (asynchronously) + * Returns the health rollup status of the device. + * @param id Device UUID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public okhttp3.Call getDeviceHealthRollupAsync(UUID id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getDeviceHealthRollupValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for performAction * @param id Device UUID (required) diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/FirmwareSetsApi.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/FirmwareSetsApi.java new file mode 100644 index 000000000..e861a1c03 --- /dev/null +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/api/FirmwareSetsApi.java @@ -0,0 +1,380 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.api; + +import com.equinix.openapi.ApiCallback; +import com.equinix.openapi.ApiClient; +import com.equinix.openapi.ApiException; +import com.equinix.openapi.ApiResponse; +import com.equinix.openapi.Configuration; +import com.equinix.openapi.Pair; +import com.equinix.openapi.ProgressRequestBody; +import com.equinix.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.equinix.openapi.metal.v1.model.Error; +import com.equinix.openapi.metal.v1.model.FirmwareSetListResponse; +import java.util.UUID; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class FirmwareSetsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public FirmwareSetsApi() { + this(Configuration.getDefaultApiClient()); + } + + public FirmwareSetsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getOrganizationFirmwareSets + * @param id Organization UUID (required) + * @param page page number to return (optional) + * @param perPage items returned per page. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public okhttp3.Call getOrganizationFirmwareSetsCall(UUID id, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/organizations/{id}/firmware-sets" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (perPage != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("per_page", perPage)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "x_auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrganizationFirmwareSetsValidateBeforeCall(UUID id, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling getOrganizationFirmwareSets(Async)"); + } + + return getOrganizationFirmwareSetsCall(id, page, perPage, _callback); + + } + + /** + * Get Organization's Firmware Sets + * Returns all firmware sets associated with the organization. + * @param id Organization UUID (required) + * @param page page number to return (optional) + * @param perPage items returned per page. (optional) + * @return FirmwareSetListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public FirmwareSetListResponse getOrganizationFirmwareSets(UUID id, Integer page, Integer perPage) throws ApiException { + ApiResponse localVarResp = getOrganizationFirmwareSetsWithHttpInfo(id, page, perPage); + return localVarResp.getData(); + } + + /** + * Get Organization's Firmware Sets + * Returns all firmware sets associated with the organization. + * @param id Organization UUID (required) + * @param page page number to return (optional) + * @param perPage items returned per page. (optional) + * @return ApiResponse<FirmwareSetListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public ApiResponse getOrganizationFirmwareSetsWithHttpInfo(UUID id, Integer page, Integer perPage) throws ApiException { + okhttp3.Call localVarCall = getOrganizationFirmwareSetsValidateBeforeCall(id, page, perPage, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Organization's Firmware Sets (asynchronously) + * Returns all firmware sets associated with the organization. + * @param id Organization UUID (required) + * @param page page number to return (optional) + * @param perPage items returned per page. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public okhttp3.Call getOrganizationFirmwareSetsAsync(UUID id, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getOrganizationFirmwareSetsValidateBeforeCall(id, page, perPage, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getProjectFirmwareSets + * @param id Project UUID (required) + * @param page page number to return (optional) + * @param perPage items returned per page. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public okhttp3.Call getProjectFirmwareSetsCall(UUID id, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/projects/{id}/firmware-sets" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (perPage != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("per_page", perPage)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "x_auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getProjectFirmwareSetsValidateBeforeCall(UUID id, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling getProjectFirmwareSets(Async)"); + } + + return getProjectFirmwareSetsCall(id, page, perPage, _callback); + + } + + /** + * Get Project's Firmware Sets + * Returns all firmware sets associated with the project or organization. + * @param id Project UUID (required) + * @param page page number to return (optional) + * @param perPage items returned per page. (optional) + * @return FirmwareSetListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public FirmwareSetListResponse getProjectFirmwareSets(UUID id, Integer page, Integer perPage) throws ApiException { + ApiResponse localVarResp = getProjectFirmwareSetsWithHttpInfo(id, page, perPage); + return localVarResp.getData(); + } + + /** + * Get Project's Firmware Sets + * Returns all firmware sets associated with the project or organization. + * @param id Project UUID (required) + * @param page page number to return (optional) + * @param perPage items returned per page. (optional) + * @return ApiResponse<FirmwareSetListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public ApiResponse getProjectFirmwareSetsWithHttpInfo(UUID id, Integer page, Integer perPage) throws ApiException { + okhttp3.Call localVarCall = getProjectFirmwareSetsValidateBeforeCall(id, page, perPage, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Project's Firmware Sets (asynchronously) + * Returns all firmware sets associated with the project or organization. + * @param id Project UUID (required) + * @param page page number to return (optional) + * @param perPage items returned per page. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Successful operation -
401 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
404 Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. -
500 Internal Server Error -
+ */ + public okhttp3.Call getProjectFirmwareSetsAsync(UUID id, Integer page, Integer perPage, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getProjectFirmwareSetsValidateBeforeCall(id, page, perPage, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Attribute.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Attribute.java new file mode 100644 index 000000000..714986196 --- /dev/null +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Attribute.java @@ -0,0 +1,358 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.model; + +import java.util.Objects; +import java.util.Arrays; +import com.equinix.openapi.metal.v1.model.AttributeData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.equinix.openapi.JSON; + +/** + * Attribute + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Attribute { + public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; + @SerializedName(SERIALIZED_NAME_NAMESPACE) + private String namespace; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private AttributeData data; + + public Attribute() { + } + + + public Attribute( + String namespace, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this(); + this.namespace = namespace; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + /** + * Attribute namespace + * @return namespace + **/ + @javax.annotation.Nullable + public String getNamespace() { + return namespace; + } + + + + + /** + * Datetime when the block was created. + * @return createdAt + **/ + @javax.annotation.Nullable + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + + + /** + * Datetime when the block was updated. + * @return updatedAt + **/ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + + + + public Attribute data(AttributeData data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public AttributeData getData() { + return data; + } + + + public void setData(AttributeData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Attribute instance itself + */ + public Attribute putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Attribute attribute = (Attribute) o; + return Objects.equals(this.namespace, attribute.namespace) && + Objects.equals(this.createdAt, attribute.createdAt) && + Objects.equals(this.updatedAt, attribute.updatedAt) && + Objects.equals(this.data, attribute.data)&& + Objects.equals(this.additionalProperties, attribute.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(namespace, createdAt, updatedAt, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Attribute {\n"); + sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("namespace"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Attribute + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Attribute.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Attribute is not found in the empty JSON string", Attribute.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + AttributeData.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Attribute.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Attribute' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Attribute.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Attribute value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Attribute read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Attribute instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Attribute given an JSON string + * + * @param jsonString JSON string + * @return An instance of Attribute + * @throws IOException if the JSON string is invalid with respect to Attribute + */ + public static Attribute fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Attribute.class); + } + + /** + * Convert an instance of Attribute to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AttributeData.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AttributeData.java new file mode 100644 index 000000000..d9074733f --- /dev/null +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/AttributeData.java @@ -0,0 +1,351 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.equinix.openapi.JSON; + +/** + * AttributeData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AttributeData { + public static final String SERIALIZED_NAME_LATEST = "latest"; + @SerializedName(SERIALIZED_NAME_LATEST) + private Boolean latest; + + public static final String SERIALIZED_NAME_MODEL = "model"; + @SerializedName(SERIALIZED_NAME_MODEL) + private String model; + + public static final String SERIALIZED_NAME_VENDOR = "vendor"; + @SerializedName(SERIALIZED_NAME_VENDOR) + private String vendor; + + public static final String SERIALIZED_NAME_PLAN = "plan"; + @SerializedName(SERIALIZED_NAME_PLAN) + private String plan; + + public AttributeData() { + } + + + public AttributeData( + Boolean latest, + String model, + String vendor, + String plan + ) { + this(); + this.latest = latest; + this.model = model; + this.vendor = vendor; + this.plan = plan; + } + + /** + * Boolean flag to know if the firmware set is the latest for the model and vendor + * @return latest + **/ + @javax.annotation.Nullable + public Boolean getLatest() { + return latest; + } + + + + + /** + * Model on which this firmware set can be applied + * @return model + **/ + @javax.annotation.Nullable + public String getModel() { + return model; + } + + + + + /** + * Vendor on which this firmware set can be applied + * @return vendor + **/ + @javax.annotation.Nullable + public String getVendor() { + return vendor; + } + + + + + /** + * Plan where the firmware set can be applied + * @return plan + **/ + @javax.annotation.Nullable + public String getPlan() { + return plan; + } + + + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AttributeData instance itself + */ + public AttributeData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttributeData attributeData = (AttributeData) o; + return Objects.equals(this.latest, attributeData.latest) && + Objects.equals(this.model, attributeData.model) && + Objects.equals(this.vendor, attributeData.vendor) && + Objects.equals(this.plan, attributeData.plan)&& + Objects.equals(this.additionalProperties, attributeData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(latest, model, vendor, plan, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttributeData {\n"); + sb.append(" latest: ").append(toIndentedString(latest)).append("\n"); + sb.append(" model: ").append(toIndentedString(model)).append("\n"); + sb.append(" vendor: ").append(toIndentedString(vendor)).append("\n"); + sb.append(" plan: ").append(toIndentedString(plan)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("latest"); + openapiFields.add("model"); + openapiFields.add("vendor"); + openapiFields.add("plan"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AttributeData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AttributeData.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AttributeData is not found in the empty JSON string", AttributeData.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("model") != null && !jsonObj.get("model").isJsonNull()) && !jsonObj.get("model").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `model` to be a primitive type in the JSON string but got `%s`", jsonObj.get("model").toString())); + } + if ((jsonObj.get("vendor") != null && !jsonObj.get("vendor").isJsonNull()) && !jsonObj.get("vendor").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vendor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vendor").toString())); + } + if ((jsonObj.get("plan") != null && !jsonObj.get("plan").isJsonNull()) && !jsonObj.get("plan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AttributeData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AttributeData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AttributeData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AttributeData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AttributeData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + AttributeData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AttributeData given an JSON string + * + * @param jsonString JSON string + * @return An instance of AttributeData + * @throws IOException if the JSON string is invalid with respect to AttributeData + */ + public static AttributeData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AttributeData.class); + } + + /** + * Convert an instance of AttributeData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Component.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Component.java new file mode 100644 index 000000000..14a76cad0 --- /dev/null +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/Component.java @@ -0,0 +1,521 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.equinix.openapi.JSON; + +/** + * Component + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Component { + public static final String SERIALIZED_NAME_UUID = "uuid"; + @SerializedName(SERIALIZED_NAME_UUID) + private UUID uuid; + + public static final String SERIALIZED_NAME_VENDOR = "vendor"; + @SerializedName(SERIALIZED_NAME_VENDOR) + private String vendor; + + public static final String SERIALIZED_NAME_MODEL = "model"; + @SerializedName(SERIALIZED_NAME_MODEL) + private List model; + + public static final String SERIALIZED_NAME_FILENAME = "filename"; + @SerializedName(SERIALIZED_NAME_FILENAME) + private String filename; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public static final String SERIALIZED_NAME_COMPONENT = "component"; + @SerializedName(SERIALIZED_NAME_COMPONENT) + private String component; + + public static final String SERIALIZED_NAME_CHECKSUM = "checksum"; + @SerializedName(SERIALIZED_NAME_CHECKSUM) + private String checksum; + + public static final String SERIALIZED_NAME_UPSTREAM_URL = "upstream_url"; + @SerializedName(SERIALIZED_NAME_UPSTREAM_URL) + private String upstreamUrl; + + public static final String SERIALIZED_NAME_REPOSITORY_URL = "repository_url"; + @SerializedName(SERIALIZED_NAME_REPOSITORY_URL) + private String repositoryUrl; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public Component() { + } + + + public Component( + UUID uuid, + String vendor, + List model, + String filename, + String version, + String component, + String checksum, + String upstreamUrl, + String repositoryUrl, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this(); + this.uuid = uuid; + this.vendor = vendor; + this.model = model; + this.filename = filename; + this.version = version; + this.component = component; + this.checksum = checksum; + this.upstreamUrl = upstreamUrl; + this.repositoryUrl = repositoryUrl; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + /** + * Component UUID + * @return uuid + **/ + @javax.annotation.Nullable + public UUID getUuid() { + return uuid; + } + + + + + /** + * Component vendor + * @return vendor + **/ + @javax.annotation.Nullable + public String getVendor() { + return vendor; + } + + + + + /** + * List of models where this component version can be applied + * @return model + **/ + @javax.annotation.Nullable + public List getModel() { + return model; + } + + + + + /** + * name of the file + * @return filename + **/ + @javax.annotation.Nullable + public String getFilename() { + return filename; + } + + + + + /** + * Version of the component + * @return version + **/ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + + + + /** + * Component type + * @return component + **/ + @javax.annotation.Nullable + public String getComponent() { + return component; + } + + + + + /** + * File checksum + * @return checksum + **/ + @javax.annotation.Nullable + public String getChecksum() { + return checksum; + } + + + + + /** + * Location of the file + * @return upstreamUrl + **/ + @javax.annotation.Nullable + public String getUpstreamUrl() { + return upstreamUrl; + } + + + + + /** + * Location of the file in the repository + * @return repositoryUrl + **/ + @javax.annotation.Nullable + public String getRepositoryUrl() { + return repositoryUrl; + } + + + + + /** + * Datetime when the block was created. + * @return createdAt + **/ + @javax.annotation.Nullable + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + + + /** + * Datetime when the block was updated. + * @return updatedAt + **/ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Component instance itself + */ + public Component putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Component component = (Component) o; + return Objects.equals(this.uuid, component.uuid) && + Objects.equals(this.vendor, component.vendor) && + Objects.equals(this.model, component.model) && + Objects.equals(this.filename, component.filename) && + Objects.equals(this.version, component.version) && + Objects.equals(this.component, component.component) && + Objects.equals(this.checksum, component.checksum) && + Objects.equals(this.upstreamUrl, component.upstreamUrl) && + Objects.equals(this.repositoryUrl, component.repositoryUrl) && + Objects.equals(this.createdAt, component.createdAt) && + Objects.equals(this.updatedAt, component.updatedAt)&& + Objects.equals(this.additionalProperties, component.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, vendor, model, filename, version, component, checksum, upstreamUrl, repositoryUrl, createdAt, updatedAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Component {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" vendor: ").append(toIndentedString(vendor)).append("\n"); + sb.append(" model: ").append(toIndentedString(model)).append("\n"); + sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" component: ").append(toIndentedString(component)).append("\n"); + sb.append(" checksum: ").append(toIndentedString(checksum)).append("\n"); + sb.append(" upstreamUrl: ").append(toIndentedString(upstreamUrl)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("uuid"); + openapiFields.add("vendor"); + openapiFields.add("model"); + openapiFields.add("filename"); + openapiFields.add("version"); + openapiFields.add("component"); + openapiFields.add("checksum"); + openapiFields.add("upstream_url"); + openapiFields.add("repository_url"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Component + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Component.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Component is not found in the empty JSON string", Component.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonNull()) && !jsonObj.get("uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uuid").toString())); + } + if ((jsonObj.get("vendor") != null && !jsonObj.get("vendor").isJsonNull()) && !jsonObj.get("vendor").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vendor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vendor").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("model") != null && !jsonObj.get("model").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `model` to be an array in the JSON string but got `%s`", jsonObj.get("model").toString())); + } + if ((jsonObj.get("filename") != null && !jsonObj.get("filename").isJsonNull()) && !jsonObj.get("filename").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `filename` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filename").toString())); + } + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + if ((jsonObj.get("component") != null && !jsonObj.get("component").isJsonNull()) && !jsonObj.get("component").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `component` to be a primitive type in the JSON string but got `%s`", jsonObj.get("component").toString())); + } + if ((jsonObj.get("checksum") != null && !jsonObj.get("checksum").isJsonNull()) && !jsonObj.get("checksum").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checksum` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checksum").toString())); + } + if ((jsonObj.get("upstream_url") != null && !jsonObj.get("upstream_url").isJsonNull()) && !jsonObj.get("upstream_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `upstream_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("upstream_url").toString())); + } + if ((jsonObj.get("repository_url") != null && !jsonObj.get("repository_url").isJsonNull()) && !jsonObj.get("repository_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `repository_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("repository_url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Component.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Component' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Component.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Component value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Component read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Component instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Component given an JSON string + * + * @param jsonString JSON string + * @return An instance of Component + * @throws IOException if the JSON string is invalid with respect to Component + */ + public static Component fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Component.class); + } + + /** + * Convert an instance of Component to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceHealthRollup.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceHealthRollup.java new file mode 100644 index 000000000..742cdeaa8 --- /dev/null +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceHealthRollup.java @@ -0,0 +1,353 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.equinix.openapi.JSON; + +/** + * Represents a Device Health Status + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeviceHealthRollup { + /** + * Health Status + */ + @JsonAdapter(HealthRollupEnum.Adapter.class) + public enum HealthRollupEnum { + OK("ok"), + + WARNING("warning"), + + CRITICAL("critical"); + + private String value; + + HealthRollupEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static HealthRollupEnum fromValue(String value) { + for (HealthRollupEnum b : HealthRollupEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final HealthRollupEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public HealthRollupEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return HealthRollupEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_HEALTH_ROLLUP = "health_rollup"; + @SerializedName(SERIALIZED_NAME_HEALTH_ROLLUP) + private HealthRollupEnum healthRollup; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public DeviceHealthRollup() { + } + + + public DeviceHealthRollup( + HealthRollupEnum healthRollup, + OffsetDateTime updatedAt + ) { + this(); + this.healthRollup = healthRollup; + this.updatedAt = updatedAt; + } + + /** + * Health Status + * @return healthRollup + **/ + @javax.annotation.Nullable + public HealthRollupEnum getHealthRollup() { + return healthRollup; + } + + + + + /** + * Last update of health status. + * @return updatedAt + **/ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DeviceHealthRollup instance itself + */ + public DeviceHealthRollup putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceHealthRollup deviceHealthRollup = (DeviceHealthRollup) o; + return Objects.equals(this.healthRollup, deviceHealthRollup.healthRollup) && + Objects.equals(this.updatedAt, deviceHealthRollup.updatedAt)&& + Objects.equals(this.additionalProperties, deviceHealthRollup.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(healthRollup, updatedAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceHealthRollup {\n"); + sb.append(" healthRollup: ").append(toIndentedString(healthRollup)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("health_rollup"); + openapiFields.add("updated_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeviceHealthRollup + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeviceHealthRollup.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeviceHealthRollup is not found in the empty JSON string", DeviceHealthRollup.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("health_rollup") != null && !jsonObj.get("health_rollup").isJsonNull()) && !jsonObj.get("health_rollup").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `health_rollup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("health_rollup").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeviceHealthRollup.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeviceHealthRollup' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeviceHealthRollup.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeviceHealthRollup value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DeviceHealthRollup read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + DeviceHealthRollup instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeviceHealthRollup given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeviceHealthRollup + * @throws IOException if the JSON string is invalid with respect to DeviceHealthRollup + */ + public static DeviceHealthRollup fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeviceHealthRollup.class); + } + + /** + * Convert an instance of DeviceHealthRollup to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceUpdateInput.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceUpdateInput.java index 80dbbb2a9..368cdeebd 100644 --- a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceUpdateInput.java +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/DeviceUpdateInput.java @@ -76,6 +76,10 @@ public class DeviceUpdateInput { @SerializedName(SERIALIZED_NAME_HOSTNAME) private String hostname; + public static final String SERIALIZED_NAME_FIRMWARE_SET_ID = "firmware_set_id"; + @SerializedName(SERIALIZED_NAME_FIRMWARE_SET_ID) + private String firmwareSetId; + public static final String SERIALIZED_NAME_IPXE_SCRIPT_URL = "ipxe_script_url"; @SerializedName(SERIALIZED_NAME_IPXE_SCRIPT_URL) private String ipxeScriptUrl; @@ -216,6 +220,27 @@ public void setHostname(String hostname) { } + public DeviceUpdateInput firmwareSetId(String firmwareSetId) { + + this.firmwareSetId = firmwareSetId; + return this; + } + + /** + * Get firmwareSetId + * @return firmwareSetId + **/ + @javax.annotation.Nullable + public String getFirmwareSetId() { + return firmwareSetId; + } + + + public void setFirmwareSetId(String firmwareSetId) { + this.firmwareSetId = firmwareSetId; + } + + public DeviceUpdateInput ipxeScriptUrl(String ipxeScriptUrl) { this.ipxeScriptUrl = ipxeScriptUrl; @@ -409,6 +434,7 @@ public boolean equals(Object o) { Objects.equals(this.customdata, deviceUpdateInput.customdata) && Objects.equals(this.description, deviceUpdateInput.description) && Objects.equals(this.hostname, deviceUpdateInput.hostname) && + Objects.equals(this.firmwareSetId, deviceUpdateInput.firmwareSetId) && Objects.equals(this.ipxeScriptUrl, deviceUpdateInput.ipxeScriptUrl) && Objects.equals(this.locked, deviceUpdateInput.locked) && Objects.equals(this.networkFrozen, deviceUpdateInput.networkFrozen) && @@ -420,7 +446,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(alwaysPxe, billingCycle, customdata, description, hostname, ipxeScriptUrl, locked, networkFrozen, spotInstance, tags, userdata, additionalProperties); + return Objects.hash(alwaysPxe, billingCycle, customdata, description, hostname, firmwareSetId, ipxeScriptUrl, locked, networkFrozen, spotInstance, tags, userdata, additionalProperties); } @Override @@ -432,6 +458,7 @@ public String toString() { sb.append(" customdata: ").append(toIndentedString(customdata)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" hostname: ").append(toIndentedString(hostname)).append("\n"); + sb.append(" firmwareSetId: ").append(toIndentedString(firmwareSetId)).append("\n"); sb.append(" ipxeScriptUrl: ").append(toIndentedString(ipxeScriptUrl)).append("\n"); sb.append(" locked: ").append(toIndentedString(locked)).append("\n"); sb.append(" networkFrozen: ").append(toIndentedString(networkFrozen)).append("\n"); @@ -466,6 +493,7 @@ private String toIndentedString(Object o) { openapiFields.add("customdata"); openapiFields.add("description"); openapiFields.add("hostname"); + openapiFields.add("firmware_set_id"); openapiFields.add("ipxe_script_url"); openapiFields.add("locked"); openapiFields.add("network_frozen"); @@ -498,6 +526,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("hostname") != null && !jsonObj.get("hostname").isJsonNull()) && !jsonObj.get("hostname").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `hostname` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hostname").toString())); } + if ((jsonObj.get("firmware_set_id") != null && !jsonObj.get("firmware_set_id").isJsonNull()) && !jsonObj.get("firmware_set_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `firmware_set_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firmware_set_id").toString())); + } if ((jsonObj.get("ipxe_script_url") != null && !jsonObj.get("ipxe_script_url").isJsonNull()) && !jsonObj.get("ipxe_script_url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `ipxe_script_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipxe_script_url").toString())); } diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FirmwareSet.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FirmwareSet.java new file mode 100644 index 000000000..473c306dc --- /dev/null +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FirmwareSet.java @@ -0,0 +1,463 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.model; + +import java.util.Objects; +import java.util.Arrays; +import com.equinix.openapi.metal.v1.model.Attribute; +import com.equinix.openapi.metal.v1.model.Component; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.equinix.openapi.JSON; + +/** + * Represents a Firmware Set + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FirmwareSet { + public static final String SERIALIZED_NAME_UUID = "uuid"; + @SerializedName(SERIALIZED_NAME_UUID) + private UUID uuid; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + private List attributes; + + public static final String SERIALIZED_NAME_COMPONENT_FIRMWARE = "component_firmware"; + @SerializedName(SERIALIZED_NAME_COMPONENT_FIRMWARE) + private List componentFirmware; + + public FirmwareSet() { + } + + + public FirmwareSet( + UUID uuid, + String name, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this(); + this.uuid = uuid; + this.name = name; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + /** + * Firmware Set UUID + * @return uuid + **/ + @javax.annotation.Nonnull + public UUID getUuid() { + return uuid; + } + + + + + /** + * Firmware Set Name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + + + /** + * Datetime when the block was created. + * @return createdAt + **/ + @javax.annotation.Nullable + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + + + /** + * Datetime when the block was updated. + * @return updatedAt + **/ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + + + + public FirmwareSet attributes(List attributes) { + + this.attributes = attributes; + return this; + } + + public FirmwareSet addAttributesItem(Attribute attributesItem) { + if (this.attributes == null) { + this.attributes = new ArrayList<>(); + } + this.attributes.add(attributesItem); + return this; + } + + /** + * Represents a list of attributes + * @return attributes + **/ + @javax.annotation.Nullable + public List getAttributes() { + return attributes; + } + + + public void setAttributes(List attributes) { + this.attributes = attributes; + } + + + public FirmwareSet componentFirmware(List componentFirmware) { + + this.componentFirmware = componentFirmware; + return this; + } + + public FirmwareSet addComponentFirmwareItem(Component componentFirmwareItem) { + if (this.componentFirmware == null) { + this.componentFirmware = new ArrayList<>(); + } + this.componentFirmware.add(componentFirmwareItem); + return this; + } + + /** + * List of components versions + * @return componentFirmware + **/ + @javax.annotation.Nullable + public List getComponentFirmware() { + return componentFirmware; + } + + + public void setComponentFirmware(List componentFirmware) { + this.componentFirmware = componentFirmware; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FirmwareSet instance itself + */ + public FirmwareSet putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FirmwareSet firmwareSet = (FirmwareSet) o; + return Objects.equals(this.uuid, firmwareSet.uuid) && + Objects.equals(this.name, firmwareSet.name) && + Objects.equals(this.createdAt, firmwareSet.createdAt) && + Objects.equals(this.updatedAt, firmwareSet.updatedAt) && + Objects.equals(this.attributes, firmwareSet.attributes) && + Objects.equals(this.componentFirmware, firmwareSet.componentFirmware)&& + Objects.equals(this.additionalProperties, firmwareSet.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, name, createdAt, updatedAt, attributes, componentFirmware, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FirmwareSet {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" componentFirmware: ").append(toIndentedString(componentFirmware)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("uuid"); + openapiFields.add("name"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + openapiFields.add("attributes"); + openapiFields.add("component_firmware"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("uuid"); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FirmwareSet + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!FirmwareSet.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FirmwareSet is not found in the empty JSON string", FirmwareSet.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FirmwareSet.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uuid").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (jsonObj.get("attributes") != null && !jsonObj.get("attributes").isJsonNull()) { + JsonArray jsonArrayattributes = jsonObj.getAsJsonArray("attributes"); + if (jsonArrayattributes != null) { + // ensure the json data is an array + if (!jsonObj.get("attributes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `attributes` to be an array in the JSON string but got `%s`", jsonObj.get("attributes").toString())); + } + + // validate the optional field `attributes` (array) + for (int i = 0; i < jsonArrayattributes.size(); i++) { + Attribute.validateJsonObject(jsonArrayattributes.get(i).getAsJsonObject()); + }; + } + } + if (jsonObj.get("component_firmware") != null && !jsonObj.get("component_firmware").isJsonNull()) { + JsonArray jsonArraycomponentFirmware = jsonObj.getAsJsonArray("component_firmware"); + if (jsonArraycomponentFirmware != null) { + // ensure the json data is an array + if (!jsonObj.get("component_firmware").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `component_firmware` to be an array in the JSON string but got `%s`", jsonObj.get("component_firmware").toString())); + } + + // validate the optional field `component_firmware` (array) + for (int i = 0; i < jsonArraycomponentFirmware.size(); i++) { + Component.validateJsonObject(jsonArraycomponentFirmware.get(i).getAsJsonObject()); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FirmwareSet.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FirmwareSet' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FirmwareSet.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FirmwareSet value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FirmwareSet read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + FirmwareSet instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FirmwareSet given an JSON string + * + * @param jsonString JSON string + * @return An instance of FirmwareSet + * @throws IOException if the JSON string is invalid with respect to FirmwareSet + */ + public static FirmwareSet fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FirmwareSet.class); + } + + /** + * Convert an instance of FirmwareSet to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FirmwareSetListResponse.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FirmwareSetListResponse.java new file mode 100644 index 000000000..ab5f87db8 --- /dev/null +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FirmwareSetListResponse.java @@ -0,0 +1,445 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.model; + +import java.util.Objects; +import java.util.Arrays; +import com.equinix.openapi.metal.v1.model.FirmwareSet; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.equinix.openapi.JSON; + +/** + * Represents collection of Firmware Sets + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FirmwareSetListResponse { + public static final String SERIALIZED_NAME_PAGE_SIZE = "page_size"; + @SerializedName(SERIALIZED_NAME_PAGE_SIZE) + private Integer pageSize; + + public static final String SERIALIZED_NAME_PAGE = "page"; + @SerializedName(SERIALIZED_NAME_PAGE) + private Integer page; + + public static final String SERIALIZED_NAME_PAGE_COUNT = "page_count"; + @SerializedName(SERIALIZED_NAME_PAGE_COUNT) + private Integer pageCount; + + public static final String SERIALIZED_NAME_TOTAL_PAGES = "total_pages"; + @SerializedName(SERIALIZED_NAME_TOTAL_PAGES) + private Integer totalPages; + + public static final String SERIALIZED_NAME_TOTAL_RECORD_COUNT = "total_record_count"; + @SerializedName(SERIALIZED_NAME_TOTAL_RECORD_COUNT) + private Integer totalRecordCount; + + public static final String SERIALIZED_NAME_RECORDS = "records"; + @SerializedName(SERIALIZED_NAME_RECORDS) + private List records; + + public FirmwareSetListResponse() { + } + + public FirmwareSetListResponse pageSize(Integer pageSize) { + + this.pageSize = pageSize; + return this; + } + + /** + * Max number of items returned in a page + * @return pageSize + **/ + @javax.annotation.Nullable + public Integer getPageSize() { + return pageSize; + } + + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + + public FirmwareSetListResponse page(Integer page) { + + this.page = page; + return this; + } + + /** + * Page returned + * @return page + **/ + @javax.annotation.Nullable + public Integer getPage() { + return page; + } + + + public void setPage(Integer page) { + this.page = page; + } + + + public FirmwareSetListResponse pageCount(Integer pageCount) { + + this.pageCount = pageCount; + return this; + } + + /** + * Items returned in current page + * @return pageCount + **/ + @javax.annotation.Nullable + public Integer getPageCount() { + return pageCount; + } + + + public void setPageCount(Integer pageCount) { + this.pageCount = pageCount; + } + + + public FirmwareSetListResponse totalPages(Integer totalPages) { + + this.totalPages = totalPages; + return this; + } + + /** + * Total count of pages + * @return totalPages + **/ + @javax.annotation.Nullable + public Integer getTotalPages() { + return totalPages; + } + + + public void setTotalPages(Integer totalPages) { + this.totalPages = totalPages; + } + + + public FirmwareSetListResponse totalRecordCount(Integer totalRecordCount) { + + this.totalRecordCount = totalRecordCount; + return this; + } + + /** + * Total count of items + * @return totalRecordCount + **/ + @javax.annotation.Nullable + public Integer getTotalRecordCount() { + return totalRecordCount; + } + + + public void setTotalRecordCount(Integer totalRecordCount) { + this.totalRecordCount = totalRecordCount; + } + + + public FirmwareSetListResponse records(List records) { + + this.records = records; + return this; + } + + public FirmwareSetListResponse addRecordsItem(FirmwareSet recordsItem) { + if (this.records == null) { + this.records = new ArrayList<>(); + } + this.records.add(recordsItem); + return this; + } + + /** + * Represents a list of FirmwareSets + * @return records + **/ + @javax.annotation.Nullable + public List getRecords() { + return records; + } + + + public void setRecords(List records) { + this.records = records; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FirmwareSetListResponse instance itself + */ + public FirmwareSetListResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FirmwareSetListResponse firmwareSetListResponse = (FirmwareSetListResponse) o; + return Objects.equals(this.pageSize, firmwareSetListResponse.pageSize) && + Objects.equals(this.page, firmwareSetListResponse.page) && + Objects.equals(this.pageCount, firmwareSetListResponse.pageCount) && + Objects.equals(this.totalPages, firmwareSetListResponse.totalPages) && + Objects.equals(this.totalRecordCount, firmwareSetListResponse.totalRecordCount) && + Objects.equals(this.records, firmwareSetListResponse.records)&& + Objects.equals(this.additionalProperties, firmwareSetListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pageSize, page, pageCount, totalPages, totalRecordCount, records, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FirmwareSetListResponse {\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageCount: ").append(toIndentedString(pageCount)).append("\n"); + sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n"); + sb.append(" totalRecordCount: ").append(toIndentedString(totalRecordCount)).append("\n"); + sb.append(" records: ").append(toIndentedString(records)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("page_size"); + openapiFields.add("page"); + openapiFields.add("page_count"); + openapiFields.add("total_pages"); + openapiFields.add("total_record_count"); + openapiFields.add("records"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FirmwareSetListResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!FirmwareSetListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FirmwareSetListResponse is not found in the empty JSON string", FirmwareSetListResponse.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("records") != null && !jsonObj.get("records").isJsonNull()) { + JsonArray jsonArrayrecords = jsonObj.getAsJsonArray("records"); + if (jsonArrayrecords != null) { + // ensure the json data is an array + if (!jsonObj.get("records").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `records` to be an array in the JSON string but got `%s`", jsonObj.get("records").toString())); + } + + // validate the optional field `records` (array) + for (int i = 0; i < jsonArrayrecords.size(); i++) { + FirmwareSet.validateJsonObject(jsonArrayrecords.get(i).getAsJsonObject()); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FirmwareSetListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FirmwareSetListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FirmwareSetListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FirmwareSetListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FirmwareSetListResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + FirmwareSetListResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FirmwareSetListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of FirmwareSetListResponse + * @throws IOException if the JSON string is invalid with respect to FirmwareSetListResponse + */ + public static FirmwareSetListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FirmwareSetListResponse.class); + } + + /** + * Convert an instance of FirmwareSetListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FirmwareSetResponse.java b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FirmwareSetResponse.java new file mode 100644 index 000000000..13d12bb70 --- /dev/null +++ b/equinix-openapi-metal/src/main/java/com/equinix/openapi/metal/v1/model/FirmwareSetResponse.java @@ -0,0 +1,285 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.model; + +import java.util.Objects; +import java.util.Arrays; +import com.equinix.openapi.metal.v1.model.FirmwareSet; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.equinix.openapi.JSON; + +/** + * Represents single Firmware set response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FirmwareSetResponse { + public static final String SERIALIZED_NAME_RECORD = "record"; + @SerializedName(SERIALIZED_NAME_RECORD) + private FirmwareSet record; + + public FirmwareSetResponse() { + } + + public FirmwareSetResponse record(FirmwareSet record) { + + this.record = record; + return this; + } + + /** + * Get record + * @return record + **/ + @javax.annotation.Nullable + public FirmwareSet getRecord() { + return record; + } + + + public void setRecord(FirmwareSet record) { + this.record = record; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FirmwareSetResponse instance itself + */ + public FirmwareSetResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FirmwareSetResponse firmwareSetResponse = (FirmwareSetResponse) o; + return Objects.equals(this.record, firmwareSetResponse.record)&& + Objects.equals(this.additionalProperties, firmwareSetResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(record, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FirmwareSetResponse {\n"); + sb.append(" record: ").append(toIndentedString(record)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("record"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FirmwareSetResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!FirmwareSetResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FirmwareSetResponse is not found in the empty JSON string", FirmwareSetResponse.openapiRequiredFields.toString())); + } + } + // validate the optional field `record` + if (jsonObj.get("record") != null && !jsonObj.get("record").isJsonNull()) { + FirmwareSet.validateJsonObject(jsonObj.getAsJsonObject("record")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FirmwareSetResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FirmwareSetResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FirmwareSetResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FirmwareSetResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FirmwareSetResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + FirmwareSetResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FirmwareSetResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of FirmwareSetResponse + * @throws IOException if the JSON string is invalid with respect to FirmwareSetResponse + */ + public static FirmwareSetResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FirmwareSetResponse.class); + } + + /** + * Convert an instance of FirmwareSetResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/DevicesApiTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/DevicesApiTest.java index 617fc9da1..44db540f4 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/DevicesApiTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/DevicesApiTest.java @@ -21,10 +21,12 @@ import com.equinix.openapi.metal.v1.model.CreateDeviceRequest; import com.equinix.openapi.metal.v1.model.Device; import com.equinix.openapi.metal.v1.model.DeviceActionInput; +import com.equinix.openapi.metal.v1.model.DeviceHealthRollup; import com.equinix.openapi.metal.v1.model.DeviceList; import com.equinix.openapi.metal.v1.model.DeviceUpdateInput; import com.equinix.openapi.metal.v1.model.Error; import com.equinix.openapi.metal.v1.model.FindTrafficTimeframeParameter; +import com.equinix.openapi.metal.v1.model.FirmwareSetResponse; import com.equinix.openapi.metal.v1.model.IPAssignment; import com.equinix.openapi.metal.v1.model.IPAssignmentInput; import com.equinix.openapi.metal.v1.model.IPAssignmentList; @@ -317,6 +319,34 @@ public void getBgpNeighborDataTest() throws ApiException { // TODO: test validations } + /** + * Get Device's associated Firmware Set + * + * Returns the firmware set associated with the device. If a custom firmware set is associated with the device, then it is returned. Otherwise, if a default firmware set is available it is returned. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getDeviceFirmwareSetsTest() throws ApiException { + UUID id = null; + FirmwareSetResponse response = api.getDeviceFirmwareSets(id); + // TODO: test validations + } + + /** + * Get Device's Health Status + * + * Returns the health rollup status of the device. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getDeviceHealthRollupTest() throws ApiException { + UUID id = null; + DeviceHealthRollup response = api.getDeviceHealthRollup(id); + // TODO: test validations + } + /** * Perform an action * diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/FirmwareSetsApiTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/FirmwareSetsApiTest.java new file mode 100644 index 000000000..ace67f9cb --- /dev/null +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/FirmwareSetsApiTest.java @@ -0,0 +1,68 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.api; + +import com.equinix.openapi.ApiException; +import com.equinix.openapi.metal.v1.model.Error; +import com.equinix.openapi.metal.v1.model.FirmwareSetListResponse; +import java.util.UUID; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for FirmwareSetsApi + */ +@Disabled +public class FirmwareSetsApiTest { + + private final FirmwareSetsApi api = new FirmwareSetsApi(); + + /** + * Get Organization's Firmware Sets + * + * Returns all firmware sets associated with the organization. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOrganizationFirmwareSetsTest() throws ApiException { + UUID id = null; + Integer page = null; + Integer perPage = null; + FirmwareSetListResponse response = api.getOrganizationFirmwareSets(id, page, perPage); + // TODO: test validations + } + + /** + * Get Project's Firmware Sets + * + * Returns all firmware sets associated with the project or organization. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getProjectFirmwareSetsTest() throws ApiException { + UUID id = null; + Integer page = null; + Integer perPage = null; + FirmwareSetListResponse response = api.getProjectFirmwareSets(id, page, perPage); + // TODO: test validations + } + +} diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/AttributeDataTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/AttributeDataTest.java new file mode 100644 index 000000000..be3901e03 --- /dev/null +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/AttributeDataTest.java @@ -0,0 +1,72 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AttributeData + */ +public class AttributeDataTest { + private final AttributeData model = new AttributeData(); + + /** + * Model tests for AttributeData + */ + @Test + public void testAttributeData() { + // TODO: test AttributeData + } + + /** + * Test the property 'latest' + */ + @Test + public void latestTest() { + // TODO: test latest + } + + /** + * Test the property 'model' + */ + @Test + public void modelTest() { + // TODO: test model + } + + /** + * Test the property 'vendor' + */ + @Test + public void vendorTest() { + // TODO: test vendor + } + + /** + * Test the property 'plan' + */ + @Test + public void planTest() { + // TODO: test plan + } + +} diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/AttributeTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/AttributeTest.java new file mode 100644 index 000000000..0c86db662 --- /dev/null +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/AttributeTest.java @@ -0,0 +1,74 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.model; + +import com.equinix.openapi.metal.v1.model.AttributeData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Attribute + */ +public class AttributeTest { + private final Attribute model = new Attribute(); + + /** + * Model tests for Attribute + */ + @Test + public void testAttribute() { + // TODO: test Attribute + } + + /** + * Test the property 'namespace' + */ + @Test + public void namespaceTest() { + // TODO: test namespace + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/ComponentTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/ComponentTest.java new file mode 100644 index 000000000..006a29257 --- /dev/null +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/ComponentTest.java @@ -0,0 +1,132 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Component + */ +public class ComponentTest { + private final Component model = new Component(); + + /** + * Model tests for Component + */ + @Test + public void testComponent() { + // TODO: test Component + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'vendor' + */ + @Test + public void vendorTest() { + // TODO: test vendor + } + + /** + * Test the property 'model' + */ + @Test + public void modelTest() { + // TODO: test model + } + + /** + * Test the property 'filename' + */ + @Test + public void filenameTest() { + // TODO: test filename + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'component' + */ + @Test + public void componentTest() { + // TODO: test component + } + + /** + * Test the property 'checksum' + */ + @Test + public void checksumTest() { + // TODO: test checksum + } + + /** + * Test the property 'upstreamUrl' + */ + @Test + public void upstreamUrlTest() { + // TODO: test upstreamUrl + } + + /** + * Test the property 'repositoryUrl' + */ + @Test + public void repositoryUrlTest() { + // TODO: test repositoryUrl + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + +} diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DeviceHealthRollupTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DeviceHealthRollupTest.java new file mode 100644 index 000000000..b608ab25a --- /dev/null +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DeviceHealthRollupTest.java @@ -0,0 +1,57 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeviceHealthRollup + */ +public class DeviceHealthRollupTest { + private final DeviceHealthRollup model = new DeviceHealthRollup(); + + /** + * Model tests for DeviceHealthRollup + */ + @Test + public void testDeviceHealthRollup() { + // TODO: test DeviceHealthRollup + } + + /** + * Test the property 'healthRollup' + */ + @Test + public void healthRollupTest() { + // TODO: test healthRollup + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + +} diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DeviceUpdateInputTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DeviceUpdateInputTest.java index c5090eb34..7832f7948 100644 --- a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DeviceUpdateInputTest.java +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/DeviceUpdateInputTest.java @@ -81,6 +81,14 @@ public void hostnameTest() { // TODO: test hostname } + /** + * Test the property 'firmwareSetId' + */ + @Test + public void firmwareSetIdTest() { + // TODO: test firmwareSetId + } + /** * Test the property 'ipxeScriptUrl' */ diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FirmwareSetListResponseTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FirmwareSetListResponseTest.java new file mode 100644 index 000000000..6df91dc69 --- /dev/null +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FirmwareSetListResponseTest.java @@ -0,0 +1,91 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.model; + +import com.equinix.openapi.metal.v1.model.FirmwareSet; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FirmwareSetListResponse + */ +public class FirmwareSetListResponseTest { + private final FirmwareSetListResponse model = new FirmwareSetListResponse(); + + /** + * Model tests for FirmwareSetListResponse + */ + @Test + public void testFirmwareSetListResponse() { + // TODO: test FirmwareSetListResponse + } + + /** + * Test the property 'pageSize' + */ + @Test + public void pageSizeTest() { + // TODO: test pageSize + } + + /** + * Test the property 'page' + */ + @Test + public void pageTest() { + // TODO: test page + } + + /** + * Test the property 'pageCount' + */ + @Test + public void pageCountTest() { + // TODO: test pageCount + } + + /** + * Test the property 'totalPages' + */ + @Test + public void totalPagesTest() { + // TODO: test totalPages + } + + /** + * Test the property 'totalRecordCount' + */ + @Test + public void totalRecordCountTest() { + // TODO: test totalRecordCount + } + + /** + * Test the property 'records' + */ + @Test + public void recordsTest() { + // TODO: test records + } + +} diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FirmwareSetResponseTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FirmwareSetResponseTest.java new file mode 100644 index 000000000..b0e629386 --- /dev/null +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FirmwareSetResponseTest.java @@ -0,0 +1,49 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.model; + +import com.equinix.openapi.metal.v1.model.FirmwareSet; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FirmwareSetResponse + */ +public class FirmwareSetResponseTest { + private final FirmwareSetResponse model = new FirmwareSetResponse(); + + /** + * Model tests for FirmwareSetResponse + */ + @Test + public void testFirmwareSetResponse() { + // TODO: test FirmwareSetResponse + } + + /** + * Test the property 'record' + */ + @Test + public void recordTest() { + // TODO: test record + } + +} diff --git a/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FirmwareSetTest.java b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FirmwareSetTest.java new file mode 100644 index 000000000..3b42f7c74 --- /dev/null +++ b/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/model/FirmwareSetTest.java @@ -0,0 +1,94 @@ +/* + * Metal API + * # Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@equinixmetal.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.equinix.openapi.metal.v1.model; + +import com.equinix.openapi.metal.v1.model.Attribute; +import com.equinix.openapi.metal.v1.model.Component; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FirmwareSet + */ +public class FirmwareSetTest { + private final FirmwareSet model = new FirmwareSet(); + + /** + * Model tests for FirmwareSet + */ + @Test + public void testFirmwareSet() { + // TODO: test FirmwareSet + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + + /** + * Test the property 'componentFirmware' + */ + @Test + public void componentFirmwareTest() { + // TODO: test componentFirmware + } + +} diff --git a/spec/oas3.config.json b/spec/oas3.config.json index aa6716086..df4036522 100644 --- a/spec/oas3.config.json +++ b/spec/oas3.config.json @@ -1,8 +1,8 @@ { "groupId": "com.equinix", "artifactId": "equinix-openapi-metal", - "artifactVersion": "0.5.0", - "httpUserAgent": "metal-java/0.5.0", + "artifactVersion": "0.6.0", + "httpUserAgent": "metal-java/0.6.0", "library": "okhttp-gson", "invokerPackage": "com.equinix.openapi", "modelPackage": "com.equinix.openapi.metal.v1.model", diff --git a/spec/oas3.fetched/openapi/public/components/schemas/Attribute.yaml b/spec/oas3.fetched/openapi/public/components/schemas/Attribute.yaml new file mode 100644 index 000000000..fdd3bcde7 --- /dev/null +++ b/spec/oas3.fetched/openapi/public/components/schemas/Attribute.yaml @@ -0,0 +1,17 @@ +properties: + namespace: + readOnly: true + type: string + description: Attribute namespace + created_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was created. + updated_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was updated. + data: + $ref: "./AttributeData.yaml" diff --git a/spec/oas3.fetched/openapi/public/components/schemas/AttributeData.yaml b/spec/oas3.fetched/openapi/public/components/schemas/AttributeData.yaml new file mode 100644 index 000000000..bba3c9087 --- /dev/null +++ b/spec/oas3.fetched/openapi/public/components/schemas/AttributeData.yaml @@ -0,0 +1,17 @@ +properties: + latest: + readOnly: true + type: boolean + description: Boolean flag to know if the firmware set is the latest for the model and vendor + model: + readOnly: true + type: string + description: Model on which this firmware set can be applied + vendor: + readOnly: true + type: string + description: Vendor on which this firmware set can be applied + plan: + readOnly: true + type: string + description: Plan where the firmware set can be applied diff --git a/spec/oas3.fetched/openapi/public/components/schemas/Component.yaml b/spec/oas3.fetched/openapi/public/components/schemas/Component.yaml new file mode 100644 index 000000000..efce1ccc5 --- /dev/null +++ b/spec/oas3.fetched/openapi/public/components/schemas/Component.yaml @@ -0,0 +1,55 @@ +properties: + uuid: + readOnly: true + type: string + description: Component UUID + format: uuid + example: "0516463a-47ee-4809-9a66-ece8c740eed9" + vendor: + readOnly: true + type: string + description: Component vendor + example: "equinix" + model: + readOnly: true + type: array + description: List of models where this component version can be applied + items: + type: string + example: romed8hm3 + filename: + readOnly: true + type: string + description: name of the file + version: + readOnly: true + type: string + description: Version of the component + example: 1.5.0 + component: + readOnly: true + type: string + description: Component type + example: bmc + checksum: + readOnly: true + type: string + description: File checksum + upstream_url: + readOnly: true + type: string + description: Location of the file + repository_url: + readOnly: true + type: string + description: Location of the file in the repository + created_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was created. + updated_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was updated. diff --git a/spec/oas3.fetched/openapi/public/components/schemas/DeviceHealthRollup.yaml b/spec/oas3.fetched/openapi/public/components/schemas/DeviceHealthRollup.yaml new file mode 100644 index 000000000..7396b72d3 --- /dev/null +++ b/spec/oas3.fetched/openapi/public/components/schemas/DeviceHealthRollup.yaml @@ -0,0 +1,16 @@ +properties: + health_rollup: + readOnly: true + type: string + description: Health Status + enum: + - ok + - warning + - critical + updated_at: + readOnly: true + type: string + format: date-time + description: Last update of health status. +type: object +description: Represents a Device Health Status diff --git a/spec/oas3.fetched/openapi/public/components/schemas/DeviceUpdateInput.yaml b/spec/oas3.fetched/openapi/public/components/schemas/DeviceUpdateInput.yaml index 98bad51c5..933136daa 100644 --- a/spec/oas3.fetched/openapi/public/components/schemas/DeviceUpdateInput.yaml +++ b/spec/oas3.fetched/openapi/public/components/schemas/DeviceUpdateInput.yaml @@ -11,6 +11,8 @@ properties: type: string hostname: type: string + firmware_set_id: + type: string ipxe_script_url: type: string locked: diff --git a/spec/oas3.fetched/openapi/public/components/schemas/FirmwareSet.yaml b/spec/oas3.fetched/openapi/public/components/schemas/FirmwareSet.yaml new file mode 100644 index 000000000..2d8bf7cb6 --- /dev/null +++ b/spec/oas3.fetched/openapi/public/components/schemas/FirmwareSet.yaml @@ -0,0 +1,36 @@ +properties: + uuid: + readOnly: true + type: string + description: Firmware Set UUID + format: uuid + example: "0516463a-47ee-4809-9a66-ece8c740eed9" + name: + readOnly: true + type: string + description: Firmware Set Name + created_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was created. + updated_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was updated. + attributes: + type: array + description: Represents a list of attributes + items: + $ref: "./Attribute.yaml" + component_firmware: + type: array + description: List of components versions + items: + $ref: "./Component.yaml" +required: + - uuid + - name +type: object +description: Represents a Firmware Set diff --git a/spec/oas3.fetched/openapi/public/components/schemas/FirmwareSetList.yaml b/spec/oas3.fetched/openapi/public/components/schemas/FirmwareSetList.yaml new file mode 100644 index 000000000..7e9fe5ee7 --- /dev/null +++ b/spec/oas3.fetched/openapi/public/components/schemas/FirmwareSetList.yaml @@ -0,0 +1,4 @@ +type: array +description: Represents a list of FirmwareSets +items: + $ref: "./FirmwareSet.yaml" diff --git a/spec/oas3.fetched/openapi/public/components/schemas/FirmwareSetListResponse.yaml b/spec/oas3.fetched/openapi/public/components/schemas/FirmwareSetListResponse.yaml new file mode 100644 index 000000000..47d81795f --- /dev/null +++ b/spec/oas3.fetched/openapi/public/components/schemas/FirmwareSetListResponse.yaml @@ -0,0 +1,20 @@ +type: object +description: Represents collection of Firmware Sets +properties: + page_size: + description: Max number of items returned in a page + type: integer + page: + description: Page returned + type: integer + page_count: + description: Items returned in current page + type: integer + total_pages: + description: Total count of pages + type: integer + total_record_count: + description: Total count of items + type: integer + records: + $ref: "./FirmwareSetList.yaml" diff --git a/spec/oas3.fetched/openapi/public/components/schemas/FirmwareSetResponse.yaml b/spec/oas3.fetched/openapi/public/components/schemas/FirmwareSetResponse.yaml new file mode 100644 index 000000000..adb43e438 --- /dev/null +++ b/spec/oas3.fetched/openapi/public/components/schemas/FirmwareSetResponse.yaml @@ -0,0 +1,5 @@ +type: object +description: Represents single Firmware set response +properties: + record: + $ref: "./FirmwareSet.yaml" diff --git a/spec/oas3.fetched/openapi/public/openapi3.yaml b/spec/oas3.fetched/openapi/public/openapi3.yaml index 783898fd8..a7db41495 100644 --- a/spec/oas3.fetched/openapi/public/openapi3.yaml +++ b/spec/oas3.fetched/openapi/public/openapi3.yaml @@ -121,6 +121,10 @@ components: schemas: Address: $ref: './components/schemas/Address.yaml' + Attribute: + $ref: './components/schemas/Attribute.yaml' + AttributeData: + $ref: './components/schemas/AttributeData.yaml' AuthToken: $ref: './components/schemas/AuthToken.yaml' AuthTokenInput: @@ -167,6 +171,8 @@ components: $ref: './components/schemas/CapacityList.yaml' CapacityReport: $ref: './components/schemas/CapacityReport.yaml' + Component: + $ref: './components/schemas/Component.yaml' Coordinates: $ref: './components/schemas/Coordinates.yaml' CreateEmailInput: @@ -179,6 +185,8 @@ components: $ref: './components/schemas/Device.yaml' DeviceCreateInput: $ref: './components/schemas/DeviceCreateInput.yaml' + DeviceHealthRollup: + $ref: './components/schemas/DeviceHealthRollup.yaml' DeviceCreateInFacilityInput: $ref: './components/schemas/DeviceCreateInFacilityInput.yaml' DeviceCreateInMetroInput: @@ -211,6 +219,14 @@ components: $ref: './components/schemas/FacilityInput.yaml' FacilityList: $ref: './components/schemas/FacilityList.yaml' + FirmwareSet: + $ref: './components/schemas/FirmwareSet.yaml' + FirmwareSetList: + $ref: './components/schemas/FirmwareSetList.yaml' + FirmwareSetListResponse: + $ref: './components/schemas/FirmwareSetListResponse.yaml' + FirmwareSetResponse: + $ref: './components/schemas/FirmwareSetResponse.yaml' GlobalBgpRange: $ref: './components/schemas/GlobalBgpRange.yaml' GlobalBgpRangeList: @@ -536,8 +552,12 @@ paths: $ref: ./paths/devices/id/bgp/sessions.yaml /devices/{id}/customdata: $ref: ./paths/devices/id/customdata.yaml + /devices/{id}/diagnostics/health/rollup: + $ref: ./paths/devices/id/diagnostics/health/rollup.yaml /devices/{id}/events: $ref: ./paths/devices/id/events.yaml + /devices/{id}/firmware-sets: + $ref: ./paths/devices/id/firmware-sets.yaml /devices/{id}/ips: $ref: ./paths/devices/id/ips.yaml /devices/{id}/metadata: @@ -622,6 +642,8 @@ paths: $ref: ./paths/organizations/id/events.yaml /organizations/{id}/facilities: $ref: ./paths/organizations/id/facilities.yaml + /organizations/{id}/firmware-sets: + $ref: ./paths/organizations/id/firmware-sets.yaml /organizations/{id}/invitations: $ref: ./paths/organizations/id/invitations.yaml /organizations/{id}/invoices: @@ -690,6 +712,8 @@ paths: $ref: ./paths/projects/id/events.yaml /projects/{id}/facilities: $ref: ./paths/projects/id/facilities.yaml + /projects/{id}/firmware-sets: + $ref: ./paths/projects/id/firmware-sets.yaml /projects/{id}/global-bgp-ranges: $ref: ./paths/projects/id/global-bgp-ranges.yaml /projects/{id}/hardware-reservations: @@ -875,6 +899,9 @@ tags: Facility Management. Check out the product docs to learn more about [Facilities](https://metal.equinix.com/developers/docs/locations/). name: Facilities + - description: > + Firmware Sets Management. Notice: Firmware Sets are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + name: Firmware Sets - description: > Global BGP Range Management name: GlobalBgpRanges diff --git a/spec/oas3.fetched/openapi/public/paths/devices/id/diagnostics/health/rollup.yaml b/spec/oas3.fetched/openapi/public/paths/devices/id/diagnostics/health/rollup.yaml new file mode 100644 index 000000000..4d66456f2 --- /dev/null +++ b/spec/oas3.fetched/openapi/public/paths/devices/id/diagnostics/health/rollup.yaml @@ -0,0 +1,31 @@ +get: + tags: + - Devices + summary: Get Device's Health Status + description: Returns the health rollup status of the device. + operationId: getDeviceHealthRollup + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../../../components/schemas/DeviceHealthRollup.yaml' + "401": + $ref: '../../../../../components/schemas/Error.yaml' + "404": + $ref: '../../../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' diff --git a/spec/oas3.fetched/openapi/public/paths/devices/id/firmware-sets.yaml b/spec/oas3.fetched/openapi/public/paths/devices/id/firmware-sets.yaml new file mode 100644 index 000000000..b3eca50a9 --- /dev/null +++ b/spec/oas3.fetched/openapi/public/paths/devices/id/firmware-sets.yaml @@ -0,0 +1,31 @@ +get: + tags: + - Devices + summary: Get Device's associated Firmware Set + description: Returns the firmware set associated with the device. If a custom firmware set is associated with the device, then it is returned. Otherwise, if a default firmware set is available it is returned. + operationId: getDeviceFirmwareSets + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../components/schemas/FirmwareSetResponse.yaml' + "401": + $ref: '../../../components/schemas/Error.yaml' + "404": + $ref: '../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' diff --git a/spec/oas3.fetched/openapi/public/paths/organizations/id/firmware-sets.yaml b/spec/oas3.fetched/openapi/public/paths/organizations/id/firmware-sets.yaml new file mode 100644 index 000000000..35f49edf6 --- /dev/null +++ b/spec/oas3.fetched/openapi/public/paths/organizations/id/firmware-sets.yaml @@ -0,0 +1,41 @@ +get: + tags: + - Firmware Sets + summary: Get Organization's Firmware Sets + description: Returns all firmware sets associated with the organization. + operationId: getOrganizationFirmwareSets + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - name: page + in: query + description: page number to return + schema: + type: integer + - name: per_page + in: query + description: items returned per page. + schema: + type: integer + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../components/schemas/FirmwareSetListResponse.yaml' + "401": + $ref: '../../../components/schemas/Error.yaml' + "404": + $ref: '../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' diff --git a/spec/oas3.fetched/openapi/public/paths/projects/id/firmware-sets.yaml b/spec/oas3.fetched/openapi/public/paths/projects/id/firmware-sets.yaml new file mode 100644 index 000000000..694e4798d --- /dev/null +++ b/spec/oas3.fetched/openapi/public/paths/projects/id/firmware-sets.yaml @@ -0,0 +1,41 @@ +get: + tags: + - Firmware Sets + summary: Get Project's Firmware Sets + description: Returns all firmware sets associated with the project or organization. + operationId: getProjectFirmwareSets + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - name: page + in: query + description: page number to return + schema: + type: integer + - name: per_page + in: query + description: items returned per page. + schema: + type: integer + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../components/schemas/FirmwareSetListResponse.yaml' + "401": + $ref: '../../../components/schemas/Error.yaml' + "404": + $ref: '../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' diff --git a/spec/oas3.patched/openapi/public/components/schemas/Attribute.yaml b/spec/oas3.patched/openapi/public/components/schemas/Attribute.yaml new file mode 100644 index 000000000..fdd3bcde7 --- /dev/null +++ b/spec/oas3.patched/openapi/public/components/schemas/Attribute.yaml @@ -0,0 +1,17 @@ +properties: + namespace: + readOnly: true + type: string + description: Attribute namespace + created_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was created. + updated_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was updated. + data: + $ref: "./AttributeData.yaml" diff --git a/spec/oas3.patched/openapi/public/components/schemas/AttributeData.yaml b/spec/oas3.patched/openapi/public/components/schemas/AttributeData.yaml new file mode 100644 index 000000000..bba3c9087 --- /dev/null +++ b/spec/oas3.patched/openapi/public/components/schemas/AttributeData.yaml @@ -0,0 +1,17 @@ +properties: + latest: + readOnly: true + type: boolean + description: Boolean flag to know if the firmware set is the latest for the model and vendor + model: + readOnly: true + type: string + description: Model on which this firmware set can be applied + vendor: + readOnly: true + type: string + description: Vendor on which this firmware set can be applied + plan: + readOnly: true + type: string + description: Plan where the firmware set can be applied diff --git a/spec/oas3.patched/openapi/public/components/schemas/Component.yaml b/spec/oas3.patched/openapi/public/components/schemas/Component.yaml new file mode 100644 index 000000000..efce1ccc5 --- /dev/null +++ b/spec/oas3.patched/openapi/public/components/schemas/Component.yaml @@ -0,0 +1,55 @@ +properties: + uuid: + readOnly: true + type: string + description: Component UUID + format: uuid + example: "0516463a-47ee-4809-9a66-ece8c740eed9" + vendor: + readOnly: true + type: string + description: Component vendor + example: "equinix" + model: + readOnly: true + type: array + description: List of models where this component version can be applied + items: + type: string + example: romed8hm3 + filename: + readOnly: true + type: string + description: name of the file + version: + readOnly: true + type: string + description: Version of the component + example: 1.5.0 + component: + readOnly: true + type: string + description: Component type + example: bmc + checksum: + readOnly: true + type: string + description: File checksum + upstream_url: + readOnly: true + type: string + description: Location of the file + repository_url: + readOnly: true + type: string + description: Location of the file in the repository + created_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was created. + updated_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was updated. diff --git a/spec/oas3.patched/openapi/public/components/schemas/DeviceHealthRollup.yaml b/spec/oas3.patched/openapi/public/components/schemas/DeviceHealthRollup.yaml new file mode 100644 index 000000000..7396b72d3 --- /dev/null +++ b/spec/oas3.patched/openapi/public/components/schemas/DeviceHealthRollup.yaml @@ -0,0 +1,16 @@ +properties: + health_rollup: + readOnly: true + type: string + description: Health Status + enum: + - ok + - warning + - critical + updated_at: + readOnly: true + type: string + format: date-time + description: Last update of health status. +type: object +description: Represents a Device Health Status diff --git a/spec/oas3.patched/openapi/public/components/schemas/DeviceUpdateInput.yaml b/spec/oas3.patched/openapi/public/components/schemas/DeviceUpdateInput.yaml index 98bad51c5..933136daa 100644 --- a/spec/oas3.patched/openapi/public/components/schemas/DeviceUpdateInput.yaml +++ b/spec/oas3.patched/openapi/public/components/schemas/DeviceUpdateInput.yaml @@ -11,6 +11,8 @@ properties: type: string hostname: type: string + firmware_set_id: + type: string ipxe_script_url: type: string locked: diff --git a/spec/oas3.patched/openapi/public/components/schemas/FirmwareSet.yaml b/spec/oas3.patched/openapi/public/components/schemas/FirmwareSet.yaml new file mode 100644 index 000000000..2d8bf7cb6 --- /dev/null +++ b/spec/oas3.patched/openapi/public/components/schemas/FirmwareSet.yaml @@ -0,0 +1,36 @@ +properties: + uuid: + readOnly: true + type: string + description: Firmware Set UUID + format: uuid + example: "0516463a-47ee-4809-9a66-ece8c740eed9" + name: + readOnly: true + type: string + description: Firmware Set Name + created_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was created. + updated_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was updated. + attributes: + type: array + description: Represents a list of attributes + items: + $ref: "./Attribute.yaml" + component_firmware: + type: array + description: List of components versions + items: + $ref: "./Component.yaml" +required: + - uuid + - name +type: object +description: Represents a Firmware Set diff --git a/spec/oas3.patched/openapi/public/components/schemas/FirmwareSetList.yaml b/spec/oas3.patched/openapi/public/components/schemas/FirmwareSetList.yaml new file mode 100644 index 000000000..7e9fe5ee7 --- /dev/null +++ b/spec/oas3.patched/openapi/public/components/schemas/FirmwareSetList.yaml @@ -0,0 +1,4 @@ +type: array +description: Represents a list of FirmwareSets +items: + $ref: "./FirmwareSet.yaml" diff --git a/spec/oas3.patched/openapi/public/components/schemas/FirmwareSetListResponse.yaml b/spec/oas3.patched/openapi/public/components/schemas/FirmwareSetListResponse.yaml new file mode 100644 index 000000000..47d81795f --- /dev/null +++ b/spec/oas3.patched/openapi/public/components/schemas/FirmwareSetListResponse.yaml @@ -0,0 +1,20 @@ +type: object +description: Represents collection of Firmware Sets +properties: + page_size: + description: Max number of items returned in a page + type: integer + page: + description: Page returned + type: integer + page_count: + description: Items returned in current page + type: integer + total_pages: + description: Total count of pages + type: integer + total_record_count: + description: Total count of items + type: integer + records: + $ref: "./FirmwareSetList.yaml" diff --git a/spec/oas3.patched/openapi/public/components/schemas/FirmwareSetResponse.yaml b/spec/oas3.patched/openapi/public/components/schemas/FirmwareSetResponse.yaml new file mode 100644 index 000000000..adb43e438 --- /dev/null +++ b/spec/oas3.patched/openapi/public/components/schemas/FirmwareSetResponse.yaml @@ -0,0 +1,5 @@ +type: object +description: Represents single Firmware set response +properties: + record: + $ref: "./FirmwareSet.yaml" diff --git a/spec/oas3.patched/openapi/public/openapi3.yaml b/spec/oas3.patched/openapi/public/openapi3.yaml index 783898fd8..a7db41495 100644 --- a/spec/oas3.patched/openapi/public/openapi3.yaml +++ b/spec/oas3.patched/openapi/public/openapi3.yaml @@ -121,6 +121,10 @@ components: schemas: Address: $ref: './components/schemas/Address.yaml' + Attribute: + $ref: './components/schemas/Attribute.yaml' + AttributeData: + $ref: './components/schemas/AttributeData.yaml' AuthToken: $ref: './components/schemas/AuthToken.yaml' AuthTokenInput: @@ -167,6 +171,8 @@ components: $ref: './components/schemas/CapacityList.yaml' CapacityReport: $ref: './components/schemas/CapacityReport.yaml' + Component: + $ref: './components/schemas/Component.yaml' Coordinates: $ref: './components/schemas/Coordinates.yaml' CreateEmailInput: @@ -179,6 +185,8 @@ components: $ref: './components/schemas/Device.yaml' DeviceCreateInput: $ref: './components/schemas/DeviceCreateInput.yaml' + DeviceHealthRollup: + $ref: './components/schemas/DeviceHealthRollup.yaml' DeviceCreateInFacilityInput: $ref: './components/schemas/DeviceCreateInFacilityInput.yaml' DeviceCreateInMetroInput: @@ -211,6 +219,14 @@ components: $ref: './components/schemas/FacilityInput.yaml' FacilityList: $ref: './components/schemas/FacilityList.yaml' + FirmwareSet: + $ref: './components/schemas/FirmwareSet.yaml' + FirmwareSetList: + $ref: './components/schemas/FirmwareSetList.yaml' + FirmwareSetListResponse: + $ref: './components/schemas/FirmwareSetListResponse.yaml' + FirmwareSetResponse: + $ref: './components/schemas/FirmwareSetResponse.yaml' GlobalBgpRange: $ref: './components/schemas/GlobalBgpRange.yaml' GlobalBgpRangeList: @@ -536,8 +552,12 @@ paths: $ref: ./paths/devices/id/bgp/sessions.yaml /devices/{id}/customdata: $ref: ./paths/devices/id/customdata.yaml + /devices/{id}/diagnostics/health/rollup: + $ref: ./paths/devices/id/diagnostics/health/rollup.yaml /devices/{id}/events: $ref: ./paths/devices/id/events.yaml + /devices/{id}/firmware-sets: + $ref: ./paths/devices/id/firmware-sets.yaml /devices/{id}/ips: $ref: ./paths/devices/id/ips.yaml /devices/{id}/metadata: @@ -622,6 +642,8 @@ paths: $ref: ./paths/organizations/id/events.yaml /organizations/{id}/facilities: $ref: ./paths/organizations/id/facilities.yaml + /organizations/{id}/firmware-sets: + $ref: ./paths/organizations/id/firmware-sets.yaml /organizations/{id}/invitations: $ref: ./paths/organizations/id/invitations.yaml /organizations/{id}/invoices: @@ -690,6 +712,8 @@ paths: $ref: ./paths/projects/id/events.yaml /projects/{id}/facilities: $ref: ./paths/projects/id/facilities.yaml + /projects/{id}/firmware-sets: + $ref: ./paths/projects/id/firmware-sets.yaml /projects/{id}/global-bgp-ranges: $ref: ./paths/projects/id/global-bgp-ranges.yaml /projects/{id}/hardware-reservations: @@ -875,6 +899,9 @@ tags: Facility Management. Check out the product docs to learn more about [Facilities](https://metal.equinix.com/developers/docs/locations/). name: Facilities + - description: > + Firmware Sets Management. Notice: Firmware Sets are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + name: Firmware Sets - description: > Global BGP Range Management name: GlobalBgpRanges diff --git a/spec/oas3.patched/openapi/public/paths/devices/id/diagnostics/health/rollup.yaml b/spec/oas3.patched/openapi/public/paths/devices/id/diagnostics/health/rollup.yaml new file mode 100644 index 000000000..4d66456f2 --- /dev/null +++ b/spec/oas3.patched/openapi/public/paths/devices/id/diagnostics/health/rollup.yaml @@ -0,0 +1,31 @@ +get: + tags: + - Devices + summary: Get Device's Health Status + description: Returns the health rollup status of the device. + operationId: getDeviceHealthRollup + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../../../components/schemas/DeviceHealthRollup.yaml' + "401": + $ref: '../../../../../components/schemas/Error.yaml' + "404": + $ref: '../../../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' diff --git a/spec/oas3.patched/openapi/public/paths/devices/id/firmware-sets.yaml b/spec/oas3.patched/openapi/public/paths/devices/id/firmware-sets.yaml new file mode 100644 index 000000000..b3eca50a9 --- /dev/null +++ b/spec/oas3.patched/openapi/public/paths/devices/id/firmware-sets.yaml @@ -0,0 +1,31 @@ +get: + tags: + - Devices + summary: Get Device's associated Firmware Set + description: Returns the firmware set associated with the device. If a custom firmware set is associated with the device, then it is returned. Otherwise, if a default firmware set is available it is returned. + operationId: getDeviceFirmwareSets + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../components/schemas/FirmwareSetResponse.yaml' + "401": + $ref: '../../../components/schemas/Error.yaml' + "404": + $ref: '../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' diff --git a/spec/oas3.patched/openapi/public/paths/organizations/id/firmware-sets.yaml b/spec/oas3.patched/openapi/public/paths/organizations/id/firmware-sets.yaml new file mode 100644 index 000000000..35f49edf6 --- /dev/null +++ b/spec/oas3.patched/openapi/public/paths/organizations/id/firmware-sets.yaml @@ -0,0 +1,41 @@ +get: + tags: + - Firmware Sets + summary: Get Organization's Firmware Sets + description: Returns all firmware sets associated with the organization. + operationId: getOrganizationFirmwareSets + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - name: page + in: query + description: page number to return + schema: + type: integer + - name: per_page + in: query + description: items returned per page. + schema: + type: integer + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../components/schemas/FirmwareSetListResponse.yaml' + "401": + $ref: '../../../components/schemas/Error.yaml' + "404": + $ref: '../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' diff --git a/spec/oas3.patched/openapi/public/paths/projects/id/firmware-sets.yaml b/spec/oas3.patched/openapi/public/paths/projects/id/firmware-sets.yaml new file mode 100644 index 000000000..694e4798d --- /dev/null +++ b/spec/oas3.patched/openapi/public/paths/projects/id/firmware-sets.yaml @@ -0,0 +1,41 @@ +get: + tags: + - Firmware Sets + summary: Get Project's Firmware Sets + description: Returns all firmware sets associated with the project or organization. + operationId: getProjectFirmwareSets + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - name: page + in: query + description: page number to return + schema: + type: integer + - name: per_page + in: query + description: items returned per page. + schema: + type: integer + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../components/schemas/FirmwareSetListResponse.yaml' + "401": + $ref: '../../../components/schemas/Error.yaml' + "404": + $ref: '../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml'