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

Update swagger to add target and credentials flag to the requests, and add examples. #5047

Merged
merged 13 commits into from
Jan 17, 2019
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -530,12 +530,12 @@
"200": {
"description": "The request was successful; the request was well-formed and received properly."
},
"202": {
"description": "The request was successfully accepted; the operation will complete asynchronously."
},
"204": {
"description": "No Content - the specified resource was not found."
},
"202": {
shahzzzam marked this conversation as resolved.
Show resolved Hide resolved
"description": "The request was successfully accepted; the operation will complete asynchronously."
},
"default": {
"description": "Error response describing why the operation failed."
}
Expand Down Expand Up @@ -760,11 +760,6 @@
"$ref": "#/definitions/SourceTriggerDescriptor",
"description": "The source trigger that caused the run."
},
"isArchiveEnabled": {
"description": "The value that indicates whether archiving is enabled or not.",
"default": false,
"type": "boolean"
},
"platform": {
"$ref": "#/definitions/PlatformProperties",
"description": "The platform properties against which the run will happen."
Expand All @@ -773,6 +768,17 @@
"$ref": "#/definitions/AgentProperties",
"description": "The machine configuration of the run agent."
},
"sourceRegistryAuth": {
"description": "The scope of the credentials that were used to login to the source registry during this run.",
"type": "string"
},
"customRegistries": {
"description": "The list of custom registries that were logged in during this run.",
"type": "array",
"items": {
"type": "string"
}
},
"provisioningState": {
"description": "The provisioning state of a run.",
"enum": [
Expand All @@ -788,6 +794,11 @@
"name": "ProvisioningState",
"modelAsString": true
}
},
"isArchiveEnabled": {
shahzzzam marked this conversation as resolved.
Show resolved Hide resolved
"description": "The value that indicates whether archiving is enabled or not.",
"default": false,
"type": "boolean"
}
}
},
Expand Down Expand Up @@ -1060,7 +1071,7 @@
}
},
"Task": {
"description": "The task that has the ARM resource and task properties. \r\nThe task will have all information to schedule a run against it.",
"description": "The task that has the ARM resource and task properties. \r\nThe task will have all information to schedule a run against it.",
shahzzzam marked this conversation as resolved.
Show resolved Hide resolved
"type": "object",
"allOf": [
{
Expand Down Expand Up @@ -1141,6 +1152,10 @@
"trigger": {
"$ref": "#/definitions/TriggerProperties",
"description": "The properties that describe all triggers for the task."
},
"credentials": {
"$ref": "#/definitions/Credentials",
"description": "The properties that describes a set of credentials that will be used when this run is invoked."
}
}
},
Expand Down Expand Up @@ -1198,6 +1213,23 @@
}
}
},
"Credentials": {
"description": "The parameters that describes a set of credentials that will be used when a run is invoked.",
"type": "object",
"properties": {
"sourceRegistry": {
"$ref": "#/definitions/SourceRegistryCredentials",
"description": "Describes the credential parameters for accessing the source registry."
},
"customRegistries": {
"description": "Describes the credential parameters for accessing other custom registries. The key\r\nfor the dictionary item will be the registry login server (myregistry.azurecr.io) and\r\nthe value of the item will be the registry credentials for accessing the registry.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/CustomRegistryCredentials"
}
}
}
},
"BaseImageDependency": {
"description": "Properties that describe a base image dependency.",
"type": "object",
Expand Down Expand Up @@ -1316,6 +1348,38 @@
}
}
},
"SourceRegistryCredentials": {
"description": "Describes the credential parameters for accessing the source registry.",
"type": "object",
"properties": {
"loginMode": {
"description": "The authentication mode which determines the source registry login scope. The credentials for the source registry\r\nwill be generated using the given scope. These credentials will be used to login to\r\nthe source registry during the run.",
"enum": [
"None",
"Default"
],
"type": "string",
"x-ms-enum": {
"name": "SourceRegistryLoginMode",
"modelAsString": true
}
}
}
},
"CustomRegistryCredentials": {
"description": "Describes the credentials that will be used to access a custom registry during a run.",
"type": "object",
"properties": {
"userName": {
"$ref": "#/definitions/SecretObject",
"description": "The username for logging into the custom registry."
},
"password": {
"$ref": "#/definitions/SecretObject",
"description": "The password for logging into the custom registry. The password is a secret \r\nobject that allows multiple ways of providing the value for it."
}
}
},
"SourceProperties": {
"description": "The properties of the source code repository.",
"required": [
Expand Down Expand Up @@ -1350,6 +1414,27 @@
}
}
},
"SecretObject": {
"description": "Describes the properties of a secret object value.",
"type": "object",
"properties": {
"value": {
"description": "The value of the secret. The format of this value will be determined\r\nbased on the type of the secret object. If the type is Opaque, the vaule will be\r\nused as is without any modification.",
shahzzzam marked this conversation as resolved.
Show resolved Hide resolved
"type": "string"
},
"type": {
"description": "The type of the secret object which determines how the value of the secret object has to be\r\ninterpreted.",
"enum": [
"Opaque"
],
"type": "string",
"x-ms-enum": {
"name": "SecretObjectType",
"modelAsString": true
}
}
}
},
"AuthInfo": {
"description": "The authorization properties for accessing the source code repository.",
"required": [
Expand Down Expand Up @@ -1443,6 +1528,10 @@
"trigger": {
"$ref": "#/definitions/TriggerUpdateParameters",
"description": "The properties for updating trigger properties."
},
"credentials": {
"$ref": "#/definitions/Credentials",
"description": "The parameters that describes a set of credentials that will be used when this run is invoked."
}
}
},
Expand Down Expand Up @@ -1777,6 +1866,10 @@
"description": "The Docker file path relative to the source location.",
"type": "string"
},
"target": {
"description": "Gets or sets the name of the target build stage for the docker build.",
shahzzzam marked this conversation as resolved.
Show resolved Hide resolved
"type": "string"
},
"arguments": {
"description": "The collection of override arguments to be used when executing the run.",
"type": "array",
Expand All @@ -1803,6 +1896,10 @@
"sourceLocation": {
"description": "The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository.\r\nIf it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API.",
"type": "string"
},
"credentials": {
"$ref": "#/definitions/Credentials",
"description": "The properties that describes a set of credentials that will be used when this run is invoked."
}
},
"x-ms-discriminator-value": "DockerBuildRequest"
Expand Down Expand Up @@ -1878,6 +1975,10 @@
"sourceLocation": {
"description": "The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository.\r\nIf it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API.",
"type": "string"
},
"credentials": {
"$ref": "#/definitions/Credentials",
"description": "The properties that describes a set of credentials that will be used when this run is invoked."
}
},
"x-ms-discriminator-value": "FileTaskRunRequest"
Expand Down Expand Up @@ -1980,6 +2081,10 @@
"sourceLocation": {
"description": "The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository.\r\nIf it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API.",
"type": "string"
},
"credentials": {
"$ref": "#/definitions/Credentials",
"description": "The properties that describes a set of credentials that will be used when this run is invoked."
}
},
"x-ms-discriminator-value": "EncodedTaskRunRequest"
Expand Down Expand Up @@ -2017,6 +2122,10 @@
"description": "The Docker file path relative to the source context.",
"type": "string"
},
"target": {
"description": "Gets or sets the name of the target build stage for the docker build.",
"type": "string"
},
"arguments": {
"description": "The collection of override arguments to be used when executing this build step.",
"type": "array",
Expand Down Expand Up @@ -2121,6 +2230,10 @@
"items": {
"$ref": "#/definitions/Argument"
}
},
"target": {
"description": "Gets or sets the name of the target build stage for the docker build.",
"type": "string"
}
},
"x-ms-discriminator-value": "Docker"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"parameters": {
"subscriptionId": "4385cf00-2d3a-425a-832f-f4285b1c9dce",
"resourceGroupName": "myResourceGroup",
"registryName": "myRegistry",
"api-version": "2018-09-01",
"runRequest": {
"type": "TaskRunRequest",
"values": [
{
"name": "mytestargument",
"value": "mytestvalue",
"isSecret": false
},
{
"name": "mysecrettestargument",
"value": "mysecrettestvalue",
"isSecret": true
}
],
"taskName": "myTask",
"credentials": {
"sourceRegistry": {
"loginMode": "Default"
},
"customRegistries": {
"myregistry.azurecr.io": {
"userName": {
"type": "Opaque",
"value": "reg1"
},
"password": {
"type": "Opaque",
"value": "***"
}
}
}
}
}
},
"responses": {
"200": {
"body": {
"properties": {
"provisioningState": "Succeeded",
"runId": "0accec26-d6de-4757-8e74-d080f38eaaab",
"status": "Succeeded",
"lastUpdatedTime": "2018-01-25T05:13:51.617Z"
},
"id": "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab",
"name": "0accec26-d6de-4757-8e74-d080f38eaaab",
"type": "Microsoft.ContainerRegistry/registries/run"
}
},
"202": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"parameters": {
"subscriptionId": "4385cf00-2d3a-425a-832f-f4285b1c9dce",
"resourceGroupName": "myResourceGroup",
"registryName": "myRegistry",
"api-version": "2018-09-01",
"runRequest": {
"type": "DockerBuildRequest",
"isArchiveEnabled": true,
"imageNames": [
"azurerest:testtag"
],
"noCache": true,
"sourceLocation": "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D",
"arguments": [
{
"name": "mytestargument",
"value": "mytestvalue",
"isSecret": false
},
{
"name": "mysecrettestargument",
"value": "mysecrettestvalue",
"isSecret": true
}
],
"isPushEnabled": true,
"platform": {
"os": "Linux",
"architecture": "amd64"
},
"agentConfiguration": {
"cpu": 2
},
"dockerFilePath": "DockerFile",
"target": "stage1",
"credentials": {
"sourceRegistry": {
"loginMode": "Default"
},
"customRegistries": {
"myregistry.azurecr.io": {
"userName": {
"Type": "Opaque",
"Value": "reg1"
},
"password": {
"Type": "Opaque",
"Value": "***"
}
},
"myregistry2.azurecr.io": {
"userName": {
"Type": "Opaque",
"Value": "reg2"
},
"password": {
"Type": "Opaque",
"Value": "***"
}
}
}
}
}
},
"responses": {
"200": {
"body": {
"properties": {
"provisioningState": "Succeeded",
"runId": "0accec26-d6de-4757-8e74-d080f38eaaab",
"status": "Succeeded",
"lastUpdatedTime": "2018-01-25T05:13:51.617Z"
},
"id": "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab",
"name": "0accec26-d6de-4757-8e74-d080f38eaaab",
"type": "Microsoft.ContainerRegistry/registries/run"
}
},
"202": {}
}
}