From 4e1e546cec006d3a03ae1acc1255efd7075506c6 Mon Sep 17 00:00:00 2001 From: Denis Bozzato Date: Wed, 26 Apr 2023 15:06:56 +0100 Subject: [PATCH 1/7] US49481-Included handling of optional VNI and VID for network creation --- .../components/schemas/LocationInfo.yaml | 8 ++++ .../components/schemas/NewNetwork.yaml | 6 +++ v1/pkg/client/api/openapi.yaml | 44 +++++++++++++++++++ v1/pkg/client/docs/LocationInfo.md | 2 + v1/pkg/client/docs/NewNetwork.md | 2 + v1/pkg/client/model_location_info.go | 4 ++ v1/pkg/client/model_new_network.go | 4 ++ 7 files changed, 70 insertions(+) diff --git a/v1/api/swagger/components/schemas/LocationInfo.yaml b/v1/api/swagger/components/schemas/LocationInfo.yaml index bfd9d5d9..441c55aa 100644 --- a/v1/api/swagger/components/schemas/LocationInfo.yaml +++ b/v1/api/swagger/components/schemas/LocationInfo.yaml @@ -7,6 +7,8 @@ required: - Country - Region - DataCenter + - PrivateNetworkVIDRequired + - PrivateNetworkVNIRequired properties: ID: type: string @@ -22,3 +24,9 @@ properties: type: string example: FTC1 description: Data center descriptor + PrivateNetworkVIDRequired: + type: boolean + description: Indicates whether or not the fabric dedicated for private networks requires VLAN ID. + PrivateNetworkVNIRequired: + type: boolean + description: Indicates whether or not the fabric dedicated for private networks requires VNI ID. \ No newline at end of file diff --git a/v1/api/swagger/components/schemas/NewNetwork.yaml b/v1/api/swagger/components/schemas/NewNetwork.yaml index 9a679f78..c8a45ef3 100644 --- a/v1/api/swagger/components/schemas/NewNetwork.yaml +++ b/v1/api/swagger/components/schemas/NewNetwork.yaml @@ -23,3 +23,9 @@ properties: If not specified, the network uses the default IP pool allocated from the hoster/project IP Pool factory and if specified, a new custom IP Pool will be created and used for IP allocations. + VLAN: + type: integer + description: VLAN ID of the network + VNI: + type: integer + description: VNI ID of the network diff --git a/v1/pkg/client/api/openapi.yaml b/v1/pkg/client/api/openapi.yaml index 4144fc91..df732e98 100644 --- a/v1/pkg/client/api/openapi.yaml +++ b/v1/pkg/client/api/openapi.yaml @@ -2787,11 +2787,15 @@ components: TotalStorageGB: 1 Locations: - DataCenter: FTC1 + PrivateNetworkVNIRequired: true Region: Central ID: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + PrivateNetworkVIDRequired: true - DataCenter: FTC1 + PrivateNetworkVNIRequired: true Region: Central ID: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + PrivateNetworkVIDRequired: true NumHosts: 0 ID: ID NumNetworks: 5 @@ -2802,11 +2806,15 @@ components: TotalStorageGB: 1 Locations: - DataCenter: FTC1 + PrivateNetworkVNIRequired: true Region: Central ID: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + PrivateNetworkVIDRequired: true - DataCenter: FTC1 + PrivateNetworkVNIRequired: true Region: Central ID: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + PrivateNetworkVIDRequired: true NumHosts: 0 ID: ID NumNetworks: 5 @@ -2819,11 +2827,15 @@ components: TotalStorageGB: 1 Locations: - DataCenter: FTC1 + PrivateNetworkVNIRequired: true Region: Central ID: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + PrivateNetworkVIDRequired: true - DataCenter: FTC1 + PrivateNetworkVNIRequired: true Region: Central ID: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + PrivateNetworkVIDRequired: true NumHosts: 4 NumCritical: 6 properties: @@ -3152,11 +3164,15 @@ components: Flavor: ubuntu Locations: - DataCenter: FTC1 + PrivateNetworkVNIRequired: true Region: Central ID: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + PrivateNetworkVIDRequired: true - DataCenter: FTC1 + PrivateNetworkVNIRequired: true Region: Central ID: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + PrivateNetworkVIDRequired: true StorageInventory: - FlavorID: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 Capacity: 1 @@ -3338,6 +3354,7 @@ components: - $ref: '#/components/schemas/Network_allOf' NewNetwork: example: + VNI: 6 Description: Private network for intra-cluster communication NewIPPool: NoProxy: localhost,15.10.0.10,test.com @@ -3361,6 +3378,7 @@ components: LocationID: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 HostUse: Default Purpose: Storage + VLAN: 0 Name: Private2 properties: Name: @@ -3383,6 +3401,12 @@ components: $ref: '#/components/schemas/NetworkPurpose' NewIPPool: $ref: '#/components/schemas/NewIPPool' + VLAN: + description: VLAN ID of the network + type: integer + VNI: + description: VNI ID of the network + type: integer required: - LocationID - Name @@ -3820,11 +3844,15 @@ components: TotalStorageGB: 1 Locations: - DataCenter: FTC1 + PrivateNetworkVNIRequired: true Region: Central ID: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + PrivateNetworkVIDRequired: true - DataCenter: FTC1 + PrivateNetworkVNIRequired: true Region: Central ID: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + PrivateNetworkVIDRequired: true NumHosts: 0 ID: ID NumNetworks: 5 @@ -3931,11 +3959,15 @@ components: TotalStorageGB: 1 Locations: - DataCenter: FTC1 + PrivateNetworkVNIRequired: true Region: Central ID: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + PrivateNetworkVIDRequired: true - DataCenter: FTC1 + PrivateNetworkVNIRequired: true Region: Central ID: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + PrivateNetworkVIDRequired: true NumHosts: 4 NumCritical: 6 properties: @@ -4249,8 +4281,10 @@ components: and data center description strings example: DataCenter: FTC1 + PrivateNetworkVNIRequired: true Region: Central ID: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + PrivateNetworkVIDRequired: true properties: ID: description: Unique ID for data center location @@ -4266,10 +4300,20 @@ components: description: Data center descriptor example: FTC1 type: string + PrivateNetworkVIDRequired: + description: Indicates whether or not the fabric dedicated for private networks + requires VLAN ID. + type: boolean + PrivateNetworkVNIRequired: + description: Indicates whether or not the fabric dedicated for private networks + requires VNI ID. + type: boolean required: - Country - DataCenter - ID + - PrivateNetworkVIDRequired + - PrivateNetworkVNIRequired - Region type: object AvailableNetwork: diff --git a/v1/pkg/client/docs/LocationInfo.md b/v1/pkg/client/docs/LocationInfo.md index 85eb237f..614425ad 100644 --- a/v1/pkg/client/docs/LocationInfo.md +++ b/v1/pkg/client/docs/LocationInfo.md @@ -8,6 +8,8 @@ Name | Type | Description | Notes **Country** | [**Country**](Country.md) | | **Region** | **string** | Region within the indicated country | **DataCenter** | **string** | Data center descriptor | +**PrivateNetworkVIDRequired** | **bool** | Indicates whether or not the fabric dedicated for private networks requires VLAN ID. | +**PrivateNetworkVNIRequired** | **bool** | Indicates whether or not the fabric dedicated for private networks requires VNI ID. | [[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/NewNetwork.md b/v1/pkg/client/docs/NewNetwork.md index 8fb8cae3..61c7d9c4 100644 --- a/v1/pkg/client/docs/NewNetwork.md +++ b/v1/pkg/client/docs/NewNetwork.md @@ -10,6 +10,8 @@ Name | Type | Description | Notes **HostUse** | [**NetworkHostUse**](NetworkHostUse.md) | | [optional] **Purpose** | [**NetworkPurpose**](NetworkPurpose.md) | | [optional] **NewIPPool** | Pointer to [**NewIpPool**](NewIPPool.md) | | [optional] +**VLAN** | **int32** | VLAN ID of the network | [optional] +**VNI** | **int32** | VNI ID of the network | [optional] [[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_location_info.go b/v1/pkg/client/model_location_info.go index ccfe5313..e019769b 100644 --- a/v1/pkg/client/model_location_info.go +++ b/v1/pkg/client/model_location_info.go @@ -19,4 +19,8 @@ type LocationInfo struct { Region string `json:"Region"` // Data center descriptor DataCenter string `json:"DataCenter"` + // Indicates whether or not the fabric dedicated for private networks requires VLAN ID. + PrivateNetworkVIDRequired bool `json:"PrivateNetworkVIDRequired"` + // Indicates whether or not the fabric dedicated for private networks requires VNI ID. + PrivateNetworkVNIRequired bool `json:"PrivateNetworkVNIRequired"` } diff --git a/v1/pkg/client/model_new_network.go b/v1/pkg/client/model_new_network.go index 290f2a1f..92d78892 100644 --- a/v1/pkg/client/model_new_network.go +++ b/v1/pkg/client/model_new_network.go @@ -20,4 +20,8 @@ type NewNetwork struct { HostUse NetworkHostUse `json:"HostUse,omitempty"` Purpose NetworkPurpose `json:"Purpose,omitempty"` NewIPPool *NewIpPool `json:"NewIPPool,omitempty"` + // VLAN ID of the network + VLAN int32 `json:"VLAN,omitempty"` + // VNI ID of the network + VNI int32 `json:"VNI,omitempty"` } From d2604671f685367a8d31d1094504013ccaccb795 Mon Sep 17 00:00:00 2001 From: dbozzato81 Date: Wed, 26 Apr 2023 14:08:25 +0000 Subject: [PATCH 2/7] [auto generated] Checking in generated offline HTML doc --- v1/html/index.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/v1/html/index.html b/v1/html/index.html index e86a0492..ad337fb6 100644 --- a/v1/html/index.html +++ b/v1/html/index.html @@ -2712,13 +2712,15 @@

Option 2: Getting the token directly from UI

LocationID
required
string <uuid> (LocationID)

The location ID is the data center location of the resource. The LocationID must be one of those provided by the LocationInfo array returned as part of the get /available-resources call. The locations are typically described by country, region, and data center.

Description
string
HostUse
string (NetworkHostUse)
Enum: "Required" "Default" "Optional"

Indicates whether use of the network is required, default, or optional. If the network is required, any new create host request for that location must include this network among the requested networks. Default and Optional are both optional networks, but imply whether they should show up initially in pre-populated fields in a graphical user interface.

Purpose
string (NetworkPurpose)
Enum: "Backup" "Storage" "vmKernel" "vmNSX-T" "vMotion" "vCHA" "vmFT" "iSCSI-A" "iSCSI-B" "Telemetry" "External"

Indicates the purpose of the network.

-
object or null (NewIPPool)

Responses

object or null (NewIPPool)
VLAN
integer

VLAN ID of the network

+
VNI
integer

VNI ID of the network

+

Responses

Request samples

Content type
application/json
{
  • "Name": "Private2",
  • "LocationID": "58e992d9-6663-492c-8c5b-ecf0b1b3bfe1",
  • "Description": "Private network for intra-cluster communication",
  • "HostUse": "Default",
  • "Purpose": "Storage",
  • "NewIPPool": {
    }
}

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",
  • "LocationID": "58e992d9-6663-492c-8c5b-ecf0b1b3bfe1",
  • "Description": "Private network for intra-cluster communication",
  • "HostUse": "Default",
  • "Purpose": "Storage",
  • "IPPoolID": "string",
  • "VLAN": 0,
  • "VNI": 0
}

Retrieve network by ID

Returns a single network with matching ID

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

Request samples

Content type
application/json
{
  • "Name": "Private2",
  • "LocationID": "58e992d9-6663-492c-8c5b-ecf0b1b3bfe1",
  • "Description": "Private network for intra-cluster communication",
  • "HostUse": "Default",
  • "Purpose": "Storage",
  • "NewIPPool": {
    },
  • "VLAN": 0,
  • "VNI": 0
}

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",
  • "LocationID": "58e992d9-6663-492c-8c5b-ecf0b1b3bfe1",
  • "Description": "Private network for intra-cluster communication",
  • "HostUse": "Default",
  • "Purpose": "Storage",
  • "IPPoolID": "string",
  • "VLAN": 0,
  • "VNI": 0
}

Retrieve network by ID

Returns a single network with matching ID

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

ID of network to return

Responses

Response samples

Content type
application/json
{
  • "Images": [
    ],
  • "Locations": [
    ],
  • "Networks": [
    ],
  • "MachineSizes": [
    ],
  • "VolumeFlavors": [
    ],
  • "Volumes": [
    ],
  • "MachineInventory": [
    ],
  • "StorageInventory": [
    ],
  • "SSHKeys": [
    ]
}

usage-reports

Operations related to retrieving information about resource usage within the project.

+
https://client.greenlake.hpe.com{basePath}/available-resources

Response samples

Content type
application/json
{
  • "Images": [
    ],
  • "Locations": [
    ],
  • "Networks": [
    ],
  • "MachineSizes": [
    ],
  • "VolumeFlavors": [
    ],
  • "Volumes": [
    ],
  • "MachineInventory": [
    ],
  • "StorageInventory": [
    ],
  • "SSHKeys": [
    ]
}

usage-reports

Operations related to retrieving information about resource usage within the project.

Get a usage report

Creates and returns a usage report based on the parameters passed in the request body

Authorizations:
(BearerAuthProject) (BearerAuthMembership)
query Parameters
start
required
string

Start of the billing period

end
string

End of the billing period, default to now if omitted

@@ -2805,7 +2807,7 @@

Option 2: Getting the token directly from UI

Response samples

Content type
application/json
{
  • "Projects": [
    ],
  • "MachineSizes": [
    ],
  • "VolumeFlavors": [
    ],
  • "Summary": {
    }
}

ippools

Operations related to IP pools.

+
https://client.greenlake.hpe.com{basePath}/projects-info

Response samples

Content type
application/json
{
  • "Projects": [
    ],
  • "MachineSizes": [
    ],
  • "VolumeFlavors": [
    ],
  • "Summary": {
    }
}

ippools

Operations related to IP pools.

List all ip pools in project

Returns an array of all ip pool objects defined within the project.

Authorizations:
(BearerAuthProject) (BearerAuthMembership)

Responses

Response samples

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