From 8581943ac0b07a9dc95481bebfd726ac4c60cab3 Mon Sep 17 00:00:00 2001 From: Achyuta Date: Tue, 27 Aug 2024 14:30:47 +0530 Subject: [PATCH 1/4] volume: field for external vol import --- v1/api/swagger/components/schemas/Volume.yaml | 26 +++++++++++++++++++ v1/pkg/client/api/openapi.yaml | 24 +++++++++++++++++ v1/pkg/client/docs/Volume.md | 4 +++ v1/pkg/client/docs/VolumeAllOf.md | 4 +++ v1/pkg/client/model_volume.go | 8 ++++++ v1/pkg/client/model_volume_all_of.go | 8 ++++++ 6 files changed, 74 insertions(+) diff --git a/v1/api/swagger/components/schemas/Volume.yaml b/v1/api/swagger/components/schemas/Volume.yaml index f831610d..b1f071e2 100644 --- a/v1/api/swagger/components/schemas/Volume.yaml +++ b/v1/api/swagger/components/schemas/Volume.yaml @@ -6,6 +6,7 @@ allOf: - FlavorID - StoragePoolID - Capacity + - CapacityUsed - Shareable - LocationID - State @@ -13,6 +14,10 @@ allOf: - Status - Labels - WWN + - UnmanagedVolume + - ActiveSite + - CreatedSite + properties: Description: type: string @@ -35,6 +40,12 @@ allOf: example: 10485760 minimum: 0 description: The size of the volume in KiB + CapacityUsed: + type: integer + format: int64 + example: 10485760 + minimum: 0 + description: The amount of the volume currently used as reported by the array in KiB Shareable: type: boolean description: Indicates if the volume can be attached to multiple hosts @@ -63,3 +74,18 @@ allOf: WWN: type: string description: Serial number of the volume. + ActiveSite: + type: string + format: uuid + description: >- + The site where the remote copy role for the volume is + Primary at the time of most recent import. + CreatedSite: + type: string + format: uuid + description: >- + The site where the volume was originally created. + UnmanagedVolume: + type: boolean + description: Indicates whether the volume is a native Metal created one or an external one. + diff --git a/v1/pkg/client/api/openapi.yaml b/v1/pkg/client/api/openapi.yaml index 62041f84..e7736125 100644 --- a/v1/pkg/client/api/openapi.yaml +++ b/v1/pkg/client/api/openapi.yaml @@ -7111,6 +7111,13 @@ components: format: int64 minimum: 0 type: integer + CapacityUsed: + description: The amount of the volume currently used as reported by the + array in KiB + example: 10485760 + format: int64 + minimum: 0 + type: integer Shareable: description: Indicates if the volume can be attached to multiple hosts type: boolean @@ -7143,8 +7150,24 @@ components: WWN: description: Serial number of the volume. type: string + ActiveSite: + description: The site where the remote copy role for the volume is Primary + at the time of most recent import. + format: uuid + type: string + CreatedSite: + description: The site where the volume was originally created. + format: uuid + type: string + UnmanagedVolume: + description: Indicates whether the volume is a native Metal created one + or an external one. + type: boolean required: + - ActiveSite - Capacity + - CapacityUsed + - CreatedSite - Description - FlavorID - Labels @@ -7154,6 +7177,7 @@ components: - Status - StoragePoolID - SubState + - UnmanagedVolume - WWN UpdateVolume_allOf: properties: diff --git a/v1/pkg/client/docs/Volume.md b/v1/pkg/client/docs/Volume.md index 334b62f0..334e541b 100644 --- a/v1/pkg/client/docs/Volume.md +++ b/v1/pkg/client/docs/Volume.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **FlavorID** | **string** | The VolumeFlavorID matching an entry in the VolumeFlavors array returned as part of the get /available-resources call | **StoragePoolID** | **string** | The storage pool ID matching an entry in the StoragePools array returned as part of the get /available-resources call | **Capacity** | **int64** | The size of the volume in KiB | +**CapacityUsed** | **int64** | The amount of the volume currently used as reported by the array in KiB | **Shareable** | **bool** | Indicates if the volume can be attached to multiple hosts | **LocationID** | **string** | The location of the volume (and the storage array) LocationID is one of those listed by the LocationInfo array returned as part of the get /available-resources call. Any volumes must be in the same location as their attached Host. | **VolumeCollectionID** | **string** | The optional volume collection ID matching an entry in the VolumeCollections array returned as part of the get /available-resources call | [optional] @@ -21,6 +22,9 @@ Name | Type | Description | Notes **Status** | [**VolumeStatus**](VolumeStatus.md) | | **Labels** | **map[string]string** | The map of label name to label value for the resource. | **WWN** | **string** | Serial number of the volume. | +**ActiveSite** | **string** | The site where the remote copy role for the volume is Primary at the time of most recent import. | +**CreatedSite** | **string** | The site where the volume was originally created. | +**UnmanagedVolume** | **bool** | Indicates whether the volume is a native Metal created one or an external one. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/v1/pkg/client/docs/VolumeAllOf.md b/v1/pkg/client/docs/VolumeAllOf.md index 7001a9bb..cd8ccce8 100644 --- a/v1/pkg/client/docs/VolumeAllOf.md +++ b/v1/pkg/client/docs/VolumeAllOf.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **FlavorID** | **string** | The VolumeFlavorID matching an entry in the VolumeFlavors array returned as part of the get /available-resources call | **StoragePoolID** | **string** | The storage pool ID matching an entry in the StoragePools array returned as part of the get /available-resources call | **Capacity** | **int64** | The size of the volume in KiB | +**CapacityUsed** | **int64** | The amount of the volume currently used as reported by the array in KiB | **Shareable** | **bool** | Indicates if the volume can be attached to multiple hosts | **LocationID** | **string** | The location of the volume (and the storage array) LocationID is one of those listed by the LocationInfo array returned as part of the get /available-resources call. Any volumes must be in the same location as their attached Host. | **VolumeCollectionID** | **string** | The optional volume collection ID matching an entry in the VolumeCollections array returned as part of the get /available-resources call | [optional] @@ -16,6 +17,9 @@ Name | Type | Description | Notes **Status** | [**VolumeStatus**](VolumeStatus.md) | | **Labels** | **map[string]string** | The map of label name to label value for the resource. | **WWN** | **string** | Serial number of the volume. | +**ActiveSite** | **string** | The site where the remote copy role for the volume is Primary at the time of most recent import. | +**CreatedSite** | **string** | The site where the volume was originally created. | +**UnmanagedVolume** | **bool** | Indicates whether the volume is a native Metal created one or an external one. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/v1/pkg/client/model_volume.go b/v1/pkg/client/model_volume.go index f32bd3d0..f7eca571 100644 --- a/v1/pkg/client/model_volume.go +++ b/v1/pkg/client/model_volume.go @@ -32,6 +32,8 @@ type Volume struct { StoragePoolID string `json:"StoragePoolID"` // The size of the volume in KiB Capacity int64 `json:"Capacity"` + // The amount of the volume currently used as reported by the array in KiB + CapacityUsed int64 `json:"CapacityUsed"` // Indicates if the volume can be attached to multiple hosts Shareable bool `json:"Shareable"` // The location of the volume (and the storage array) LocationID is one of those listed by the LocationInfo array returned as part of the get /available-resources call. Any volumes must be in the same location as their attached Host. @@ -45,4 +47,10 @@ type Volume struct { Labels map[string]string `json:"Labels"` // Serial number of the volume. WWN string `json:"WWN"` + // The site where the remote copy role for the volume is Primary at the time of most recent import. + ActiveSite string `json:"ActiveSite"` + // The site where the volume was originally created. + CreatedSite string `json:"CreatedSite"` + // Indicates whether the volume is a native Metal created one or an external one. + UnmanagedVolume bool `json:"UnmanagedVolume"` } diff --git a/v1/pkg/client/model_volume_all_of.go b/v1/pkg/client/model_volume_all_of.go index c1b07f7b..c397ed86 100644 --- a/v1/pkg/client/model_volume_all_of.go +++ b/v1/pkg/client/model_volume_all_of.go @@ -19,6 +19,8 @@ type VolumeAllOf struct { StoragePoolID string `json:"StoragePoolID"` // The size of the volume in KiB Capacity int64 `json:"Capacity"` + // The amount of the volume currently used as reported by the array in KiB + CapacityUsed int64 `json:"CapacityUsed"` // Indicates if the volume can be attached to multiple hosts Shareable bool `json:"Shareable"` // The location of the volume (and the storage array) LocationID is one of those listed by the LocationInfo array returned as part of the get /available-resources call. Any volumes must be in the same location as their attached Host. @@ -32,4 +34,10 @@ type VolumeAllOf struct { Labels map[string]string `json:"Labels"` // Serial number of the volume. WWN string `json:"WWN"` + // The site where the remote copy role for the volume is Primary at the time of most recent import. + ActiveSite string `json:"ActiveSite"` + // The site where the volume was originally created. + CreatedSite string `json:"CreatedSite"` + // Indicates whether the volume is a native Metal created one or an external one. + UnmanagedVolume bool `json:"UnmanagedVolume"` } From b4368be2ba162f4f6a1c772d439c0e01b9e134fb Mon Sep 17 00:00:00 2001 From: achu-1612 Date: Tue, 27 Aug 2024 10:42:28 +0000 Subject: [PATCH 2/4] [auto generated] Checking in generated offline HTML doc --- v1/html/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/v1/html/index.html b/v1/html/index.html index 0fe268b3..7f8348ac 100644 --- a/v1/html/index.html +++ b/v1/html/index.html @@ -2663,7 +2663,7 @@

Option 2: Getting the token directly from UI

Response samples

Content type
application/json
[
  • {
    }
]

Add a new volume

Adds a new volume to the project. Volumes may be created separately and then referenced in the create Host call; or volumes may be created directly within the create Host call. If GreenLake Platform IAM issued token is used for authentication, then it is required to pass 'X-Role' and 'X-Workspaceid' headers.

+
https://client.greenlake.hpe.com{basePath}/volumes

Response samples

Content type
application/json
[
  • {
    }
]

Add a new volume

Adds a new volume to the project. Volumes may be created separately and then referenced in the create Host call; or volumes may be created directly within the create Host call. If GreenLake Platform IAM issued token is used for authentication, then it is required to pass 'X-Role' and 'X-Workspaceid' headers.

Authorizations:
(BearerAuthProject) (BearerAuthMembership)
header Parameters
X-Role
string
Example: metal-infra-admin

GreenLake Platform role name

X-Workspaceid
string
Example: 1a2ba81600dd11efa47076a3447ec4eb

GreenLake Platform workspace ID

Request Body schema: application/json

Volume that is to be added to the project

@@ -2681,7 +2681,7 @@

Option 2: Getting the token directly from UI

Request samples

Content type
application/json
{
  • "Name": "NewVolumeName",
  • "Description": "Description of New Volume",
  • "FlavorID": "69d82b9f-19a6-47cd-bcb3-7f4b437e8e51",
  • "Capacity": 10,
  • "Shareable": true,
  • "LocationID": "58e992d9-6663-492c-8c5b-ecf0b1b3bfe1",
  • "Labels": {
    },
  • "StoragePoolID": "4028a467-4960-41d8-94b5-7611e50c0642",
  • "VolumeCollectionID": "0bc8d647-85d3-4a49-8d49-8626da150790"
}

Response samples

Content type
application/json
{
  • "ID": "3892eb50-4697-4c72-aadc-32b766bce3c0",
  • "ETag": "a8a0a8d9-d35b-45c6-840f-2b3694efc394",
  • "Name": "My Object Name",
  • "Created": "2019-06-27T22:59:01.661Z",
  • "Modified": "2020-02-27T18:28:02.863Z",
  • "Description": "Description of New Volume",
  • "FlavorID": "69d82b9f-19a6-47cd-bcb3-7f4b437e8e51",
  • "StoragePoolID": "4028a467-4960-41d8-94b5-7611e50c0642",
  • "Capacity": 10485760,
  • "Shareable": true,
  • "LocationID": "58e992d9-6663-492c-8c5b-ecf0b1b3bfe1",
  • "VolumeCollectionID": "0bc8d647-85d3-4a49-8d49-8626da150790",
  • "State": "new",
  • "SubState": "idle",
  • "Status": "ok",
  • "Labels": {
    },
  • "WWN": "string"
}

Retrieve volume by ID

Returns a single volume with matching imaged. If GreenLake Platform IAM issued token is used for authentication, then it is required to pass 'X-Role' and 'X-Workspaceid' headers.

+
https://client.greenlake.hpe.com{basePath}/volumes

Request samples

Content type
application/json
{
  • "Name": "NewVolumeName",
  • "Description": "Description of New Volume",
  • "FlavorID": "69d82b9f-19a6-47cd-bcb3-7f4b437e8e51",
  • "Capacity": 10,
  • "Shareable": true,
  • "LocationID": "58e992d9-6663-492c-8c5b-ecf0b1b3bfe1",
  • "Labels": {
    },
  • "StoragePoolID": "4028a467-4960-41d8-94b5-7611e50c0642",
  • "VolumeCollectionID": "0bc8d647-85d3-4a49-8d49-8626da150790"
}

Response samples

Content type
application/json
{
  • "ID": "3892eb50-4697-4c72-aadc-32b766bce3c0",
  • "ETag": "a8a0a8d9-d35b-45c6-840f-2b3694efc394",
  • "Name": "My Object Name",
  • "Created": "2019-06-27T22:59:01.661Z",
  • "Modified": "2020-02-27T18:28:02.863Z",
  • "Description": "Description of New Volume",
  • "FlavorID": "69d82b9f-19a6-47cd-bcb3-7f4b437e8e51",
  • "StoragePoolID": "4028a467-4960-41d8-94b5-7611e50c0642",
  • "Capacity": 10485760,
  • "CapacityUsed": 10485760,
  • "Shareable": true,
  • "LocationID": "58e992d9-6663-492c-8c5b-ecf0b1b3bfe1",
  • "VolumeCollectionID": "0bc8d647-85d3-4a49-8d49-8626da150790",
  • "State": "new",
  • "SubState": "idle",
  • "Status": "ok",
  • "Labels": {
    },
  • "WWN": "string",
  • "ActiveSite": "02787c18-fee9-4cd9-bbfc-d9e53da7fb0c",
  • "CreatedSite": "90b0f67e-6df2-4563-9928-ed119a84196e",
  • "UnmanagedVolume": true
}

Retrieve volume by ID

Returns a single volume with matching imaged. If GreenLake Platform IAM issued token is used for authentication, then it is required to pass 'X-Role' and 'X-Workspaceid' headers.

Authorizations:
(BearerAuthProject) (BearerAuthMembership)
path Parameters
volumeId
required
string

ID of volume to return

header Parameters
X-Role
string
Example: metal-infra-admin

GreenLake Platform role name

X-Workspaceid
string
Example: 1a2ba81600dd11efa47076a3447ec4eb

GreenLake Platform workspace ID

@@ -2691,7 +2691,7 @@

Option 2: Getting the token directly from UI

Response samples

Content type
application/json
{
  • "ID": "3892eb50-4697-4c72-aadc-32b766bce3c0",
  • "ETag": "a8a0a8d9-d35b-45c6-840f-2b3694efc394",
  • "Name": "My Object Name",
  • "Created": "2019-06-27T22:59:01.661Z",
  • "Modified": "2020-02-27T18:28:02.863Z",
  • "Description": "Description of New Volume",
  • "FlavorID": "69d82b9f-19a6-47cd-bcb3-7f4b437e8e51",
  • "StoragePoolID": "4028a467-4960-41d8-94b5-7611e50c0642",
  • "Capacity": 10485760,
  • "Shareable": true,
  • "LocationID": "58e992d9-6663-492c-8c5b-ecf0b1b3bfe1",
  • "VolumeCollectionID": "0bc8d647-85d3-4a49-8d49-8626da150790",
  • "State": "new",
  • "SubState": "idle",
  • "Status": "ok",
  • "Labels": {
    },
  • "WWN": "string"
}

Update an existing volume

Updates volume with matching ID. Update is permitted only when volume is in 'Allocated' or 'Visible' state. Only the Volume 'Capacity' can be updated with a value greater than the existing one to expand the volume. If GreenLake Platform IAM issued token is used for authentication, then it is required to pass 'X-Role' and 'X-Workspaceid' headers.

+
https://client.greenlake.hpe.com{basePath}/volumes/{volumeId}

Response samples

Content type
application/json
{
  • "ID": "3892eb50-4697-4c72-aadc-32b766bce3c0",
  • "ETag": "a8a0a8d9-d35b-45c6-840f-2b3694efc394",
  • "Name": "My Object Name",
  • "Created": "2019-06-27T22:59:01.661Z",
  • "Modified": "2020-02-27T18:28:02.863Z",
  • "Description": "Description of New Volume",
  • "FlavorID": "69d82b9f-19a6-47cd-bcb3-7f4b437e8e51",
  • "StoragePoolID": "4028a467-4960-41d8-94b5-7611e50c0642",
  • "Capacity": 10485760,
  • "CapacityUsed": 10485760,
  • "Shareable": true,
  • "LocationID": "58e992d9-6663-492c-8c5b-ecf0b1b3bfe1",
  • "VolumeCollectionID": "0bc8d647-85d3-4a49-8d49-8626da150790",
  • "State": "new",
  • "SubState": "idle",
  • "Status": "ok",
  • "Labels": {
    },
  • "WWN": "string",
  • "ActiveSite": "02787c18-fee9-4cd9-bbfc-d9e53da7fb0c",
  • "CreatedSite": "90b0f67e-6df2-4563-9928-ed119a84196e",
  • "UnmanagedVolume": true
}

Update an existing volume

Updates volume with matching ID. Update is permitted only when volume is in 'Allocated' or 'Visible' state. Only the Volume 'Capacity' can be updated with a value greater than the existing one to expand the volume. If GreenLake Platform IAM issued token is used for authentication, then it is required to pass 'X-Role' and 'X-Workspaceid' headers.

Authorizations:
(BearerAuthProject) (BearerAuthMembership)
path Parameters
volumeId
required
string

ID of volume to return

header Parameters
X-Role
string
Example: metal-infra-admin

GreenLake Platform role name

X-Workspaceid
string
Example: 1a2ba81600dd11efa47076a3447ec4eb

GreenLake Platform workspace ID

@@ -2711,7 +2711,7 @@

Option 2: Getting the token directly from UI

Request samples

Content type
application/json
{
  • "ID": "3892eb50-4697-4c72-aadc-32b766bce3c0",
  • "ETag": "a8a0a8d9-d35b-45c6-840f-2b3694efc394",
  • "Name": "My Object Name",
  • "Capacity": 10485760,
  • "VolumeCollectionID": "90be909e-4609-40f5-9630-f24910dc8591",
  • "Labels": {
    }
}

Response samples

Content type
application/json
{
  • "ID": "3892eb50-4697-4c72-aadc-32b766bce3c0",
  • "ETag": "a8a0a8d9-d35b-45c6-840f-2b3694efc394",
  • "Name": "My Object Name",
  • "Created": "2019-06-27T22:59:01.661Z",
  • "Modified": "2020-02-27T18:28:02.863Z",
  • "Description": "Description of New Volume",
  • "FlavorID": "69d82b9f-19a6-47cd-bcb3-7f4b437e8e51",
  • "StoragePoolID": "4028a467-4960-41d8-94b5-7611e50c0642",
  • "Capacity": 10485760,
  • "Shareable": true,
  • "LocationID": "58e992d9-6663-492c-8c5b-ecf0b1b3bfe1",
  • "VolumeCollectionID": "0bc8d647-85d3-4a49-8d49-8626da150790",
  • "State": "new",
  • "SubState": "idle",
  • "Status": "ok",
  • "Labels": {
    },
  • "WWN": "string"
}

Delete a volume

Deletes the volume with the matching ID. If GreenLake Platform IAM issued token is used for authentication, then it is required to pass 'X-Role' and 'X-Workspaceid' headers.

+
https://client.greenlake.hpe.com{basePath}/volumes/{volumeId}

Request samples

Content type
application/json
{
  • "ID": "3892eb50-4697-4c72-aadc-32b766bce3c0",
  • "ETag": "a8a0a8d9-d35b-45c6-840f-2b3694efc394",
  • "Name": "My Object Name",
  • "Capacity": 10485760,
  • "VolumeCollectionID": "90be909e-4609-40f5-9630-f24910dc8591",
  • "Labels": {
    }
}

Response samples

Content type
application/json
{
  • "ID": "3892eb50-4697-4c72-aadc-32b766bce3c0",
  • "ETag": "a8a0a8d9-d35b-45c6-840f-2b3694efc394",
  • "Name": "My Object Name",
  • "Created": "2019-06-27T22:59:01.661Z",
  • "Modified": "2020-02-27T18:28:02.863Z",
  • "Description": "Description of New Volume",
  • "FlavorID": "69d82b9f-19a6-47cd-bcb3-7f4b437e8e51",
  • "StoragePoolID": "4028a467-4960-41d8-94b5-7611e50c0642",
  • "Capacity": 10485760,
  • "CapacityUsed": 10485760,
  • "Shareable": true,
  • "LocationID": "58e992d9-6663-492c-8c5b-ecf0b1b3bfe1",
  • "VolumeCollectionID": "0bc8d647-85d3-4a49-8d49-8626da150790",
  • "State": "new",
  • "SubState": "idle",
  • "Status": "ok",
  • "Labels": {
    },
  • "WWN": "string",
  • "ActiveSite": "02787c18-fee9-4cd9-bbfc-d9e53da7fb0c",
  • "CreatedSite": "90b0f67e-6df2-4563-9928-ed119a84196e",
  • "UnmanagedVolume": true
}

Delete a volume

Deletes the volume with the matching ID. If GreenLake Platform IAM issued token is used for authentication, then it is required to pass 'X-Role' and 'X-Workspaceid' headers.

Authorizations:
(BearerAuthProject) (BearerAuthMembership)
path Parameters
volumeId
required
string

ID of volume to delete

header Parameters
X-Role
string
Example: metal-infra-admin

GreenLake Platform role name

X-Workspaceid
string
Example: 1a2ba81600dd11efa47076a3447ec4eb

GreenLake Platform workspace ID

@@ -3047,7 +3047,7 @@

Option 2: Getting the token directly from UI

Response samples

Content type
application/json
{
  • "message": "string",
  • "details": "string"
}