Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
91 changes: 91 additions & 0 deletions specification/datafactory/resource-manager/readme.cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
## CLI

These settings apply only when `--cli` is specified on the command line.

``` yaml $(cli)
cli:
namespace: azure.mgmt.datafactory
flatten-all: true
test-scenario:
- name: Factories_CreateOrUpdate
#- name: Datasets_Create
#- name: Datasets_Update
#- name: Triggers_Update
#- name: Triggers_Create
#- name: DataFlows_Update
#- name: Pipelines_Create
#- name: DataFlows_Create
#- name: Pipelines_Update
#- name: LinkedServices_Create
#- name: LinkedServices_Update
#- name: IntegrationRuntimes_Create
#- name: RerunTriggers_Create
#- name: IntegrationRuntimeNodes_Get
#- name: IntegrationRuntimes_Get
#- name: RerunTriggers_ListByTrigger
#- name: LinkedServices_Get
#- name: PipelineRuns_Get
#- name: Pipelines_Get
#- name: DataFlows_Get
#- name: Datasets_Get
#- name: Triggers_Get
#- name: IntegrationRuntimes_ListByFactory
#- name: LinkedServices_ListByFactory
#- name: DataFlows_ListByFactory
#- name: Pipelines_ListByFactory
#- name: Triggers_ListByFactory
#- name: Datasets_ListByFactory
#- name: Factories_Get
#- name: Factories_ListByResourceGroup
#- name: Factories_List
#- name: Operations_List
#- name: IntegrationRuntimeNodes_GetIpAddress
#- name: IntegrationRuntimes_CreateLinkedIntegrationRuntime
#- name: RerunTriggers_Cancel
#- name: RerunTriggers_Start
#- name: IntegrationRuntimeNodes_Update
#- name: IntegrationRuntimeObjectMetadata_Refresh
#- name: RerunTriggers_Stop
#- name: IntegrationRuntimes_RegenerateAuthKey
#- name: Triggers_Rerun
#- name: IntegrationRuntimeObjectMetadata_Get
#- name: IntegrationRuntimes_GetConnectionInfo
#- name: IntegrationRuntimes_SyncCredentials
#- name: IntegrationRuntimes_GetMonitoringData
#- name: IntegrationRuntimes_ListAuthKeys
#- name: IntegrationRuntimes_Upgrade
#- name: IntegrationRuntimes_GetStatus
#- name: IntegrationRuntimes_Upgrade
#- name: IntegrationRuntimes_Start
#- name: IntegrationRuntimes_Stop
#- name: Triggers_GetEventSubscriptionStatus
#- name: ActivityRuns_QueryByPipelineRun
#- name: IntegrationRuntimes_Update
#- name: Triggers_UnsubscribeFromEvents
#- name: Triggers_SubscribeToEvents
#- name: PipelineRuns_Cancel
#- name: Pipelines_CreateRun
#- name: Triggers_Start
#- name: Triggers_Stop
#- name: DataFlowDebugSession_ExecuteCommand
#- name: DataFlowDebugSession_Delete
#- name: DataFlowDebugSession_Create
#- name: DataFlowDebugSession_QueryByFactory
#- name: DataFlowDebugSession_AddDataFlow
#- name: Factories_GetGitHubAccessToken
#- name: Factories_GetDataPlaneAccess
#- name: PipelineRuns_QueryByFactory
#- name: TriggerRuns_QueryByFactory
#- name: ExposureControl_GetFeatureValueByFactory
#- name: Factories_Update
#- name: Factories_ConfigureFactoryRepo
#- name: ExposureControl_GetFeatureValue
#- name: IntegrationRuntimesNodes_Delete
#- name: IntegrationRuntimes_Delete
#- name: LinkedServices_Delete
#- name: Pipelines_Delete
#- name: DataFlows_Delete
#- name: Datasets_Delete
#- name: Triggers_Delete
#- name: Factories_Delete
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
interactions:
- request:
body: '{"location": "westus", "tags": {"a": "b", "c": ""}}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
CommandName:
- group create
Connection:
- keep-alive
Content-Length:
- '51'
Content-Type:
- application/json; charset=utf-8
ParameterSetName:
- -n -l --tag
User-Agent:
- python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10
msrest_azure/0.6.2 azure-mgmt-resource/4.0.0 Azure-SDK-For-Python AZURECLI/2.0.77
accept-language:
- en-US
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_rg_scenario000001?api-version=2019-07-01
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_rg_scenario000001","name":"cli_test_rg_scenario000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"a":"b","c":""},"properties":{"provisioningState":"Succeeded"}}'
headers:
cache-control:
- no-cache
content-length:
- '371'
content-type:
- application/json; charset=utf-8
date:
- Mon, 16 Dec 2019 02:59:21 GMT
expires:
- '-1'
pragma:
- no-cache
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-subscription-writes:
- '1196'
status:
code: 200
message: OK
- request:
body: '{ "location": "East US"}'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
CommandName:
- rest
Connection:
- keep-alive
Content-Length:
- '25'
Content-Type:
- application/json
ParameterSetName:
- --method --uri --body
User-Agent:
- AZURECLI/2.0.77
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_rg_scenario000001/providers/Microsoft.DataFactory/factories/MyDataFactory23fac?api-version=2018-06-01
response:
body:
string: '{"name":"MyDataFactory23fac","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_rg_scenario000001/providers/Microsoft.DataFactory/factories/mydatafactory23fac","type":"Microsoft.DataFactory/factories","properties":{"provisioningState":"Succeeded","createTime":"2019-12-16T02:59:29.2943678Z","version":"2018-06-01"},"eTag":"\"9400371f-0000-0100-0000-5df6f3110000\"","location":"East
US","tags":{}}'
headers:
cache-control:
- no-cache
content-length:
- '476'
content-type:
- application/json; charset=utf-8
date:
- Mon, 16 Dec 2019 02:59:30 GMT
expires:
- '-1'
pragma:
- no-cache
server:
- Microsoft-IIS/10.0
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-subscription-writes:
- '1198'
x-powered-by:
- ASP.NET
status:
code: 200
message: OK
version: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

import json
import os
import time
import mock

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.

Sorry. We should remove these files.

import unittest

from azure_devtools.scenario_tests.const import MOCKED_SUBSCRIPTION_ID
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk import ScenarioTest, LiveScenarioTest, ResourceGroupPreparer, create_random_name, live_only, record_only
from azure.cli.core.util import get_file_json


class DatafactoryScenarioTest(ScenarioTest):

@ResourceGroupPreparer(name_prefix='cli_test_rg_scenario')
def test_datafactory(self, resource_group):

self.cmd('group create -n {rg} -l westus --tag a=b c', checks=[
self.check('name', '{rg}'),
self.check('tags', {'a': 'b', 'c': ''})
])

self.kwargs['sub'] = self.get_subscription_id()
self.kwargs['FACTORY_NAME'] = 'MyDataFactory23fac'

# Factories_CreateOrUpdate
body = (
'{'
' "location": "East US"'
'}')
self.kwargs['body'] = body.replace('"', '\\"')
self.cmd('rest '
'--method put '
'--uri /subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.DataFactory/factories/{FACTORY_NAME}?api-version=2018-06-01 '
'--body "{body}"'
, checks=[
])