Skip to content

Commit

Permalink
Angos/msi extensionresource (Azure#7528)
Browse files Browse the repository at this point in the history
* Add extension resource operation to swagger

* Add change to preview version

* Correct API

* Remove lists references.

* Clean up errors.

* Clean up linting errors.

* Add examples

* Add content to files

* Fix examples and path

* Fix param

* Format examples

* Run prettier

* Address comments.

* Fix model.

* Make location a required field

* Address lint error

* Remove resourceName from scope

* Use a common resource definition

* Run prettier

* Fix errors

* Remove tags from systemassignedidentity response

* Fix description.

* Remove tags from response

* Add error suppression

* Change array formatting
  • Loading branch information
angosms authored and 00Kai0 committed Oct 12, 2020
1 parent 7f46f44 commit 239fc7b
Show file tree
Hide file tree
Showing 5 changed files with 293 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,39 @@
}
},
"paths": {
"/{scope}/providers/Microsoft.ManagedIdentity/identities/default": {
"get": {
"operationId": "SystemAssignedIdentities_GetByScope",
"description": "Gets the systemAssignedIdentity available under the specified RP scope.",
"x-ms-examples": {
"MsiOperationsList": {
"$ref": "./examples/SystemAssignedIdentityGet.json"
}
},
"parameters": [
{
"$ref": "#/parameters/ScopeParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK. The systemAssignedIdentity was retrieved and returned successfully.",
"schema": {
"$ref": "#/definitions/SystemAssignedIdentity"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/CloudError"
}
}
}
}
},
"/providers/Microsoft.ManagedIdentity/operations": {
"get": {
"operationId": "Operations_List",
Expand Down Expand Up @@ -318,22 +351,28 @@
}
},
"definitions": {
"Identity": {
"Resource": {
"properties": {
"id": {
"type": "string",
"readOnly": true,
"description": "The id of the created identity."
"description": "The id of the resource."
},
"name": {
"type": "string",
"readOnly": true,
"description": "The name of the created identity."
"description": "The name of the resource."
},
"location": {
"type": "string",
"description": "The Azure region where the identity lives."
},
"description": "The Azure region where the resource lives."
}
},
"x-ms-azure-resource": true,
"description": "Describes common properties of a resource."
},
"Identity": {
"properties": {
"tags": {
"type": "object",
"additionalProperties": {
Expand All @@ -343,6 +382,7 @@
},
"properties": {
"x-ms-client-flatten": true,
"readOnly": true,
"description": "The properties associated with the identity.",
"$ref": "#/definitions/IdentityProperties"
},
Expand All @@ -359,9 +399,42 @@
"description": "The type of resource i.e. Microsoft.ManagedIdentity/userAssignedIdentities"
}
},
"required": [
"location"
],
"allOf": [
{
"$ref": "#/definitions/Resource"
}
],
"x-ms-azure-resource": true,
"description": "Describes an identity resource."
},
"SystemAssignedIdentity": {
"properties": {
"properties": {
"x-ms-client-flatten": true,
"readOnly": true,
"description": "The properties associated with the identity.",
"$ref": "#/definitions/IdentityProperties"
},
"type": {
"type": "string",
"readOnly": true,
"description": "The type of resource i.e. Microsoft.Compute/virtualMachineScaleSets"
}
},
"required": [
"location"
],
"allOf": [
{
"$ref": "#/definitions/Resource"
}
],
"x-ms-azure-resource": true,
"description": "Describes a system assigned identity resource."
},
"IdentityProperties": {
"description": "The properties associated with the identity.",
"type": "object",
Expand Down Expand Up @@ -507,6 +580,15 @@
}
},
"parameters": {
"ScopeParameter": {
"name": "scope",
"in": "path",
"required": true,
"type": "string",
"description": "The resource provider scope of the resource. Parent resource being extended by Managed Identities.",
"x-ms-parameter-location": "method",
"x-ms-skip-url-encoding": true
},
"SubscriptionIdParameter": {
"name": "subscriptionId",
"in": "path",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"parameters": {
"api-version": "2015-08-31-preview",
"scope": "scope"
},
"responses": {
"200": {
"body": {
"id": "/scope",
"location": "cus",
"name": "resourceName",
"properties": {
"clientId": "clientGUID",
"clientSecretUrl": "https://serviceRoot/scope/credentials?tid=tenantId&oid=principalId&aid=clientId",
"principalId": "identityObjectID",
"tenantId": "tenantGUID"
},
"type": "ResourceProvider"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,39 @@
}
},
"paths": {
"/{scope}/providers/Microsoft.ManagedIdentity/identities/default": {
"get": {
"operationId": "SystemAssignedIdentities_GetByScope",
"description": "Gets the systemAssignedIdentity available under the specified RP scope.",
"x-ms-examples": {
"MsiOperationsList": {
"$ref": "./examples/SystemAssignedIdentityGet.json"
}
},
"parameters": [
{
"$ref": "#/parameters/ScopeParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK. The systemAssignedIdentity was retrieved and returned successfully.",
"schema": {
"$ref": "#/definitions/SystemAssignedIdentity"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/CloudError"
}
}
}
}
},
"/providers/Microsoft.ManagedIdentity/operations": {
"get": {
"operationId": "Operations_List",
Expand Down Expand Up @@ -221,7 +254,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Identity"
"$ref": "#/definitions/IdentityPatch"
},
"description": "Parameters to update the identity"
}
Expand Down Expand Up @@ -318,22 +351,67 @@
}
},
"definitions": {
"Identity": {
"Resource": {
"properties": {
"id": {
"type": "string",
"readOnly": true,
"description": "The id of the created identity."
"description": "The id of the resource."
},
"name": {
"type": "string",
"readOnly": true,
"description": "The name of the created identity."
"description": "The name of the resource."
},
"location": {
"type": "string",
"description": "The Azure region where the identity lives."
"description": "The Azure region where the resource lives."
}
},
"x-ms-azure-resource": true,
"description": "Describes common properties of a resource."
},
"Identity": {
"properties": {
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Resource tags"
},
"properties": {
"x-ms-client-flatten": true,
"readOnly": true,
"description": "The properties associated with the identity.",
"$ref": "#/definitions/UserAssignedIdentityProperties"
},
"type": {
"type": "string",
"readOnly": true,
"enum": [
"Microsoft.ManagedIdentity/userAssignedIdentities"
],
"x-ms-enum": {
"name": "UserAssignedIdentities",
"modelAsString": true
},
"description": "The type of resource i.e. Microsoft.ManagedIdentity/userAssignedIdentities"
}
},
"required": [
"location"
],
"allOf": [
{
"$ref": "#/definitions/Resource"
}
],
"x-ms-azure-resource": true,
"description": "Describes an identity resource."
},
"IdentityPatch": {
"properties": {
"tags": {
"type": "object",
"additionalProperties": {
Expand All @@ -343,8 +421,9 @@
},
"properties": {
"x-ms-client-flatten": true,
"readOnly": true,
"description": "The properties associated with the identity.",
"$ref": "#/definitions/IdentityProperties"
"$ref": "#/definitions/UserAssignedIdentityProperties"
},
"type": {
"type": "string",
Expand All @@ -359,13 +438,43 @@
"description": "The type of resource i.e. Microsoft.ManagedIdentity/userAssignedIdentities"
}
},
"allOf": [
{
"$ref": "#/definitions/Resource"
}
],
"x-ms-azure-resource": true,
"description": "Describes an identity resource."
},
"IdentityProperties": {
"description": "The properties associated with the identity.",
"SystemAssignedIdentity": {
"properties": {
"properties": {
"x-ms-client-flatten": true,
"readOnly": true,
"description": "The properties associated with the identity.",
"$ref": "#/definitions/SystemAssignedIdentityProperties"
},
"type": {
"type": "string",
"readOnly": true,
"description": "The type of resource i.e. Microsoft.Compute/virtualMachineScaleSets"
}
},
"required": [
"location"
],
"allOf": [
{
"$ref": "#/definitions/Resource"
}
],
"x-ms-azure-resource": true,
"description": "Describes a system assigned identity resource."
},
"SystemAssignedIdentityProperties": {
"description": "The properties associated with the system assigned identity.",
"type": "object",
"title": "Identity properties.",
"title": "System Assigned Identity properties.",
"properties": {
"tenantId": {
"type": "string",
Expand All @@ -388,7 +497,32 @@
"clientSecretUrl": {
"type": "string",
"readOnly": true,
"description": " The ManagedServiceIdentity DataPlane URL that can be queried to obtain the identity credentials. If identity is user assigned, then the clientSecretUrl will not be present in the response, otherwise it will be present."
"description": " The ManagedServiceIdentity DataPlane URL that can be queried to obtain the identity credentials."
}
}
},
"UserAssignedIdentityProperties": {
"description": "The properties associated with the user assigned identity.",
"type": "object",
"title": "User Assigned Identity properties.",
"properties": {
"tenantId": {
"type": "string",
"readOnly": true,
"format": "uuid",
"description": "The id of the tenant which the identity belongs to."
},
"principalId": {
"type": "string",
"readOnly": true,
"format": "uuid",
"description": "The id of the service principal object associated with the created identity."
},
"clientId": {
"type": "string",
"readOnly": true,
"format": "uuid",
"description": "The id of the app associated with the identity. This is a random generated UUID by MSI."
}
}
},
Expand Down Expand Up @@ -507,6 +641,15 @@
}
},
"parameters": {
"ScopeParameter": {
"name": "scope",
"in": "path",
"required": true,
"type": "string",
"description": "The resource provider scope of the resource. Parent resource being extended by Managed Identities.",
"x-ms-parameter-location": "method",
"x-ms-skip-url-encoding": true
},
"SubscriptionIdParameter": {
"name": "subscriptionId",
"in": "path",
Expand Down
Loading

0 comments on commit 239fc7b

Please sign in to comment.