Skip to content

Commit

Permalink
add Azure Container Registry policies api and update OperationDefinition
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurkhemani committed May 23, 2018
1 parent e6d4651 commit 56239b4
Show file tree
Hide file tree
Showing 3 changed files with 266 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,91 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies": {
"get": {
"tags": [
"Registries"
],
"description": "Lists the policies for the specified container registry.",
"operationId": "Registries_ListPolicies",
"parameters": [
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/RegistryNameParameter"
}
],
"responses": {
"200": {
"description": "The request was successful; the registry policies were retrieved and returned successfully.",
"schema": {
"$ref": "#/definitions/RegistryPolicies"
}
}
},
"x-ms-examples": {
"RegistryListPolicies": {
"$ref": "./examples/RegistryListPolicies.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies": {
"post": {
"tags": [
"Registries"
],
"description": "Updates the policies for the specified container registry.",
"operationId": "Registries_UpdatePolicies",
"parameters": [
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/RegistryNameParameter"
},
{
"name": "registryPoliciesUpdateParameters",
"in": "body",
"description": "The parameters for updating policies of a container registry.",
"required": true,
"schema": {
"$ref": "#/definitions/RegistryPolicies"
}
}
],
"responses": {
"200": {
"description": "The request was successful; the request was well-formed and received properly.",
"schema": {
"$ref": "#/definitions/RegistryPolicies"
}
},
"202": {
"description": "The request was successful; the operation will complete asynchronously."
}
},
"x-ms-examples": {
"RegistryUpdatePolicies": {
"$ref": "./examples/RegistryUpdatePolicies.json"
}
},
"x-ms-long-running-operation": true
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}": {
"get": {
"tags": [
Expand Down Expand Up @@ -1186,13 +1271,22 @@
"description": "The definition of a container registry operation.",
"type": "object",
"properties": {
"origin": {
"description": "The origin information of the container registry operation.",
"type": "string"
},
"name": {
"description": "Operation name: {provider}/{resource}/{operation}.",
"type": "string"
},
"display": {
"$ref": "#/definitions/OperationDisplayDefinition",
"description": "The display information for the container registry operation."
},
"properties": {
"$ref": "#/definitions/OperationPropertiesDefinition",
"description": "The properties information for the container registry operation.",
"x-ms-client-flatten": true
}
}
},
Expand All @@ -1218,6 +1312,59 @@
}
}
},
"OperationPropertiesDefinition": {
"description": "The definition of Azure Monitoring properties.",
"type": "object",
"properties": {
"serviceSpecification": {
"$ref": "#/definitions/OperationServiceSpecificationDefinition",
"description": "The definition of Azure Monitoring service."
}
}
},
"OperationServiceSpecificationDefinition": {
"description": "The definition of Azure Monitoring metrics list.",
"type": "object",
"properties": {
"metricSpecifications": {
"description": "A list of Azure Monitoring metrics definition.",
"type": "array",
"items": {
"$ref": "#/definitions/OperationMetricSpecificationDefinition"
}
}
}
},
"OperationMetricSpecificationDefinition": {
"description": "The definition of Azure Monitoring metric.",
"type": "object",
"properties": {
"name": {
"description": "Metric name.",
"type": "string"
},
"displayName": {
"description": "Metric display name.",
"type": "string"
},
"displayDescription": {
"description": "Metric description.",
"type": "string"
},
"unit": {
"description": "Metric unit.",
"type": "string"
},
"aggregationType": {
"description": "Metric aggregation type.",
"type": "string"
},
"internalMetricName": {
"description": "Internal metric name.",
"type": "string"
}
}
},
"Registry": {
"description": "An object that represents a container registry.",
"required": [
Expand Down Expand Up @@ -1520,6 +1667,67 @@
}
}
},
"RegistryPolicies": {
"description": "An object that represents policies for a container registry.",
"type": "object",
"properties": {
"quarantinePolicy": {
"$ref": "#/definitions/QuarantinePolicy",
"description": "An object that represents quarantine policy for a container registry."
},
"trustPolicy": {
"$ref": "#/definitions/TrustPolicy",
"description": "An object that represents content trust policy for a container registry."
}
}
},
"QuarantinePolicy": {
"description": "An object that represents quarantine policy for a container registry.",
"type": "object",
"properties": {
"status": {
"description": "The value that indicates whether the policy is enabled or not.",
"enum": [
"enabled",
"disabled"
],
"type": "string",
"x-ms-enum": {
"name": "PolicyStatus",
"modelAsString": true
}
}
}
},
"TrustPolicy": {
"description": "An object that represents content trust policy for a container registry.",
"type": "object",
"properties": {
"type": {
"description": "The type of trust policy.",
"enum": [
"Notary"
],
"type": "string",
"x-ms-enum": {
"name": "TrustPolicyType",
"modelAsString": true
}
},
"status": {
"description": "The value that indicates whether the policy is enabled or not.",
"enum": [
"enabled",
"disabled"
],
"type": "string",
"x-ms-enum": {
"name": "PolicyStatus",
"modelAsString": true
}
}
}
},
"Replication": {
"description": "An object that represents a replication for a container registry.",
"type": "object",
Expand Down Expand Up @@ -1639,7 +1847,8 @@
"items": {
"enum": [
"push",
"delete"
"delete",
"quarantine"
],
"type": "string",
"x-ms-enum": {
Expand Down Expand Up @@ -1733,7 +1942,8 @@
"items": {
"enum": [
"push",
"delete"
"delete",
"quarantine"
],
"type": "string",
"x-ms-enum": {
Expand Down Expand Up @@ -1799,7 +2009,8 @@
"items": {
"enum": [
"push",
"delete"
"delete",
"quarantine"
],
"type": "string",
"x-ms-enum": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"parameters": {
"api-version": "2017-10-01",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "myResourceGroup",
"registryName": "myRegistry"
},
"responses": {
"200": {
"body": {
"quarantinePolicy": {
"status": "enabled"
},
"trustPolicy": {
"status": "enabled",
"type": "Notary"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"parameters": {
"api-version": "2017-10-01",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "myResourceGroup",
"registryName": "myRegistry",
"registryPoliciesUpdateParameters": {
"quarantinePolicy": {
"status": "disabled"
},
"trustPolicy": {
"status": "enabled",
"type": "Notary"
}
}
},
"responses": {
"200": {
"body": {
"quarantinePolicy": {
"status": "disabled"
},
"trustPolicy": {
"status": "enabled",
"type": "Notary"
}
}
},
"202": {}
}
}

0 comments on commit 56239b4

Please sign in to comment.