Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angos/msi extensionresource #7528

Merged
merged 25 commits into from
Feb 3, 2020
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,12 @@
"description": "The Managed Service Identity Client."
},
"host": "management.azure.com",
"schemes": [
"https"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"schemes": ["https"],
"produces": ["application/json"],
"consumes": ["application/json"],
"security": [
{
"azure_auth": [
"user_impersonation"
]
"azure_auth": ["user_impersonation"]
}
],
"securityDefinitions": {
Expand All @@ -34,6 +26,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 @@ -343,15 +368,14 @@
},
"properties": {
"x-ms-client-flatten": true,
"readOnly": true,
"description": "The properties associated with the identity.",
"$ref": "#/definitions/IdentityProperties"
},
"type": {
"type": "string",
"readOnly": true,
"enum": [
"Microsoft.ManagedIdentity/userAssignedIdentities"
],
"enum": ["Microsoft.ManagedIdentity/userAssignedIdentities"],
"x-ms-enum": {
"name": "UserAssignedIdentities",
"modelAsString": true
Expand All @@ -362,6 +386,45 @@
"x-ms-azure-resource": true,
"description": "Describes an identity resource."
},
"SystemAssignedIdentity": {
"properties": {
"id": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These common properties (id, name, type, location, tags) are a common definition. It's best to use in a shared definition or optimally, linked from:

"type": "string",
"readOnly": true,
"description": "The id of the created identity."
},
"name": {
"type": "string",
"readOnly": true,
"description": "The name of the created identity."
},
"location": {
"type": "string",
"description": "The Azure region where the identity lives."
},
"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/IdentityProperties"
},
"type": {
"type": "string",
"readOnly": true,

"description": "The type of resource i.e. Microsoft.Compute/virtualMachineScaleSets"
}
},
"x-ms-azure-resource": true,
"description": "Describes an identity resource."
},
"IdentityProperties": {
"description": "The properties associated with the identity.",
"type": "object",
Expand Down Expand Up @@ -507,6 +570,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,26 @@
{
"parameters": {
"api-version": "2015-08-31-preview",
"scope": "scope"
},
"responses": {
"200": {
"body": {
"id": "/scope/resourceName",
angosms marked this conversation as resolved.
Show resolved Hide resolved
"location": "cus",
"name": "resourceName",
"properties": {
"clientId": "clientGUID",
"clientSecretUrl": "https://serviceRoot/scope/resourceName/credentials?tid=tenantId&oid=principalId&aid=clientId",
angosms marked this conversation as resolved.
Show resolved Hide resolved
"principalId": "identityObjectID",
"tenantId": "tenantGUID"
},
"tags": {
"key1": "value1",
"key2": "value2"
},
"type": "ResourceProvider"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,12 @@
"description": "The Managed Service Identity Client."
},
"host": "management.azure.com",
"schemes": [
"https"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"schemes": ["https"],
"produces": ["application/json"],
"consumes": ["application/json"],
"security": [
{
"azure_auth": [
"user_impersonation"
]
"azure_auth": ["user_impersonation"]
}
],
"securityDefinitions": {
Expand All @@ -34,6 +26,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 @@ -343,15 +368,14 @@
},
"properties": {
"x-ms-client-flatten": true,
"readOnly": true,
"description": "The properties associated with the identity.",
"$ref": "#/definitions/IdentityProperties"
},
"type": {
"type": "string",
"readOnly": true,
"enum": [
"Microsoft.ManagedIdentity/userAssignedIdentities"
],
"enum": ["Microsoft.ManagedIdentity/userAssignedIdentities"],
"x-ms-enum": {
"name": "UserAssignedIdentities",
"modelAsString": true
Expand All @@ -362,10 +386,49 @@
"x-ms-azure-resource": true,
"description": "Describes an identity resource."
},
"IdentityProperties": {
"description": "The properties associated with the identity.",
"SystemAssignedIdentity": {
"properties": {
"id": {
"type": "string",
"readOnly": true,
"description": "The id of the created identity."
},
"name": {
"type": "string",
"readOnly": true,
"description": "The name of the created identity."
},
"location": {
"type": "string",
"description": "The Azure region where the identity lives."
},
"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/IdentityProperties"
},
"type": {
"type": "string",
"readOnly": true,

"description": "The type of resource i.e. Microsoft.Compute/virtualMachineScaleSets"
}
},
"x-ms-azure-resource": true,
"description": "Describes an 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 +451,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 +595,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,26 @@
{
"parameters": {
"api-version": "2018-11-30",
"scope": "scope"
},
"responses": {
"200": {
"body": {
"id": "/scope/resourceName",
angosms marked this conversation as resolved.
Show resolved Hide resolved
"location": "cus",
"name": "resourceName",
"properties": {
"clientId": "clientGUID",
"clientSecretUrl": "https://serviceRoot/scope/resourceName/credentials?tid=tenantId&oid=principalId&aid=clientId",
angosms marked this conversation as resolved.
Show resolved Hide resolved
"principalId": "identityObjectID",
"tenantId": "tenantGUID"
},
"tags": {
"key1": "value1",
"key2": "value2"
},
"type": "ResourceProvider"
}
}
}
}