Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -105,6 +105,54 @@
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.DataFactory/locations/{locationId}/configureFactoryRepo": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This path doesn't look valid.
should be like this:
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/configureFactoryRepo. And if you need locationId passed from client, pass it as a parameter in query string or in body.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As we talked offline about this, I'll explore other options, and ask feedback on this from the ARM tema.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I doubt I need to tell you, @ravbhatnagar, but make sure to take a look at this comment thread. :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just replied on email, IMO this should be modeled as an action on /factories/{factoryName} as mentioned by @hvermis

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, this returns a factory resource, Is it fine where someone who just has permission to this POST action can read the resource even though he may not have /read or /write permission. I am sure this API is not creating a factory resource. Is it changing the shape of the factory resource?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this changes some properties of the factory, to call this api you will need to have permissions for this post call and also write permissions to the factory

"post": {
"tags": [
"configureFactoryRepo"
],
"operationId": "Factories_ConfigureFactoryRepo",
"x-ms-examples": {
"Factories_ConfigureFactoryRepo": {
"$ref": "./examples/Factories_ConfigureFactoryRepo.json"
}
},
"description": "Updates a factory's repo information.",
"parameters": [
{
"$ref": "#/parameters/subscriptionId"
},
{
"$ref": "#/parameters/locationId"
},
{
"$ref": "#/parameters/api-version"
},
{
"name": "factoryRepoUpdate",
"description": "Update factory repo request definition.",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/FactoryRepoUpdate"
}
}
],
"responses": {
"200": {
"description": "OK.",
"schema": {
"$ref": "#/definitions/Factory"
}
},
"default": {
"description": "An error response received from the Azure Data Factory service.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories": {
"get": {
"tags": [
Expand Down Expand Up @@ -2854,6 +2902,56 @@
"type": "object"
}
},
"FactoryVSTSConfiguration": {
"description": "Factory's VSTS repo information.",
"properties": {
"accountName": {
"description": "VSTS account name.",
"type": "string"
},
"projectName": {
"description": "VSTS project name.",
"type": "string"
},
"repositoryName": {
"description": "VSTS repository name.",
"type": "string"
},
"collaborationBranch": {
"description": "VSTS collaboration branch.",
"type": "string"
},
"rootFolder": {
"description": "VSTS root folder.",
"type": "string"
},
"lastCommitId": {
"description": "VSTS last commit id.",
"type": "string"
},
"tenantId": {
"description": "VSTS tenant id.",
"type": "string"
}
}
},
"FactoryRepoUpdate": {
"description": "Factory's VSTS repo information.",
"properties": {
"factoryResourceId": {
"description": "The factory resource id.",
"type": "string"
},
"resourceGroupName": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Chatted offline with @frankycrm14 about this, it looks like the defintion I mentioned is in the parameters section. For that reason, the real fix would be to refactor most of this into the definitions section, and reference that from the parameter and anywhere else it's used. However, that would only buy us a little client-side validation, and wouldn't be a breaking change to fix in the future. For those reasons, I'm not going to block this PR on this kinda comment.

All that remains before I merge is ensuring that none of the linter errors being reported were introduced by this PR.

"description": "The resource group name.",
"type": "string"
},
"vstsConfiguration": {
"$ref": "#/definitions/FactoryVSTSConfiguration",
"description": "VSTS repo information of the factory."
}
}
},
"FactoryProperties": {
"description": "Factory resource properties.",
"properties": {
Expand All @@ -2872,6 +2970,10 @@
"description": "Version of the factory.",
"type": "string",
"readOnly": true
},
"vstsConfiguration": {
"$ref": "#/definitions/FactoryVSTSConfiguration",
"description": "VSTS repo information of the factory."
}
}
},
Expand Down Expand Up @@ -3698,6 +3800,14 @@
"maxLength": 63,
"x-ms-parameter-location": "method"
},
"locationId": {
"name": "locationId",
"description": "The location identifier.",
"in": "path",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"linkedServiceName": {
"name": "linkedServiceName",
"description": "The linked service name.",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"parameters": {
"subscriptionId": "12345678-1234-1234-12345678abc",
"locationId": "eastus",
"factoryRepoUpdate": {
"resourceGroupName": "exampleResourceGroup",
"factoryId": "/subscriptions/12345678-1234-1234-12345678abc/resourceGroups/exampleresourcegroup/providers/Microsoft.DataFactory/factories/examplefactoryname",
"vstsConfiguration": {
"accountName": "msdata",
"projectName": "datafactory",
"repositoryName": "exampleRepo",
"collaborationBranch": "master",
"rootFolder": "/",
"lastCommitId": "",
"tenantId": "12f988bf-86d1-41af-91ab-2d7cd011db49"
}
},
"api-version": "2017-09-01-preview"
},
"responses": {
"200": {
"headers": {
"Date": "Wed, 13 Sep 2017 17:33:54 GMT",
"x-ms-request-id": "dc1954ed-a1d3-4437-bd73-480ffdf1ea5a",
"X-Content-Type-Options": "nosniff",
"x-ms-ratelimit-remaining-subscription-writes": "1198",
"x-ms-correlation-request-id": "8d66d31c-23f3-4ac1-bc8c-1b6464342ad1"
},
"body": {
"name": "exampleFactoryName",
"tags": {},
"properties": {
"provisioningState": "Succeeded",
"createTime": "2017-09-13T17:33:54.0294655Z",
"version": "2017-09-01-preview",
"vstsConfiguration": {
"accountName": "msdata",
"projectName": "datafactory",
"repositoryName": "exampleRepo",
"collaborationBranch": "master",
"rootFolder": "/",
"lastCommitId": "",
"tenantId": "12f988bf-86d1-41af-91ab-2d7cd011db49"
}
},
"id": "/subscriptions/12345678-1234-1234-12345678abc/resourceGroups/exampleresourcegroup/providers/Microsoft.DataFactory/factories/examplefactoryname",
"type": "Microsoft.DataFactory/factories",
"location": "East US"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@
"resourceGroupName": "exampleResourceGroup",
"factoryName": "exampleFactoryName",
"factory": {
"location": "East US"
"location": "East US",
"properties": {
"vstsConfiguration": {
"accountName": "msdata",
"projectName": "datafactory",
"repositoryName": "exampleRepo",
"collaborationBranch": "master",
"rootFolder": "/",
"lastCommitId": "",
"tenantId": "12f988bf-86d1-41af-91ab-2d7cd011db49"
}
}
},
"api-version": "2017-09-01-preview"
},
Expand All @@ -23,7 +34,16 @@
"properties": {
"provisioningState": "Succeeded",
"createTime": "2017-09-13T17:33:54.0294655Z",
"version": "2017-09-01-preview"
"version": "2017-09-01-preview",
"vstsConfiguration": {
"accountName": "msdata",
"projectName": "datafactory",
"repositoryName": "exampleRepo",
"collaborationBranch": "master",
"rootFolder": "/",
"lastCommitId": "",
"tenantId": "12f988bf-86d1-41af-91ab-2d7cd011db49"
}
},
"id": "/subscriptions/12345678-1234-1234-12345678abc/resourceGroups/exampleresourcegroup/providers/Microsoft.DataFactory/factories/examplefactoryname",
"type": "Microsoft.DataFactory/factories",
Expand Down