Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
fix the scenarios test (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaozha authored May 20, 2020
1 parent 412fe4a commit 064dfd4
Show file tree
Hide file tree
Showing 14 changed files with 619 additions and 257 deletions.
101 changes: 81 additions & 20 deletions src/test/scenarios/datafactory/input/datafactory.json
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@
"200": {
"description": "OK.",
"schema": {
"$ref": "./definitions/IntegrationRuntimeConnectionInfo"
"$ref": "#/definitions/IntegrationRuntimeConnectionInfo"
}
},
"default": {
Expand Down Expand Up @@ -1325,15 +1325,15 @@
"in": "body",
"required": true,
"schema": {
"$ref": "./definitions/IntegrationRuntimeRegenerateKeyParameters"
"$ref": "#/definitions/IntegrationRuntimeRegenerateKeyParameters"
}
}
],
"responses": {
"200": {
"description": "OK.",
"schema": {
"$ref": "./definitions/IntegrationRuntimeAuthKeys"
"$ref": "#/definitions/IntegrationRuntimeAuthKeys"
}
},
"default": {
Expand Down Expand Up @@ -1378,7 +1378,7 @@
"200": {
"description": "OK.",
"schema": {
"$ref": "./definitions/IntegrationRuntimeAuthKeys"
"$ref": "#/definitions/IntegrationRuntimeAuthKeys"
}
},
"default": {
Expand Down Expand Up @@ -1560,7 +1560,7 @@
"200": {
"description": "OK.",
"schema": {
"$ref": "./definitions/IntegrationRuntimeMonitoringData"
"$ref": "#/definitions/IntegrationRuntimeMonitoringData"
}
},
"default": {
Expand Down Expand Up @@ -2220,7 +2220,7 @@
],
"properties": {
"properties": {
"$ref": "./definitions/Trigger",
"$ref": "#/definitions/Trigger",
"description": "Properties of the trigger."
}
},
Expand Down Expand Up @@ -2300,12 +2300,49 @@
"pipelines": {
"type": "array",
"items": {
"$ref": "./definitions/TriggerPipelineReference"
"$ref": "#/definitions/TriggerPipelineReference"
},
"description": "Pipelines that need to be started."
}
}
},
"TriggerPipelineReference": {
"description": "Pipeline that needs to be triggered with the given parameters.",
"properties": {
"pipelineReference": {
"description": "Pipeline reference.",
"$ref": "#/definitions/PipelineReference"
},
"parameters": {
"description": "Pipeline parameters.",
"$ref": "#/definitions/ParameterValueSpecification"
}
}
},
"PipelineReference": {
"description": "Pipeline reference type.",
"properties": {
"type": {
"type": "string",
"description": "Pipeline reference type.",
"enum": [
"PipelineReference"
]
},
"referenceName": {
"type": "string",
"description": "Reference pipeline name."
},
"name": {
"type": "string",
"description": "Reference name."
}
},
"required": [
"type",
"referenceName"
]
},
"ScheduleTrigger": {
"description": "Trigger that creates pipeline runs periodically, on schedule.",
"type": "object",
Expand Down Expand Up @@ -2504,7 +2541,7 @@
},
"linkedService": {
"description": "The Azure Storage linked service reference.",
"$ref": "./definitions/LinkedServiceReference"
"$ref": "#/definitions/LinkedServiceReference"
}
},
"required": [
Expand All @@ -2518,6 +2555,30 @@
"typeProperties"
]
},
"LinkedServiceReference": {
"description": "Linked service reference type.",
"properties": {
"type": {
"type": "string",
"description": "Linked service reference type.",
"enum": [
"LinkedServiceReference"
]
},
"referenceName": {
"type": "string",
"description": "Reference LinkedService name."
},
"parameters": {
"$ref": "#/definitions/ParameterValueSpecification",
"description": "Arguments for LinkedService."
}
},
"required": [
"type",
"referenceName"
]
},
"BlobEventsTrigger": {
"description": "Trigger that runs every time a Blob event occurs.",
"type": "object",
Expand Down Expand Up @@ -2587,7 +2648,7 @@
],
"properties": {
"pipeline": {
"$ref": "./definitions/TriggerPipelineReference",
"$ref": "#/definitions/TriggerPipelineReference",
"description": "Pipeline for which runs are created when an event is fired for trigger window that is ready."
},
"typeProperties": {
Expand Down Expand Up @@ -2837,7 +2898,7 @@
],
"properties": {
"pipeline": {
"$ref": "./definitions/TriggerPipelineReference",
"$ref": "#/definitions/TriggerPipelineReference",
"description": "Pipeline for which runs are created when all upstream pipelines complete successfully."
},
"typeProperties": {
Expand All @@ -2847,7 +2908,7 @@
"dependsOn": {
"type": "array",
"items": {
"$ref": "./definitions/PipelineReference"
"$ref": "#/definitions/PipelineReference"
},
"description": "Upstream Pipelines."
},
Expand Down Expand Up @@ -2902,7 +2963,7 @@
"description": "Reference integration runtime name."
},
"parameters": {
"$ref": "./definitions/ParameterValueSpecification",
"$ref": "#/definitions/ParameterValueSpecification",
"description": "Arguments for integration runtime."
}
},
Expand All @@ -2927,7 +2988,7 @@
],
"properties": {
"properties": {
"$ref": "./definitions/IntegrationRuntime",
"$ref": "#/definitions/IntegrationRuntime",
"description": "Integration runtime properties."
}
},
Expand All @@ -2944,7 +3005,7 @@
"readOnly": true
},
"properties": {
"$ref": "./definitions/IntegrationRuntimeStatus",
"$ref": "#/definitions/IntegrationRuntimeStatus",
"description": "Integration runtime properties."
}
},
Expand Down Expand Up @@ -2978,7 +3039,7 @@
"properties": {
"autoUpdate": {
"description": "Enables or disables the auto-update feature of the self-hosted integration runtime. See https://go.microsoft.com/fwlink/?linkid=854189.",
"$ref": "./definitions/IntegrationRuntimeAutoUpdate"
"$ref": "#/definitions/IntegrationRuntimeAutoUpdate"
},
"updateDelayOffset": {
"description": "The time offset (in hours) in the day, e.g., PT03H is 3 hours. The integration runtime auto update will happen on that time.",
Expand Down Expand Up @@ -3257,7 +3318,7 @@
},
"catalogAdminPassword": {
"description": "The password of the administrator user account of the catalog database.",
"$ref": "./definitions/SecureString"
"$ref": "#/definitions/SecureString"
},
"catalogPricingTier": {
"description": "The pricing tier for the catalog database. The valid values could be found in https://azure.microsoft.com/en-us/pricing/details/sql-database/",
Expand Down Expand Up @@ -3288,7 +3349,7 @@
},
"sasToken": {
"description": "The SAS token of the Azure blob container.",
"$ref": "./definitions/SecureString"
"$ref": "#/definitions/SecureString"
}
}
},
Expand Down Expand Up @@ -3375,7 +3436,7 @@
},
"password": {
"description": "The password of data source access.",
"$ref": "./definitions/SecretBase"
"$ref": "#/definitions/SecretBase"
}
},
"required": [
Expand Down Expand Up @@ -3450,7 +3511,7 @@
},
"licenseKey": {
"description": "The license key to activate the component.",
"$ref": "./definitions/SecretBase"
"$ref": "#/definitions/SecretBase"
}
},
"required": [
Expand Down Expand Up @@ -3531,7 +3592,7 @@
"properties": {
"key": {
"description": "The key used for authorization.",
"$ref": "./definitions/SecureString"
"$ref": "#/definitions/SecureString"
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,17 +333,6 @@
ntime" --resource-group "exampleResourceGroup"
"""

helps['datafactory integration-runtime create'] = """
type: command
short-summary: Creates or updates an integration runtime.
examples:
- name: IntegrationRuntimes_Create
text: |-
az datafactory integration-runtime create --factory-name "exampleFactoryName" --properties "{\\"type\\":\
\\"SelfHosted\\",\\"description\\":\\"A selfhosted integration runtime\\"}" --name "exampleIntegrationRuntime" --resour\
ce-group "exampleResourceGroup"
"""

helps['datafactory integration-runtime linked-integration-runtime'] = """
type: group
short-summary: datafactory integration-runtime sub group linked-integration-runtime
Expand All @@ -361,6 +350,36 @@
ationRuntime" --resource-group "exampleResourceGroup" --subscription-id "12345678-1234-1234-1234-12345678abc"
"""

helps['datafactory integration-runtime managed'] = """
type: group
short-summary: datafactory integration-runtime sub group managed
"""

helps['datafactory integration-runtime managed create'] = """
type: command
short-summary: Creates or updates an integration runtime.
examples:
- name: IntegrationRuntimes_Create
text: |-
az datafactory integration-runtime managed create --factory-name "exampleFactoryName" --description "A s\
elfhosted integration runtime" --name "exampleIntegrationRuntime" --resource-group "exampleResourceGroup"
"""

helps['datafactory integration-runtime self-hosted'] = """
type: group
short-summary: datafactory integration-runtime sub group self-hosted
"""

helps['datafactory integration-runtime self-hosted create'] = """
type: command
short-summary: Creates or updates an integration runtime.
examples:
- name: IntegrationRuntimes_Create
text: |-
az datafactory integration-runtime self-hosted create --factory-name "exampleFactoryName" --description \
"A selfhosted integration runtime" --name "exampleIntegrationRuntime" --resource-group "exampleResourceGroup"
"""

helps['datafactory integration-runtime update'] = """
type: command
short-summary: Updates an integration runtime.
Expand Down Expand Up @@ -430,8 +449,7 @@
- name: IntegrationRuntimes_RegenerateAuthKey
text: |-
az datafactory integration-runtime regenerate-auth-key --factory-name "exampleFactoryName" --name "examp\
leIntegrationRuntime" --regenerate-key-parameters "{\\"keyName\\":\\"authKey2\\"}" --resource-group "exampleResourceGro\
up"
leIntegrationRuntime" --key-name "authKey2" --resource-group "exampleResourceGroup"
"""

helps['datafactory integration-runtime remove-link'] = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from knack.arguments import CLIArgumentType
from azure.cli.core.commands.parameters import (
tags_type,
get_enum_type,
resource_group_name_type,
get_location_type
)
Expand Down Expand Up @@ -173,15 +174,6 @@ def load_arguments(self, _):
c.argument('if_none_match', help='ETag of the integration runtime entity. Should only be specified for get. If '
'the ETag matches the existing entity tag, or if * was provided, then no content will be returned.')

with self.argument_context('datafactory integration-runtime create') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('factory_name', help='The factory name.')
c.argument('integration_runtime_name', options_list=['--name', '-n'], help='The integration runtime name.')
c.argument('if_match', help='ETag of the integration runtime entity. Should only be specified for update, for w'
'hich it should match existing entity or can be * for unconditional update.')
c.argument('properties', arg_type=CLIArgumentType(options_list=['--properties'], help='Integration runtime prop'
'erties. Expected value: json-string/@json-file.'))

with self.argument_context('datafactory integration-runtime linked-integration-runtime create') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('factory_name', help='The factory name.')
Expand All @@ -194,14 +186,38 @@ def load_arguments(self, _):
c.argument('data_factory_location', help='The location of the data factory that the linked integration runtime '
'belongs to.')

with self.argument_context('datafactory integration-runtime managed create') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('factory_name', help='The factory name.')
c.argument('integration_runtime_name', options_list=['--name', '-n'], help='The integration runtime name.')
c.argument('if_match', help='ETag of the integration runtime entity. Should only be specified for update, for w'
'hich it should match existing entity or can be * for unconditional update.')
c.argument('description', help='Integration runtime description.')
c.argument('type_properties_compute_properties', arg_type=CLIArgumentType(options_list=['--type-properties-comp'
'ute-properties'], help='The compute resource for managed integration runtime. Expected value: json-'
'string/@json-file.'))
c.argument('type_properties_ssis_properties', arg_type=CLIArgumentType(options_list=['--type-properties-ssis-pr'
'operties'], help='SSIS properties for managed integration runtime. Expected value: json-string/@jso'
'n-file.'))

with self.argument_context('datafactory integration-runtime self-hosted create') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('factory_name', help='The factory name.')
c.argument('integration_runtime_name', options_list=['--name', '-n'], help='The integration runtime name.')
c.argument('if_match', help='ETag of the integration runtime entity. Should only be specified for update, for w'
'hich it should match existing entity or can be * for unconditional update.')
c.argument('description', help='Integration runtime description.')
c.argument('type_properties_linked_info', arg_type=CLIArgumentType(options_list=['--type-properties-linked-info'
''], help='The base definition of a linked integration runtime. Expected value: json-string/@json-fi'
'le.'))

with self.argument_context('datafactory integration-runtime update') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('factory_name', help='The factory name.', id_part='name')
c.argument('integration_runtime_name', options_list=['--name', '-n'], help='The integration runtime name.',
id_part='child_name_1')
c.argument('auto_update', arg_type=CLIArgumentType(options_list=['--auto-update'], help='Enables or disables th'
'e auto-update feature of the self-hosted integration runtime. See https://go.microsoft.com/fwlink/?'
'linkid=854189. Expected value: json-string/@json-file.'))
c.argument('auto_update', arg_type=get_enum_type(['On', 'Off']), help='Enables or disables the auto-update feat'
'ure of the self-hosted integration runtime. See https://go.microsoft.com/fwlink/?linkid=854189.')
c.argument('update_delay_offset', help='The time offset (in hours) in the day, e.g., PT03H is 3 hours. The inte'
'gration runtime auto update will happen on that time.')

Expand Down Expand Up @@ -239,9 +255,8 @@ def load_arguments(self, _):
c.argument('factory_name', help='The factory name.', id_part='name')
c.argument('integration_runtime_name', options_list=['--name', '-n'], help='The integration runtime name.',
id_part='child_name_1')
c.argument('regenerate_key_parameters', arg_type=CLIArgumentType(options_list=['--regenerate-key-parameters'],
help='The parameters for regenerating integration runtime authentication key. Expected value: json-s'
'tring/@json-file.'))
c.argument('key_name', arg_type=get_enum_type(['authKey1', 'authKey2']), help='The name of the authentication k'
'ey to regenerate.')

with self.argument_context('datafactory integration-runtime remove-link') as c:
c.argument('resource_group_name', resource_group_name_type)
Expand Down
Loading

0 comments on commit 064dfd4

Please sign in to comment.