From f5bafbfdd8659863921108fa09e146b34e607aa4 Mon Sep 17 00:00:00 2001 From: Douglas Lee <65295939+leedouglas@users.noreply.github.com> Date: Mon, 4 Jan 2021 21:04:30 -0500 Subject: [PATCH] Add addons to AVS 2020-07-17-preview (#12236) * found missing AVS/privateclouds/addons commit, moving it to 2020-07-17-preview API from PR repo * fixed prettier errors * Fixed vladation warnings for x-ms-enum and missing description/title, related to addons * fixed validation error for missing systemData for addons responses * fixed prettier errors * fixed validation error for missing systemData for addons responses * systemData for any Resource * make sure systemData is readOnly * systemData needs to go in a new api version * suppress systemData error Co-authored-by: Cameron Taggart --- .../examples/Addons_CreateOrUpdate.json | 41 +++ .../examples/Addons_Delete.json | 14 + .../examples/Addons_Get.json | 23 ++ .../examples/Addons_List.json | 26 ++ .../preview/2020-07-17-preview/vmware.json | 314 +++++++++++++++++- .../vmware/resource-manager/readme.md | 3 + 6 files changed, 418 insertions(+), 3 deletions(-) create mode 100644 specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_CreateOrUpdate.json create mode 100644 specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_Delete.json create mode 100644 specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_Get.json create mode 100644 specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_List.json diff --git a/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_CreateOrUpdate.json b/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_CreateOrUpdate.json new file mode 100644 index 000000000000..87d7253094cc --- /dev/null +++ b/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_CreateOrUpdate.json @@ -0,0 +1,41 @@ +{ + "parameters": { + "api-version": "2020-07-17-preview", + "subscriptionId": "{subscription-id}", + "resourceGroupName": "group1", + "privateCloudName": "cloud1", + "addonName": "srm", + "addon": { + "properties": { + "addonType": "SRM", + "licenseKey": "41915178-A8FF-4A4D-B683-6D735AF5E3F5" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm", + "name": "srm", + "properties": { + "addonType": "SRM", + "licenseKey": "41915178-A8FF-4A4D-B683-6D735AF5E3F5", + "provisioningState": "Succeeded" + }, + "type": "Microsoft.AVS/privateClouds/addons" + } + }, + "201": { + "body": { + "id": "/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm", + "name": "srm", + "properties": { + "addonType": "SRM", + "licenseKey": "41915178-A8FF-4A4D-B683-6D735AF5E3F5", + "provisioningState": "Updating" + }, + "type": "Microsoft.AVS/privateClouds/addons" + } + } + } +} diff --git a/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_Delete.json b/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_Delete.json new file mode 100644 index 000000000000..3b5f653d6281 --- /dev/null +++ b/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_Delete.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "api-version": "2020-07-17-preview", + "subscriptionId": "{subscription-id}", + "resourceGroupName": "group1", + "privateCloudName": "cloud1", + "addonName": "srm" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_Get.json b/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_Get.json new file mode 100644 index 000000000000..eb443d098b00 --- /dev/null +++ b/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_Get.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "api-version": "2020-07-17-preview", + "subscriptionId": "{subscription-id}", + "resourceGroupName": "group1", + "privateCloudName": "cloud1", + "addonName": "srm" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm", + "name": "srm", + "properties": { + "addonType": "SRM", + "licenseKey": "41915178-A8FF-4A4D-B683-6D735AF5E3F5", + "provisioningState": "Succeeded" + }, + "type": "Microsoft.AVS/privateClouds/addons" + } + } + } +} diff --git a/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_List.json b/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_List.json new file mode 100644 index 000000000000..a756ae2f5e3a --- /dev/null +++ b/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/examples/Addons_List.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "api-version": "2020-07-17-preview", + "subscriptionId": "{subscription-id}", + "resourceGroupName": "group1", + "privateCloudName": "cloud1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm", + "name": "srm", + "properties": { + "addonType": "SRM", + "licenseKey": "41915178-A8FF-4A4D-B683-6D735AF5E3F5", + "provisioningState": "Succeeded" + }, + "type": "Microsoft.AVS/privateClouds/addons" + } + ] + } + } + } +} diff --git a/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/vmware.json b/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/vmware.json index 2eee285d3d9a..b9e382738ec6 100644 --- a/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/vmware.json +++ b/specification/vmware/resource-manager/Microsoft.AVS/preview/2020-07-17-preview/vmware.json @@ -92,6 +92,14 @@ "description": "Name of the HCX Enterprise Site in the private cloud", "x-ms-parameter-location": "method" }, + "addonName": { + "name": "addonName", + "in": "path", + "required": true, + "type": "string", + "description": "Name of the addon for the private cloud", + "x-ms-parameter-location": "method" + }, "authorizationName": { "name": "authorizationName", "in": "path", @@ -247,7 +255,7 @@ } }, "x-ms-examples": { - "CheckQuotaAvailability": { + "Locations_CheckTrialAvailability": { "$ref": "./examples/Locations_CheckTrialAvailability.json" } } @@ -290,7 +298,7 @@ } }, "x-ms-examples": { - "CheckQuotaAvailability": { + "Locations_CheckQuotaAvailability": { "$ref": "./examples/Locations_CheckQuotaAvailability.json" } } @@ -371,7 +379,7 @@ } }, "x-ms-examples": { - "PrivateClouds_List": { + "PrivateClouds_ListInSubscription": { "$ref": "./examples/PrivateClouds_ListInSubscription.json" } } @@ -3162,6 +3170,206 @@ } } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons": { + "get": { + "operationId": "Addons_List", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "tags": [ + "Addons" + ], + "summary": "List addons in a private cloud", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/privateCloudName" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/AddonList" + } + }, + "default": { + "description": "Error response describing why the operation failed", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Addons_List": { + "$ref": "./examples/Addons_List.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}": { + "get": { + "operationId": "Addons_Get", + "tags": [ + "Addons" + ], + "summary": "Get an addon by name in a private cloud", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/privateCloudName" + }, + { + "$ref": "#/parameters/addonName" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Addon" + } + }, + "default": { + "description": "Error response describing why the operation failed", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Addons_Get": { + "$ref": "./examples/Addons_Get.json" + } + } + }, + "put": { + "operationId": "Addons_CreateOrUpdate", + "x-ms-long-running-operation": true, + "tags": [ + "Addons" + ], + "summary": "Create or update a addon in a private cloud", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "privateCloudName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the private cloud." + }, + { + "$ref": "#/parameters/addonName" + }, + { + "name": "addon", + "description": "A addon in the private cloud", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Addon" + } + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Addon" + } + }, + "201": { + "description": "accepted operation", + "schema": { + "$ref": "#/definitions/Addon" + } + }, + "default": { + "description": "Error response describing why the operation failed", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Addons_CreateOrUpdate": { + "$ref": "./examples/Addons_CreateOrUpdate.json" + } + } + }, + "delete": { + "operationId": "Addons_Delete", + "x-ms-long-running-operation": true, + "tags": [ + "Addons" + ], + "summary": "Delete a addon in a private cloud", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/privateCloudName" + }, + { + "$ref": "#/parameters/addonName" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The delete has succeeded" + }, + "202": { + "description": "Accepted. The delete will complete asynchronously" + }, + "204": { + "description": "No Content. No addon to delete" + }, + "default": { + "description": "Error response describing why the operation failed", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Addons_Delete": { + "$ref": "./examples/Addons_Delete.json" + } + } + } } }, "definitions": { @@ -3957,6 +4165,106 @@ } } }, + "Addon": { + "description": "An addon resource", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "description": "The properties of an addon resource", + "$ref": "#/definitions/AddonProperties", + "x-ms-client-flatten": true + } + } + }, + "AddonUpdate": { + "description": "An update of an addon resource", + "properties": { + "properties": { + "description": "The properties of an addon resource that may be updated", + "$ref": "#/definitions/AddonUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "AddonUpdateProperties": { + "description": "The properties of an addon that may be updated", + "properties": { + "properties": { + "description": "reference specific properties definition for addon type being used", + "$ref": "#/definitions/AddonProperties", + "x-ms-client-flatten": true + } + } + }, + "AddonProperties": { + "description": "The properties of an addon that may be updated", + "allOf": [ + { + "$ref": "#/definitions/AddonSrmProperties" + } + ], + "properties": { + "addonType": { + "description": "The type of private cloud addon", + "type": "string", + "enum": [ + "SRM", + "VR" + ], + "x-ms-enum": { + "name": "AddonType", + "modelAsString": true + } + }, + "provisioningState": { + "description": "The state of the addon provisioning", + "type": "string", + "readOnly": true, + "enum": [ + "Succeeded", + "Failed", + "Cancelled", + "Deleting", + "Updating" + ], + "x-ms-enum": { + "name": "AddonProvisioningState", + "modelAsString": true + } + } + } + }, + "AddonSrmProperties": { + "description": "The properties of an SRM addon that may be updated", + "properties": { + "licenseKey": { + "description": "The SRM license", + "type": "string" + } + } + }, + "AddonList": { + "description": "A paged list of addons", + "properties": { + "value": { + "description": "The items on a page", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Addon" + } + }, + "nextLink": { + "description": "URL to get the next page if any", + "type": "string", + "readOnly": true + } + } + }, "AdminCredentials": { "description": "Administrative credentials for accessing vCenter and NSX-T", "properties": { diff --git a/specification/vmware/resource-manager/readme.md b/specification/vmware/resource-manager/readme.md index 8f7461ad4b09..90e2880519a8 100644 --- a/specification/vmware/resource-manager/readme.md +++ b/specification/vmware/resource-manager/readme.md @@ -53,6 +53,9 @@ directive: from: Microsoft.AVS/preview/2020-07-17-preview/vmware.json where: $.definitions.Operation.properties.properties reason: x-ms-client-flatten not needed for Operation + - suppress: R4009 + from: Microsoft.AVS/preview/2020-07-17-preview/vmware.json + reason: systemData will be in the next API version ``` ### Tag: package-2020-03-20