From 6827793b49e0ada51a1e6d6394878a2a25aea280 Mon Sep 17 00:00:00 2001 From: Jiashuo Li Date: Wed, 29 Apr 2020 21:27:17 +0800 Subject: [PATCH] [Breadth Coverage] Time Series Insights (#1539) --- .github/CODEOWNERS | 2 + src/timeseriesinsights/HISTORY.rst | 8 + src/timeseriesinsights/README.md | 75 + .../azext_timeseriesinsights/__init__.py | 32 + .../_client_factory.py | 26 + .../azext_timeseriesinsights/_help.py | 292 +++ .../azext_timeseriesinsights/_params.py | 85 + .../azext_timeseriesinsights/_validators.py | 8 + .../azext_metadata.json | 4 + .../azext_timeseriesinsights/commands.py | 99 + .../azext_timeseriesinsights/custom.py | 227 ++ ...test_timeseriesinsights_access_policy.yaml | 466 ++++ .../test_timeseriesinsights_environment.yaml | 656 +++++ ...meseriesinsights_environment_longterm.yaml | 422 ++++ ...meseriesinsights_environment_standard.yaml | 615 +++++ ...eseriesinsights_event_source_eventhub.yaml | 1005 ++++++++ ...imeseriesinsights_event_source_iothub.yaml | 1501 +++++++++++ ...timeseriesinsights_reference_data_set.yaml | 506 ++++ .../test_timeseriesinsights_scenario.py | 262 ++ .../vendored_sdks/__init__.py | 1 + .../timeseriesinsights/__init__.py | 19 + .../timeseriesinsights/_configuration.py | 48 + .../_time_series_insights_client.py | 69 + .../timeseriesinsights/models/__init__.py | 196 ++ .../timeseriesinsights/models/_models.py | 2241 +++++++++++++++++ .../timeseriesinsights/models/_models_py3.py | 2237 ++++++++++++++++ .../models/_paged_models.py | 27 + .../_time_series_insights_client_enums.py | 84 + .../timeseriesinsights/operations/__init__.py | 24 + .../operations/_access_policies_operations.py | 382 +++ .../operations/_environments_operations.py | 489 ++++ .../operations/_event_sources_operations.py | 379 +++ .../operations/_operations.py | 102 + .../_reference_data_sets_operations.py | 380 +++ .../timeseriesinsights/version.py | 13 + src/timeseriesinsights/setup.cfg | 0 src/timeseriesinsights/setup.py | 52 + 37 files changed, 13034 insertions(+) create mode 100644 src/timeseriesinsights/HISTORY.rst create mode 100644 src/timeseriesinsights/README.md create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/__init__.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/_client_factory.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/_help.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/_params.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/_validators.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/azext_metadata.json create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/commands.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/custom.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_access_policy.yaml create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment.yaml create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment_longterm.yaml create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment_standard.yaml create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_event_source_eventhub.yaml create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_event_source_iothub.yaml create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_reference_data_set.yaml create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/tests/latest/test_timeseriesinsights_scenario.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/__init__.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/__init__.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/_configuration.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/_time_series_insights_client.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/__init__.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_models.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_models_py3.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_paged_models.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_time_series_insights_client_enums.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/__init__.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_access_policies_operations.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_environments_operations.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_event_sources_operations.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_operations.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_reference_data_sets_operations.py create mode 100644 src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/version.py create mode 100644 src/timeseriesinsights/setup.cfg create mode 100644 src/timeseriesinsights/setup.py diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 473b8d88b85..734791811b4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -100,6 +100,8 @@ /src/hpc-cache/ @qianwens +/src/timeseriesinsights/ @jiasli + /src/portal/ @YalinLi0312 /src/import-export/ @arrownj diff --git a/src/timeseriesinsights/HISTORY.rst b/src/timeseriesinsights/HISTORY.rst new file mode 100644 index 00000000000..1c139576ba0 --- /dev/null +++ b/src/timeseriesinsights/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/timeseriesinsights/README.md b/src/timeseriesinsights/README.md new file mode 100644 index 00000000000..d1a7d7c208c --- /dev/null +++ b/src/timeseriesinsights/README.md @@ -0,0 +1,75 @@ +Microsoft Azure CLI 'timeseriesinsights' Extension +========================================== + +This package is for the 'timeseriesinsights' extension: + +```sh +az timeseriesinsights +``` + +### Create a resource group for the environments + +```sh +rg={resource_group_name} +az group create -n $rg +``` + +### Create a standard environment + +```sh +env={standard_environment_name} +az timeseriesinsights environment standard create -g $rg --name $env --location westus --sku-name S1 --sku-capacity 1 --data-retention-time P31D --partition-key DeviceId1 --storage-limit-exceeded-behavior PauseIngress +``` + +### Create a storage account and use it to create a long-term environment + +```sh +storage={storage_account_name} +env_lt={longterm_environment_name} + +az storage account create -g $rg -n $storage --https-only +key=$(az storage account keys list -g $rg -n $storage --query [0].value --output tsv) + +az timeseriesinsights environment longterm create -g $rg --name $env_lt --location westus --sku-name L1 --sku-capacity 1 --data-retention 7 --time-series-id-properties DeviceId1 --storage-account-name $storage --storage-management-key $key +``` + +### Create an event hub and use it to create an event source + +```sh +ehns={eventhub_namespace} +eh={eventhub_name} + +az eventhubs namespace create -g $rg -n $ehns +es_resource_id=$(az eventhubs eventhub create -g $rg -n $eh --namespace-name $ehns --query id --output tsv) +shared_access_key=$(az eventhubs namespace authorization-rule keys list -g $rg --namespace-name $ehns -n RootManageSharedAccessKey --query primaryKey --output tsv) + +az timeseriesinsights event-source eventhub create -g $rg --environment-name $env --name {es1} --key-name RootManageSharedAccessKey --shared-access-key $shared_access_key --event-source-resource-id $es_resource_id --consumer-group-name '$Default' --timestamp-property-name DeviceId +``` + +### Create an IoT hub and use it to create an event source + +```sh +iothub={iothub_name} +es_resource_id=$(az iot hub create -g $rg -n $iothub --query id --output tsv) +shared_access_key=$(az iot hub policy list -g $rg --hub-name $iothub --query "[?keyName=='iothubowner'].primaryKey" --output tsv) +az timeseriesinsights event-source iothub create -g $rg --environment-name $env --name {es2} --consumer-group-name '$Default' --key-name iothubowner --shared-access-key $shared_access_key --event-source-resource-id $es_resource_id --timestamp-property-name DeviceId +``` + +### Create a reference data set + +```sh +az timeseriesinsights reference-data-set create -g $rg --environment-name $env --name {rds} --key-properties DeviceId1 String DeviceFloor Double --data-string-comparison-behavior Ordinal +``` + +### Create an access policy + +```sh +az timeseriesinsights access-policy create -g $rg --environment-name $env --name ap1 --principal-object-id 001 --description "some description" --roles Contributor Reader +``` + +### Delete the environment and all its sub-resources + +```sh +az timeseriesinsights environment delete --resource-group $rg --name $env +az group delete -n $rg +``` diff --git a/src/timeseriesinsights/azext_timeseriesinsights/__init__.py b/src/timeseriesinsights/azext_timeseriesinsights/__init__.py new file mode 100644 index 00000000000..7d4fcf55f01 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/__init__.py @@ -0,0 +1,32 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader + +from azext_timeseriesinsights._help import helps # pylint: disable=unused-import + + +class TimeSeriesInsightsClientCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_timeseriesinsights._client_factory import cf_timeseriesinsights + timeseriesinsights_custom = CliCommandType( + operations_tmpl='azext_timeseriesinsights.custom#{}', + client_factory=cf_timeseriesinsights) + super(TimeSeriesInsightsClientCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=timeseriesinsights_custom) + + def load_command_table(self, args): + from azext_timeseriesinsights.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_timeseriesinsights._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = TimeSeriesInsightsClientCommandsLoader diff --git a/src/timeseriesinsights/azext_timeseriesinsights/_client_factory.py b/src/timeseriesinsights/azext_timeseriesinsights/_client_factory.py new file mode 100644 index 00000000000..1a0682338b2 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/_client_factory.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def cf_timeseriesinsights(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from .vendored_sdks.timeseriesinsights import TimeSeriesInsightsClient + return get_mgmt_service_client(cli_ctx, TimeSeriesInsightsClient) + + +def cf_environments(cli_ctx, *_): + return cf_timeseriesinsights(cli_ctx).environments + + +def cf_event_sources(cli_ctx, *_): + return cf_timeseriesinsights(cli_ctx).event_sources + + +def cf_reference_data_sets(cli_ctx, *_): + return cf_timeseriesinsights(cli_ctx).reference_data_sets + + +def cf_access_policies(cli_ctx, *_): + return cf_timeseriesinsights(cli_ctx).access_policies diff --git a/src/timeseriesinsights/azext_timeseriesinsights/_help.py b/src/timeseriesinsights/azext_timeseriesinsights/_help.py new file mode 100644 index 00000000000..d42c37c91b1 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/_help.py @@ -0,0 +1,292 @@ +# coding=utf-8 +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=line-too-long +from knack.help_files import helps # pylint: disable=unused-import + + +helps['timeseriesinsights'] = """ +type: group +short-summary: Manage Azure Time Series Insights. +""" + +helps['timeseriesinsights environment'] = """ +type: group +short-summary: Commands to manage timeseriesinsights environment. +""" + +helps['timeseriesinsights environment standard'] = """ +type: group +short-summary: Create or update a standard environment in the specified subscription and resource group. +""" + +helps['timeseriesinsights environment standard create'] = """ +type: command +short-summary: Create or update a standard environment in the specified subscription and resource group. +examples: + - name: Create a standard environment + text: az timeseriesinsights environment standard create -g {rg} -n {env} --location westus --sku-name S1 --sku-capacity 1 --data-retention-time P31D --partition-key DeviceId1 --storage-limit-exceeded-behavior PauseIngress +""" + +helps['timeseriesinsights environment standard update'] = """ +type: command +short-summary: Update a standard environment in the specified subscription and resource group. +examples: + - name: Update sku capacity + text: az timeseriesinsights environment standard update -g {rg} -n {env} --sku-name S1 --sku-capacity 2 + - name: Update data retention days + text: az timeseriesinsights environment standard update -g {rg} -n {env} --data-retention-time 8 + - name: Update storage limit exceeded behavior + text: az timeseriesinsights environment standard update -g {rg} -n {env} --storage-limit-exceeded-behavior PurgeOldData +""" + +helps['timeseriesinsights environment longterm'] = """ +type: group +short-summary: Create or update a longterm environment in the specified subscription and resource group. +""" + +helps['timeseriesinsights environment longterm create'] = """ +type: command +short-summary: Create or update a longterm environment in the specified subscription and resource group. +examples: + - name: Create storage account and use it to create a longterm environment + text: | + storage=mystorageaccount + rg={rg} + az storage account create -g $rg -n $storage --https-only + key=$(az storage account keys list -g $rg -n $storage --query [0].value --output tsv) + az timeseriesinsights environment longterm create -g $rg -n {env} --location westus --sku-name L1 --sku-capacity 1 --data-retention 7 --time-series-id-properties DeviceId1 --storage-account-name $storage --storage-management-key $key +""" + +helps['timeseriesinsights environment longterm update'] = """ +type: command +short-summary: Update a longterm environment in the specified subscription and resource group. +examples: + - name: Update dataRetention + text: az timeseriesinsights environment longterm update -g {rg} -n {env} --data-retention 8 + - name: Update storageManagementKey + text: az timeseriesinsights environment longterm update -g {rg} -n {env} --storage-management-key xxx +""" + +helps['timeseriesinsights environment delete'] = """ +type: command +short-summary: Delete the environment with the specified name in the specified subscription and resource group. +examples: + - name: Delete an environments + text: |- + az timeseriesinsights environment delete -g {rg} -n {env} +""" + +helps['timeseriesinsights environment show'] = """ +type: command +short-summary: Show the environment with the specified name in the specified subscription and resource group. +examples: + - name: Show an environments + text: |- + az timeseriesinsights environment show -g {rg} -n {env} +""" + +helps['timeseriesinsights environment list'] = """ +type: command +short-summary: List all the available environments associated with the subscription and within the specified resource group. +examples: + - name: List environments by resource group + text: |- + az timeseriesinsights environment list -g {rg} + - name: List environments by subscription + text: |- + az timeseriesinsights environment list +""" + +helps['timeseriesinsights event-source'] = """ +type: group +short-summary: Commands to manage timeseriesinsights event source. +""" + +helps['timeseriesinsights event-source eventhub'] = """ +type: group +short-summary: Create or update an event hub event source under the specified environment. +""" + +helps['timeseriesinsights event-source eventhub create'] = """ +type: command +short-summary: Create or update an event hub event source under the specified environment. +examples: + - name: Create an eventhub and use it for event source + text: | + rg={rg} + ehns={eventhub_namespace} + eh={eventhub_name} + az eventhubs namespace create -g $rg -n $ehns + es_resource_id=$(az eventhubs eventhub create -g $rg -n $eh --namespace-name $ehns --query id --output tsv) + shared_access_key=$(az eventhubs namespace authorization-rule keys list -g $rg --namespace-name $ehns -n RootManageSharedAccessKey --query primaryKey --output tsv) + az timeseriesinsights event-source eventhub create -g $rg --environment-name {env} -n es1 --key-name RootManageSharedAccessKey --shared-access-key $shared_access_key --event-source-resource-id $es_resource_id --consumer-group-name '$Default' --timestamp-property-name DeviceId +""" + +helps['timeseriesinsights event-source eventhub update'] = """ +type: command +short-summary: Create or update an event source under the specified environment. +examples: + - name: Update timestampPropertyName + text: az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} -n {es} --timestamp-property-name DeviceId1 + - name: Update localTimestamp (Currently only Embedded is supported) + text: az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} -n {es} --local-timestamp-format Embedded + - name: Update sharedAccessKey + text: az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} -n {es} --shared-access-key {shared_access_key} +""" + +helps['timeseriesinsights event-source iothub'] = """ +type: group +short-summary: Create or update an iothub event source under the specified environment. +""" + +helps['timeseriesinsights event-source iothub create'] = """ +type: command +short-summary: Create or update an iothub event source under the specified environment. +examples: + - name: Create an iothub and use it for event source + text: | + rg={rg} + iothub={iothub_name} + es_resource_id=$(az iot hub create -g $rg -n $iothub --query id --output tsv) + shared_access_key=$(az iot hub policy list -g $rg --hub-name $iothub --query "[?keyName=='iothubowner'].primaryKey" --output tsv) + az timeseriesinsights event-source iothub create -g $rg --environment-name {env} -n es2 --consumer-group-name '$Default' --key-name iothubowner --shared-access-key $shared_access_key --event-source-resource-id $es_resource_id --timestamp-property-name DeviceId +""" + +helps['timeseriesinsights event-source iothub update'] = """ +type: command +short-summary: Create or update an event source under the specified environment. +examples: + - name: Update timestampPropertyName + text: az timeseriesinsights event-source iothub update -g {rg} --environment-name {env} -n {es} --timestamp-property-name DeviceId1 + - name: Update localTimestamp (Currently only Embedded is supported) + text: az timeseriesinsights event-source iothub update -g {rg} --environment-name {env} -n {es} --local-timestamp-format Embedded + - name: Update sharedAccessKey + text: az timeseriesinsights event-source iothub update -g {rg} --environment-name {env} -n {es} --shared-access-key {shared_access_key} +""" + +helps['timeseriesinsights event-source delete'] = """ +type: command +short-summary: Delete the event source with the specified name in the specified subscription, resource group, and environment +examples: + - name: Delete event-source + text: az timeseriesinsights event-source delete -g {rg} --environment-name {env} -n es1 +""" + +helps['timeseriesinsights event-source show'] = """ +type: command +short-summary: Show the event source with the specified name in the specified environment. +examples: + - name: Show event-source + text: az timeseriesinsights event-source show -g {rg} --environment-name {env} -n es1 +""" + +helps['timeseriesinsights event-source list'] = """ +type: command +short-summary: List all the available event sources associated with the subscription and within the specified resource group and environment. +examples: + - name: List event-source by environment + text: az timeseriesinsights event-source list -g {rg} --environment-name {env} +""" + +helps['timeseriesinsights reference-data-set'] = """ +type: group +short-summary: Commands to manage timeseriesinsights reference data set. +""" + +helps['timeseriesinsights reference-data-set create'] = """ +type: command +short-summary: Create or update a reference data set in the specified environment. +examples: + - name: Create reference-data-set + text: az timeseriesinsights reference-data-set create -g {rg} --environment-name {env} -n {rds} --key-properties DeviceId1 String DeviceFloor Double --data-string-comparison-behavior Ordinal +""" + +helps['timeseriesinsights reference-data-set update'] = """ +type: command +short-summary: Create or update a reference data set in the specified environment. +examples: + - name: Update reference-data-set + text: az timeseriesinsights reference-data-set update -g {rg} --environment-name {env} -n {rds} --tags mykey=myvalue +""" + +helps['timeseriesinsights reference-data-set delete'] = """ +type: command +short-summary: Delete the reference data set with the specified name in the specified subscription, resource group, and environment +examples: + - name: Delete reference-data-set + text: |- + az timeseriesinsights reference-data-set delete -g {rg} --environment-name {env} -n {rds} +""" + +helps['timeseriesinsights reference-data-set show'] = """ +type: command +short-summary: Show the reference data set with the specified name in the specified environment. +examples: + - name: Show reference-data-set + text: |- + az timeseriesinsights reference-data-set show -g {rg} --environment-name {env} -n {rds} +""" + +helps['timeseriesinsights reference-data-set list'] = """ +type: command +short-summary: List all the available reference data sets associated with the subscription and within the specified resource group and environment. +examples: + - name: List reference-data-set by environment + text: |- + az timeseriesinsights reference-data-set list -g {rg} --environment-name {env} +""" + +helps['timeseriesinsights access-policy'] = """ +type: group +short-summary: Commands to manage timeseriesinsights access policy. +""" + +helps['timeseriesinsights access-policy create'] = """ +type: command +short-summary: Create or update an access policy in the specified environment. +examples: + - name: Create access-policy + text: az timeseriesinsights access-policy create -g {rg} --environment-name {env} -n ap1 --principal-object-id 001 --description "some description" --roles Contributor Reader +""" + +helps['timeseriesinsights access-policy update'] = """ +type: command +short-summary: Create or update an access policy in the specified environment. +examples: + - name: Update access-policy + text: |- + az timeseriesinsights access-policy update -g {rg} --environment-name \\ + {env} -n {ap} --roles "Reader,Contributor" +""" + +helps['timeseriesinsights access-policy delete'] = """ +type: command +short-summary: Delete the access policy with the specified name in the specified subscription, resource group, and environment +examples: + - name: Delete access-policy + text: |- + az timeseriesinsights access-policy delete -g {rg} --environment-name {env} -n {ap} +""" + +helps['timeseriesinsights access-policy show'] = """ +type: command +short-summary: Show the access policy with the specified name in the specified environment. +examples: + - name: Get access-policy + text: |- + az timeseriesinsights access-policy show -g {rg} --environment-name {env} -n {ap} +""" + +helps['timeseriesinsights access-policy list'] = """ +type: command +short-summary: List all the available access policies associated with the environment. +examples: + - name: List access-policy by environment + text: |- + az timeseriesinsights access-policy list -g {rg} --environment-name {env} +""" diff --git a/src/timeseriesinsights/azext_timeseriesinsights/_params.py b/src/timeseriesinsights/azext_timeseriesinsights/_params.py new file mode 100644 index 00000000000..04a1aedaa6a --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/_params.py @@ -0,0 +1,85 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=line-too-long +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + name_type, + tags_type, + get_enum_type, + get_location_type +) +from azure.cli.core.commands.validators import get_default_location_from_resource_group + +from knack.arguments import CLIArgumentType +from ._validators import iso_8601_timespan + +environment_name_type = CLIArgumentType(id_part='name', help='The name of the Time Series Insights environment associated with the specified resource group.') + + +def load_arguments(self, _): + + with self.argument_context('timeseriesinsights operation list') as c: + pass + + with self.argument_context('timeseriesinsights') as c: + c.argument('location', get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + + # region environment + with self.argument_context('timeseriesinsights environment') as c: + from .vendored_sdks.timeseriesinsights.models import SkuName + c.argument('environment_name', arg_type=name_type, id_part='name', help='The name of the Time Series Insights environment associated with the specified resource group.') + c.argument('sku_name', arg_group="SKU", arg_type=get_enum_type(SkuName), help='The sku determines the type of environment, either standard (S1 or S2) or long-term (L1). For standard environments the sku determines the capacity of the environment, the ingress rate, and the billing rate.') + c.argument('sku_capacity', type=int, arg_group="SKU", help='The capacity of the sku. For standard environments, this value can be changed to support scale out of environments after they have been created.') + + with self.argument_context('timeseriesinsights environment standard') as c: + from .vendored_sdks.timeseriesinsights.models import StorageLimitExceededBehavior + c.argument('storage_limit_exceeded_behavior', arg_type=get_enum_type(StorageLimitExceededBehavior)) + c.argument('data_retention_time', type=iso_8601_timespan, help='The minimum number of days the environment\'s events will be available for query.') + c.argument('partition_key_properties', nargs='+') + + with self.argument_context('timeseriesinsights environment longterm') as c: + c.argument('storage_account_name', arg_group="Storage Configuration", help='The name of the storage account that will hold the environment\'s long term data.') + c.argument('storage_management_key', arg_group="Storage Configuration", help='The value of the management key that grants the Time Series Insights service write access to the storage account. This property is not shown in environment responses.') + c.argument('time_series_id_properties', nargs='+') + c.argument('data_retention', type=iso_8601_timespan, help='The number of days the environment\'s events will be available for query from the warm store.') + # endregion + + # region event-source + with self.argument_context('timeseriesinsights event-source') as c: + from .vendored_sdks.timeseriesinsights.models import LocalTimestampFormat + c.argument('environment_name', arg_type=environment_name_type) + c.argument('event_source_name', arg_type=name_type, id_part='child_name_1', help='The name of the Time Series Insights event source associated with the specified environment.') + c.argument('local_timestamp_format', arg_group="Local Timestamp", arg_type=get_enum_type(LocalTimestampFormat), help='An enum that represents the format of the local timestamp property that needs to be set. Currently only Embedded is supported.') + c.ignore('time_zone_offset_property_name') + # c.argument('time_zone_offset_property_name', arg_group="Local Timestamp", help='The event property that will be contain the offset information to calculate the local timestamp. When the LocalTimestampFormat is Iana, the property name will contain the name of the column which contains IANA Timezone Name (eg: Americas/Los Angeles). When LocalTimestampFormat is Timespan, it contains the name of property which contains values representing the offset (eg: P1D or 1.00:00:00)') + # endregion + + # region reference-data-set + with self.argument_context('timeseriesinsights reference-data-set') as c: + c.argument('environment_name', arg_type=environment_name_type) + c.argument('reference_data_set_name', arg_type=name_type, id_part='child_name_1', help='Name of the reference data set.') + + with self.argument_context('timeseriesinsights reference-data-set create') as c: + from .vendored_sdks.timeseriesinsights.models import DataStringComparisonBehavior + c.argument('key_properties', nargs='+', help='The list of key properties for the reference data set. Format: NAME TYPE ...') + c.argument('data_string_comparison_behavior', arg_type=get_enum_type(DataStringComparisonBehavior)) + # endregion + + # region access-policy + with self.argument_context('timeseriesinsights access-policy') as c: + from .vendored_sdks.timeseriesinsights.models import AccessPolicyRole + c.argument('environment_name', arg_type=environment_name_type) + c.argument('access_policy_name', arg_type=name_type, id_part='child_name_1', help='The name of the Time Series Insights access policy associated with the specified environment.') + c.argument('principal_object_id') + c.argument('description', help='A description of the access policy.') + c.argument('roles', arg_type=get_enum_type(AccessPolicyRole), nargs='+') + # endregion + + for item in ['event-source', 'reference-data-set', 'access-policy']: + with self.argument_context('timeseriesinsights {} list'.format(item)) as c: + c.argument('environment_name', arg_type=environment_name_type, id_part=None) diff --git a/src/timeseriesinsights/azext_timeseriesinsights/_validators.py b/src/timeseriesinsights/azext_timeseriesinsights/_validators.py new file mode 100644 index 00000000000..d0356324028 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/_validators.py @@ -0,0 +1,8 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def iso_8601_timespan(string): + return "P{}D".format(string) diff --git a/src/timeseriesinsights/azext_timeseriesinsights/azext_metadata.json b/src/timeseriesinsights/azext_timeseriesinsights/azext_metadata.json new file mode 100644 index 00000000000..27e30487444 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1" +} diff --git a/src/timeseriesinsights/azext_timeseriesinsights/commands.py b/src/timeseriesinsights/azext_timeseriesinsights/commands.py new file mode 100644 index 00000000000..5cad4544a53 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/commands.py @@ -0,0 +1,99 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements +# pylint: disable=too-many-locals +from azure.cli.core.commands import CliCommandType +from azure.cli.core.commands.transform import gen_dict_to_list_transform + + +def load_command_table(self, _): + + with self.command_group('timeseriesinsights', is_experimental=True) as g: + pass + + # region environment + from ._client_factory import cf_environments + timeseriesinsights_environments = CliCommandType( + operations_tmpl='azext_timeseriesinsights.vendored_sdks.timeseriesinsights.operations._environments_operations#EnvironmentsOperations.{}', + client_factory=cf_environments) + + with self.command_group('timeseriesinsights environment standard', timeseriesinsights_environments, client_factory=cf_environments) as g: + g.custom_command('create', 'create_timeseriesinsights_environment_standard', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#StandardEnvironmentCreateOrUpdateParameters", + supports_no_wait=True) + g.custom_command('update', 'update_timeseriesinsights_environment_standard', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#StandardEnvironmentCreateOrUpdateParameters", + supports_no_wait=True) + + with self.command_group('timeseriesinsights environment longterm', timeseriesinsights_environments, client_factory=cf_environments) as g: + g.custom_command('create', 'create_timeseriesinsights_environment_longterm', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#LongTermEnvironmentCreateOrUpdateParameters", + supports_no_wait=True) + g.custom_command('update', 'update_timeseriesinsights_environment_longterm', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#LongTermEnvironmentUpdateParameters", + supports_no_wait=True) + + with self.command_group('timeseriesinsights environment', timeseriesinsights_environments, client_factory=cf_environments) as g: + g.command('delete', 'delete', confirmation=True) + g.show_command('show', 'get') + g.custom_command('list', 'list_timeseriesinsights_environment', transform=gen_dict_to_list_transform(key='value')) + # endregion + + # region event-source + from ._client_factory import cf_event_sources + timeseriesinsights_event_sources = CliCommandType( + operations_tmpl='azext_timeseriesinsights.vendored_sdks.timeseriesinsights.operations._event_sources_operations#EventSourcesOperations.{}', + client_factory=cf_event_sources) + + with self.command_group('timeseriesinsights event-source eventhub', timeseriesinsights_event_sources, client_factory=cf_event_sources) as g: + g.custom_command('create', 'create_timeseriesinsights_event_source_eventhub', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#EventHubEventSourceCreateOrUpdateParameters") + g.custom_command('update', 'update_timeseriesinsights_event_source_eventhub', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#EventHubEventSourceUpdateParameters") + + with self.command_group('timeseriesinsights event-source iothub', timeseriesinsights_event_sources, client_factory=cf_event_sources) as g: + g.custom_command('create', 'create_timeseriesinsights_event_source_iothub', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#IoTHubEventSourceCreateOrUpdateParameters") + g.custom_command('update', 'update_timeseriesinsights_event_source_iothub', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#IoTHubEventSourceUpdateParameters") + + with self.command_group('timeseriesinsights event-source', timeseriesinsights_event_sources, client_factory=cf_event_sources) as g: + g.command('delete', 'delete', confirmation=True) + g.show_command('show', 'get') + g.command('list', 'list_by_environment') + # endregion + + # region reference-data-set + from ._client_factory import cf_reference_data_sets + timeseriesinsights_reference_data_sets = CliCommandType( + operations_tmpl='azext_timeseriesinsights.vendored_sdks.timeseriesinsights.operations._reference_data_sets_operations#ReferenceDataSetsOperations.{}', + client_factory=cf_reference_data_sets) + + with self.command_group('timeseriesinsights reference-data-set', timeseriesinsights_reference_data_sets, client_factory=cf_reference_data_sets) as g: + g.custom_command('create', 'create_timeseriesinsights_reference_data_set', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#ReferenceDataSetCreateOrUpdateParameters") + g.custom_command('update', 'update_timeseriesinsights_reference_data_set') + g.command('delete', 'delete', confirmation=True) + g.show_command('show', 'get') + g.command('list', 'list_by_environment') + # endregion + + # region access-policy + from ._client_factory import cf_access_policies + timeseriesinsights_access_policies = CliCommandType( + operations_tmpl='azext_timeseriesinsights.vendored_sdks.timeseriesinsights.operations._access_policies_operations#AccessPoliciesOperations.{}', + client_factory=cf_access_policies) + with self.command_group('timeseriesinsights access-policy', timeseriesinsights_access_policies, client_factory=cf_access_policies) as g: + g.custom_command('create', 'create_timeseriesinsights_access_policy', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#AccessPolicyCreateOrUpdateParameters") + g.custom_command('update', 'update_timeseriesinsights_access_policy', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#AccessPolicyUpdateParameters") + g.command('delete', 'delete', confirmation=True) + g.show_command('show', 'get') + g.command('list', 'list_by_environment') + # endregion diff --git a/src/timeseriesinsights/azext_timeseriesinsights/custom.py b/src/timeseriesinsights/azext_timeseriesinsights/custom.py new file mode 100644 index 00000000000..2ecbd8f57a1 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/custom.py @@ -0,0 +1,227 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=line-too-long +# pylint: disable=too-many-statements +# pylint: disable=too-many-lines +# pylint: disable=too-many-locals +# pylint: disable=unused-argument + +from azure.cli.core.util import sdk_no_wait + + +def create_timeseriesinsights_environment_standard(cmd, client, + resource_group_name, environment_name, + sku_name, sku_capacity, + data_retention_time, + storage_limit_exceeded_behavior=None, + partition_key_properties=None, + location=None, tags=None, no_wait=False): + from .vendored_sdks.timeseriesinsights.models import StandardEnvironmentCreateOrUpdateParameters, Sku, \ + TimeSeriesIdProperty + + parameters = StandardEnvironmentCreateOrUpdateParameters( + location=location, + tags=tags, + sku=Sku(name=sku_name, capacity=sku_capacity), + data_retention_time=data_retention_time, + storage_limit_exceeded_behavior=storage_limit_exceeded_behavior, + # Need to confirm whether multiple key properties are supported + partition_key_properties=[TimeSeriesIdProperty(name=id_property, type="String") for id_property in partition_key_properties] + ) + return sdk_no_wait(no_wait, client.create_or_update, resource_group_name=resource_group_name, environment_name=environment_name, parameters=parameters) + + +def update_timeseriesinsights_environment_standard(cmd, client, + resource_group_name, environment_name, + sku_name=None, sku_capacity=None, + data_retention_time=None, storage_limit_exceeded_behavior=None, + partition_key_properties=None, tags=None, no_wait=False): + from .vendored_sdks.timeseriesinsights.models import StandardEnvironmentUpdateParameters, Sku, TimeSeriesIdProperty + + parameters = StandardEnvironmentUpdateParameters( + tags=tags, + sku=Sku(name=sku_name, capacity=sku_capacity) if sku_name and sku_capacity else None, + data_retention_time=data_retention_time, + storage_limit_exceeded_behavior=storage_limit_exceeded_behavior, + partition_key_properties=[TimeSeriesIdProperty(name=id_property, type="String") for id_property in partition_key_properties] if partition_key_properties else None + ) + return sdk_no_wait(no_wait, client.update, resource_group_name=resource_group_name, environment_name=environment_name, parameters=parameters) + + +def create_timeseriesinsights_environment_longterm(cmd, client, + resource_group_name, environment_name, + sku_name, sku_capacity, + time_series_id_properties, + storage_account_name, + storage_management_key, + data_retention, + location=None, tags=None, no_wait=False): + from .vendored_sdks.timeseriesinsights.models import LongTermEnvironmentCreateOrUpdateParameters, Sku, \ + TimeSeriesIdProperty, LongTermStorageConfigurationInput + parameters = LongTermEnvironmentCreateOrUpdateParameters( + location=location, + tags=tags, + sku=Sku(name=sku_name, capacity=sku_capacity), + time_series_id_properties=[TimeSeriesIdProperty(name=time_series_id_properties, type="String")], + storage_configuration=LongTermStorageConfigurationInput(account_name=storage_account_name, management_key=storage_management_key), + data_retention=data_retention) + return sdk_no_wait(no_wait, client.create_or_update, resource_group_name=resource_group_name, environment_name=environment_name, parameters=parameters) + + +def update_timeseriesinsights_environment_longterm(cmd, client, + resource_group_name, environment_name, + storage_management_key=None, + data_retention=None, + tags=None, no_wait=False): + from .vendored_sdks.timeseriesinsights.models import LongTermEnvironmentUpdateParameters, \ + LongTermStorageConfigurationMutableProperties + parameters = LongTermEnvironmentUpdateParameters( + tags=tags, + storage_configuration=LongTermStorageConfigurationMutableProperties(management_key=storage_management_key) if storage_management_key else None, + data_retention=data_retention) + return sdk_no_wait(no_wait, client.update, resource_group_name=resource_group_name, environment_name=environment_name, parameters=parameters) + + +def list_timeseriesinsights_environment(cmd, client, resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def create_timeseriesinsights_event_source_eventhub(cmd, client, + resource_group_name, environment_name, event_source_name, + timestamp_property_name, event_source_resource_id, + consumer_group_name, key_name, shared_access_key, + location=None, tags=None): + from azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models import EventHubEventSourceCreateOrUpdateParameters + from msrestazure.tools import parse_resource_id + parsed_id = parse_resource_id(event_source_resource_id) + parameters = EventHubEventSourceCreateOrUpdateParameters( + location=location, + timestamp_property_name=timestamp_property_name, + event_source_resource_id=event_source_resource_id, + service_bus_namespace=parsed_id['name'], + event_hub_name=parsed_id['child_name_1'], + consumer_group_name=consumer_group_name, + key_name=key_name, + shared_access_key=shared_access_key, + tags=tags + ) + return client.create_or_update(resource_group_name=resource_group_name, environment_name=environment_name, event_source_name=event_source_name, parameters=parameters) + + +def update_timeseriesinsights_event_source_eventhub(cmd, client, resource_group_name, environment_name, event_source_name, + timestamp_property_name=None, + local_timestamp_format=None, time_zone_offset_property_name=None, + shared_access_key=None, tags=None): + from .vendored_sdks.timeseriesinsights.models import EventHubEventSourceUpdateParameters, LocalTimestamp, \ + LocalTimestampTimeZoneOffset, LocalTimestampFormat + local_timestamp = None + if local_timestamp_format == LocalTimestampFormat.embedded: + local_timestamp = LocalTimestamp(format=local_timestamp_format) + elif local_timestamp_format and time_zone_offset_property_name: + local_timestamp = LocalTimestamp(format=local_timestamp_format, + time_zone_offset=LocalTimestampTimeZoneOffset(property_name=time_zone_offset_property_name)) + parameters = EventHubEventSourceUpdateParameters(tags=tags, + timestamp_property_name=timestamp_property_name, + local_timestamp=local_timestamp, + shared_access_key=shared_access_key) + + return client.update(resource_group_name=resource_group_name, environment_name=environment_name, event_source_name=event_source_name, + parameters=parameters) + + +def create_timeseriesinsights_event_source_iothub(cmd, client, + resource_group_name, environment_name, event_source_name, + timestamp_property_name, event_source_resource_id, + consumer_group_name, key_name, shared_access_key, + location=None, tags=None): + from .vendored_sdks.timeseriesinsights.models import IoTHubEventSourceCreateOrUpdateParameters + from msrestazure.tools import parse_resource_id + parsed_id = parse_resource_id(event_source_resource_id) + parameters = IoTHubEventSourceCreateOrUpdateParameters( + location=location, + tags=tags, + timestamp_property_name=timestamp_property_name, + event_source_resource_id=event_source_resource_id, + iot_hub_name=parsed_id['name'], + consumer_group_name=consumer_group_name, + key_name=key_name, + shared_access_key=shared_access_key) + return client.create_or_update( + resource_group_name=resource_group_name, environment_name=environment_name, event_source_name=event_source_name, + parameters=parameters) + + +def update_timeseriesinsights_event_source_iothub(cmd, client, + resource_group_name, environment_name, event_source_name, + timestamp_property_name=None, + local_timestamp_format=None, time_zone_offset_property_name=None, + shared_access_key=None, + tags=None): + from .vendored_sdks.timeseriesinsights.models import IoTHubEventSourceUpdateParameters, LocalTimestamp, \ + LocalTimestampTimeZoneOffset, LocalTimestampFormat + local_timestamp = None + if local_timestamp_format == LocalTimestampFormat.embedded: + local_timestamp = LocalTimestamp(format=local_timestamp_format) + elif local_timestamp_format and time_zone_offset_property_name: + local_timestamp = LocalTimestamp(format=local_timestamp_format, + time_zone_offset=LocalTimestampTimeZoneOffset(property_name=time_zone_offset_property_name)) + parameters = IoTHubEventSourceUpdateParameters( + tags=tags, + timestamp_property_name=timestamp_property_name, + local_timestamp=local_timestamp, + shared_access_key=shared_access_key + ) + return client.update(resource_group_name=resource_group_name, environment_name=environment_name, event_source_name=event_source_name, parameters=parameters) + + +def create_timeseriesinsights_reference_data_set(cmd, client, + resource_group_name, environment_name, reference_data_set_name, + key_properties, data_string_comparison_behavior, + location=None, tags=None): + from .vendored_sdks.timeseriesinsights.models import ReferenceDataSetCreateOrUpdateParameters, \ + ReferenceDataSetKeyProperty + + key_properties_list = [] + key_property_count, remaining = divmod(len(key_properties), 2) + if remaining: + from knack.util import CLIError + raise CLIError("Usage error: --key-properties NAME TYPE ...") + + for _ in range(0, key_property_count): + # eg. --key-properties DeviceId1 String DeviceFloor Double + key_properties_list.append(ReferenceDataSetKeyProperty(name=key_properties.pop(0), type=key_properties.pop(0))) + + parameters = ReferenceDataSetCreateOrUpdateParameters( + location=location, + tags=tags, + key_properties=key_properties_list, + data_string_comparison_behavior=data_string_comparison_behavior + ) + + return client.create_or_update(resource_group_name=resource_group_name, environment_name=environment_name, reference_data_set_name=reference_data_set_name, parameters=parameters) + + +def update_timeseriesinsights_reference_data_set(cmd, client, + resource_group_name, environment_name, reference_data_set_name, + tags=None): + return client.update(resource_group_name=resource_group_name, environment_name=environment_name, reference_data_set_name=reference_data_set_name, tags=tags) + + +def create_timeseriesinsights_access_policy(cmd, client, + resource_group_name, environment_name, access_policy_name, + principal_object_id=None, description=None, roles=None): + from .vendored_sdks.timeseriesinsights.models import AccessPolicyCreateOrUpdateParameters + parameters = AccessPolicyCreateOrUpdateParameters( + principal_object_id=principal_object_id, + description=description, + roles=roles) + return client.create_or_update(resource_group_name=resource_group_name, environment_name=environment_name, access_policy_name=access_policy_name, parameters=parameters) + + +def update_timeseriesinsights_access_policy(cmd, client, resource_group_name, environment_name, access_policy_name, + description=None, roles=None): + return client.update(resource_group_name=resource_group_name, environment_name=environment_name, access_policy_name=access_policy_name, description=description, roles=roles) diff --git a/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_access_policy.yaml b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_access_policy.yaml new file mode 100644 index 00000000000..192b6bbdd38 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_access_policy.yaml @@ -0,0 +1,466 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:52:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "sku": {"name": "S1", "capacity": 1}, "kind": "Standard", + "properties": {"dataRetentionTime": "P31D", "storageLimitExceededBehavior": + "PauseIngress", "partitionKeyProperties": [{"name": "DeviceId1", "type": "String"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + Content-Length: + - '242' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"2020-04-23T08:52:40+00:00","provisioningState":"Accepted","dataAccessId":"def09b9c-9580-41a8-b1e1-d74e50d8d85a","dataAccessFqdn":"def09b9c-9580-41a8-b1e1-d74e50d8d85a.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '798' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:52:42 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1192' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:40 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"def09b9c-9580-41a8-b1e1-d74e50d8d85a","dataAccessFqdn":"def09b9c-9580-41a8-b1e1-d74e50d8d85a.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '803' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"principalObjectId": "001", "description": "some description", + "roles": ["Contributor", "Reader"]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights access-policy create + Connection: + - keep-alive + Content-Length: + - '115' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --principal-object-id --description --roles + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accessPolicies/ap1?api-version=2018-08-15-preview + response: + body: + string: '{"properties":{"principalObjectId":"001","description":"some description","roles":["Contributor","Reader"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accesspolicies/ap1","name":"ap1","type":"Microsoft.TimeSeriesInsights/Environments/AccessPolicies"}' + headers: + cache-control: + - no-cache + content-length: + - '433' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1195' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"description": "some description updated"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights access-policy update + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --description + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accessPolicies/ap1?api-version=2018-08-15-preview + response: + body: + string: '{"properties":{"principalObjectId":"001","description":"some description + updated","roles":["Contributor","Reader"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accesspolicies/ap1","name":"ap1","type":"Microsoft.TimeSeriesInsights/Environments/AccessPolicies"}' + headers: + cache-control: + - no-cache + content-length: + - '441' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1190' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"roles": ["Contributor"]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights access-policy update + Connection: + - keep-alive + Content-Length: + - '42' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --roles + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accessPolicies/ap1?api-version=2018-08-15-preview + response: + body: + string: '{"properties":{"principalObjectId":"001","description":"some description + updated","roles":["Contributor"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accesspolicies/ap1","name":"ap1","type":"Microsoft.TimeSeriesInsights/Environments/AccessPolicies"}' + headers: + cache-control: + - no-cache + content-length: + - '432' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1193' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights access-policy show + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name --name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accessPolicies/ap1?api-version=2018-08-15-preview + response: + body: + string: '{"properties":{"principalObjectId":"001","description":"some description + updated","roles":["Contributor"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accesspolicies/ap1","name":"ap1","type":"Microsoft.TimeSeriesInsights/Environments/AccessPolicies"}' + headers: + cache-control: + - no-cache + content-length: + - '432' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights access-policy list + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accessPolicies?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"properties":{"principalObjectId":"001","description":"some + description updated","roles":["Contributor"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accesspolicies/ap1","name":"ap1","type":"Microsoft.TimeSeriesInsights/Environments/AccessPolicies"}]}' + headers: + cache-control: + - no-cache + content-length: + - '444' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights access-policy delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --environment-name --name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accessPolicies/ap1?api-version=2018-08-15-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 08:53:25 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 200 + message: OK +version: 1 diff --git a/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment.yaml b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment.yaml new file mode 100644 index 00000000000..28deed36bc0 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment.yaml @@ -0,0 +1,656 @@ +interactions: +- request: + body: '{"location": "westus", "sku": {"name": "S1", "capacity": 1}, "kind": "Standard", + "properties": {"dataRetentionTime": "P7D", "storageLimitExceededBehavior": "PauseIngress", + "partitionKeyProperties": [{"name": "DeviceId1", "type": "String"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + Content-Length: + - '241' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --location --sku-name --sku-capacity --data-retention-time + --partition-key-properties --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"2020-04-09T06:30:46+00:00","provisioningState":"Accepted","dataAccessId":"2692351f-dd20-4ae0-aef0-77396b0ca167","dataAccessFqdn":"2692351f-dd20-4ae0-aef0-77396b0ca167.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1","name":"env1","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '757' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:30:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --sku-name --sku-capacity --data-retention-time + --partition-key-properties --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 09 Apr 2020 06:30:46 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"2692351f-dd20-4ae0-aef0-77396b0ca167","dataAccessFqdn":"2692351f-dd20-4ae0-aef0-77396b0ca167.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1","name":"env1","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:31:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account keys list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2019-06-01 + response: + body: + string: '{"keys":[{"keyName":"key1","value":"veryFakedStorageAccountKey==","permissions":"FULL"},{"keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:31:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11997' + status: + code: 200 + message: OK +- request: + body: 'b''{"location": "westus", "sku": {"name": "L1", "capacity": 1}, "kind": + "LongTerm", "properties": {"timeSeriesIdProperties": [{"name": "[\''DeviceId1\'']", + "type": "String"}], "storageConfiguration": {"accountName": "clitest000002", + "managementKey": "veryFakedStorageAccountKey=="}, "warmStoreConfiguration": + {"dataRetention": "P7D"}}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + Content-Length: + - '399' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --location --sku-name --sku-capacity --data-retention + --time-series-id-properties --storage-account-name --storage-management-key + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"2020-04-09T06:31:30+00:00","provisioningState":"Accepted","dataAccessId":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333","dataAccessFqdn":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '804' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:31:32 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --sku-name --sku-capacity --data-retention + --time-series-id-properties --storage-account-name --storage-management-key + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 09 Apr 2020 06:31:30 GMT","provisioningState":"Creating","requestApiVersion":"2018-08-15-preview","dataAccessId":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333","dataAccessFqdn":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '808' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:32:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --sku-name --sku-capacity --data-retention + --time-series-id-properties --storage-account-name --storage-management-key + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 09 Apr 2020 06:31:30 GMT","provisioningState":"Creating","requestApiVersion":"2018-08-15-preview","dataAccessId":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333","dataAccessFqdn":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '808' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:32:35 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --sku-name --sku-capacity --data-retention + --time-series-id-properties --storage-account-name --storage-management-key + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 09 Apr 2020 06:31:30 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333","dataAccessFqdn":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '809' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:33:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment show + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 09 Apr 2020 06:30:46 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"2692351f-dd20-4ae0-aef0-77396b0ca167","dataAccessFqdn":"2692351f-dd20-4ae0-aef0-77396b0ca167.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1","name":"env1","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:33:09 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment show + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 09 Apr 2020 06:31:30 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333","dataAccessFqdn":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '809' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:33:11 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 09 Apr 2020 06:31:30 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333","dataAccessFqdn":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 09 Apr 2020 06:30:46 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"2692351f-dd20-4ae0-aef0-77396b0ca167","dataAccessFqdn":"2692351f-dd20-4ae0-aef0-77396b0ca167.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1","name":"env1","type":"Microsoft.TimeSeriesInsights/Environments"}]}' + headers: + cache-control: + - no-cache + content-length: + - '1584' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:33:14 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment list + Connection: + - keep-alive + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.TimeSeriesInsights/environments?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 09 Apr 2020 06:31:30 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333","dataAccessFqdn":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 09 Apr 2020 03:39:01 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"d38f6ddf-2f42-4524-a467-7fb2635bc0de","dataAccessFqdn":"d38f6ddf-2f42-4524-a467-7fb2635bc0de.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/environments/env1","name":"env1","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 09 Apr 2020 06:30:46 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"2692351f-dd20-4ae0-aef0-77396b0ca167","dataAccessFqdn":"2692351f-dd20-4ae0-aef0-77396b0ca167.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1","name":"env1","type":"Microsoft.TimeSeriesInsights/Environments"}]}' + headers: + cache-control: + - no-cache + content-length: + - '2275' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:33:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1?api-version=2018-08-15-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 09 Apr 2020 06:33:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2?api-version=2018-08-15-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 09 Apr 2020 06:33:27 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 200 + message: OK +version: 1 diff --git a/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment_longterm.yaml b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment_longterm.yaml new file mode 100644 index 00000000000..2bd4b1b913a --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment_longterm.yaml @@ -0,0 +1,422 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account keys list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2019-06-01 + response: + body: + string: '{"keys":[{"keyName":"key1","value":"veryFakedStorageAccountKey==","permissions":"FULL"},{"keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:58:47 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11998' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention --time-series-id-properties + --storage-account-name --storage-management-key + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:58:18Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:58:48 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: 'b''{"location": "westus", "sku": {"name": "L1", "capacity": 1}, "kind": + "LongTerm", "properties": {"timeSeriesIdProperties": [{"name": "[\''DeviceId1\'']", + "type": "String"}], "storageConfiguration": {"accountName": "clitest000002", + "managementKey": "veryFakedStorageAccountKey=="}, "warmStoreConfiguration": + {"dataRetention": "P7D"}}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + Content-Length: + - '399' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention --time-series-id-properties + --storage-account-name --storage-management-key + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"2020-04-23T08:58:56+00:00","provisioningState":"Accepted","dataAccessId":"a8cedca2-765a-49a9-bed1-0bfd10644403","dataAccessFqdn":"a8cedca2-765a-49a9-bed1-0bfd10644403.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '844' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:58:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1192' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention --time-series-id-properties + --storage-account-name --storage-management-key + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 23 Apr 2020 08:58:56 GMT","provisioningState":"Creating","requestApiVersion":"2018-08-15-preview","dataAccessId":"a8cedca2-765a-49a9-bed1-0bfd10644403","dataAccessFqdn":"a8cedca2-765a-49a9-bed1-0bfd10644403.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '848' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:59:29 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention --time-series-id-properties + --storage-account-name --storage-management-key + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 23 Apr 2020 08:58:56 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"a8cedca2-765a-49a9-bed1-0bfd10644403","dataAccessFqdn":"a8cedca2-765a-49a9-bed1-0bfd10644403.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '849' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:59:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"warmStoreConfiguration": {"dataRetention": "P8D"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm update + Connection: + - keep-alive + Content-Length: + - '68' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --data-retention + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":{},"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P8D"},"creationTime":"Thu, + 23 Apr 2020 08:58:56 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"a8cedca2-765a-49a9-bed1-0bfd10644403","dataAccessFqdn":"a8cedca2-765a-49a9-bed1-0bfd10644403.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '847' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 09:00:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1194' + status: + code: 200 + message: OK +- request: + body: '{"keyName": "key1"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account keys renew + Connection: + - keep-alive + Content-Length: + - '19' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Storage/storageAccounts/clitest000002/regenerateKey?api-version=2019-06-01 + response: + body: + string: '{"keys":[{"keyName":"key1","value":"rmG6CkIpQxBZVpdgwnnZrxPJxv5+jwWrxLOTLcEjr0/XZF0bseNyxLlSj58M2U1LD99xpCgfrD4k3seP9bigHQ==","permissions":"FULL"},{"keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 09:01:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.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: + - '1197' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"storageConfiguration": {"managementKey": "rmG6CkIpQxBZVpdgwnnZrxPJxv5+jwWrxLOTLcEjr0/XZF0bseNyxLlSj58M2U1LD99xpCgfrD4k3seP9bigHQ=="}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm update + Connection: + - keep-alive + Content-Length: + - '151' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --storage-management-key + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":{},"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P8D"},"creationTime":"Thu, + 23 Apr 2020 08:58:56 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"a8cedca2-765a-49a9-bed1-0bfd10644403","dataAccessFqdn":"a8cedca2-765a-49a9-bed1-0bfd10644403.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '847' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 09:01:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1194' + status: + code: 200 + message: OK +version: 1 diff --git a/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment_standard.yaml b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment_standard.yaml new file mode 100644 index 00000000000..32b2fdf54c7 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment_standard.yaml @@ -0,0 +1,615 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:52:32 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "sku": {"name": "S1", "capacity": 1}, "kind": "Standard", + "properties": {"dataRetentionTime": "P7D", "storageLimitExceededBehavior": "PauseIngress", + "partitionKeyProperties": [{"name": "DeviceId1", "type": "String"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + Content-Length: + - '241' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"2020-04-23T08:52:48+00:00","provisioningState":"Accepted","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '797' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:52:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Creating","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '801' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:24 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '802' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:56 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"sku": {"name": "S1", "capacity": 2}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard update + Connection: + - keep-alive + Content-Length: + - '38' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":2},"kind":"Standard","location":"westus","tags":{},"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1193' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"dataRetentionTime": "P8D"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard update + Connection: + - keep-alive + Content-Length: + - '44' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --data-retention-time + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":2},"kind":"Standard","location":"westus","tags":{},"properties":{"dataRetentionTime":"P8D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1189' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"storageLimitExceededBehavior": "PurgeOldData"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard update + Connection: + - keep-alive + Content-Length: + - '64' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":2},"kind":"Standard","location":"westus","tags":{},"properties":{"dataRetentionTime":"P8D","storageLimitExceededBehavior":"PurgeOldData","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1196' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment show + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":2},"kind":"Standard","location":"westus","tags":{},"properties":{"dataRetentionTime":"P8D","storageLimitExceededBehavior":"PurgeOldData","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"sku":{"name":"S1","capacity":2},"kind":"Standard","location":"westus","tags":{},"properties":{"dataRetentionTime":"P8D","storageLimitExceededBehavior":"PurgeOldData","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}]}' + headers: + cache-control: + - no-cache + content-length: + - '812' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment list + Connection: + - keep-alive + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.TimeSeriesInsights/environments?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:42 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"c72de72b-1e7e-437a-b889-28db0873600b","dataAccessFqdn":"c72de72b-1e7e-437a-b889-28db0873600b.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights2oiftej3hx5342cijs7v7cjogck3zpitrefknndb425ds5ty/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-enve5dpsot4","name":"cli-test-tsi-enve5dpsot4","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"WestUs","tags":{},"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"jlst0423"},"warmStoreConfiguration":{"dataRetention":"P12D"},"creationTime":"Thu, + 23 Apr 2020 07:31:28 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"7edc94e2-0d50-45ec-87f0-8581f9fdb896","dataAccessFqdn":"7edc94e2-0d50-45ec-87f0-8581f9fdb896.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:40 GMT","provisioningState":"Deleting","requestApiVersion":"2018-08-15-preview","dataAccessId":"def09b9c-9580-41a8-b1e1-d74e50d8d85a","dataAccessFqdn":"def09b9c-9580-41a8-b1e1-d74e50d8d85a.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsightsq2yvggz3wbrhaaimlkvs4pxaodgoxddp7xdsnv4c2ku5sc6x/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-enviwayt2td","name":"cli-test-tsi-enviwayt2td","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitesti77jqi5ajd6qf26ih"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 23 Apr 2020 08:15:51 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"b7940864-a0c6-49f3-97f0-2f97a92029f1","dataAccessFqdn":"b7940864-a0c6-49f3-97f0-2f97a92029f1.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsightslqf77dpmzjutptzaamy3njmq2em5vzikcppxdp4xv3yzg52h/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-envkatcjyef","name":"cli-test-tsi-envkatcjyef","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:45 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"19d80b62-5ad8-413d-b006-9a81ba3dd670","dataAccessFqdn":"19d80b62-5ad8-413d-b006-9a81ba3dd670.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsightsykcxb7ztbepz3cbrz62whynq3mxbkltafzns3znlvb5q6v2e/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-envmy2ib4my","name":"cli-test-tsi-envmy2ib4my","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":2},"kind":"Standard","location":"westus","tags":{},"properties":{"dataRetentionTime":"P8D","storageLimitExceededBehavior":"PurgeOldData","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:52 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"e366c607-9592-48f9-9f57-c274fd9787df","dataAccessFqdn":"e366c607-9592-48f9-9f57-c274fd9787df.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights6sqryqtjaivs76kpg4o4jrz7swfdygumzpyic7illekv6j5d/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-envkvpwo2pu","name":"cli-test-tsi-envkvpwo2pu","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest7rfijel6fwut5i5pu"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 23 Apr 2020 08:53:07 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"27230d72-77ee-4156-aa4a-43b545cc2504","dataAccessFqdn":"27230d72-77ee-4156-aa4a-43b545cc2504.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsightsq2vksngavqljrt5cw4eqq4kppsqha6q6co7anboikjdobqyl/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env6qb4o6ft","name":"cli-test-tsi-env6qb4o6ft","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus2","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 07:17:29 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"b5a60b17-e0a7-4e3a-87f7-cf48569e7eb9","dataAccessFqdn":"b5a60b17-e0a7-4e3a-87f7-cf48569e7eb9.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/environments/env1","name":"env1","type":"Microsoft.TimeSeriesInsights/Environments"}]}' + headers: + cache-control: + - no-cache + content-length: + - '7140' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:12 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - 4e81e23e-97dd-4478-82fd-9d5391fd2120 + - 185cfc4a-c8f8-478c-8489-4856a1b327e8 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 08:54:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments?api-version=2018-08-15-preview + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_event_source_eventhub.yaml b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_event_source_eventhub.yaml new file mode 100644 index 00000000000..05074c431d8 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_event_source_eventhub.yaml @@ -0,0 +1,1005 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:52:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "sku": {"name": "S1", "capacity": 1}, "kind": "Standard", + "properties": {"dataRetentionTime": "P31D", "storageLimitExceededBehavior": + "PauseIngress", "partitionKeyProperties": [{"name": "DeviceId1", "type": "String"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + Content-Length: + - '242' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"2020-04-23T08:52:42+00:00","provisioningState":"Accepted","dataAccessId":"c72de72b-1e7e-437a-b889-28db0873600b","dataAccessFqdn":"c72de72b-1e7e-437a-b889-28db0873600b.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005","name":"cli-test-tsi-env000005","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '798' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:52:47 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1194' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:42 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"c72de72b-1e7e-437a-b889-28db0873600b","dataAccessFqdn":"c72de72b-1e7e-437a-b889-28db0873600b.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005","name":"cli-test-tsi-env000005","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '803' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:53:21 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "sku": {"name": "Standard", "tier": "Standard"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs namespace create + Connection: + - keep-alive + Content-Length: + - '71' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-eventhub/3.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003?api-version=2017-04-01 + response: + body: + string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003","name":"cli-test-tsi-ehns000003","type":"Microsoft.EventHub/Namespaces","location":"West + US","tags":{},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590:cli-test-tsi-ehns000003","createdAt":"2020-04-23T08:53:26.513Z","updatedAt":"2020-04-23T08:53:26.513Z","serviceBusEndpoint":"https://cli-test-tsi-ehns000003.servicebus.windows.net:443/","status":"Activating"}}' + headers: + cache-control: + - no-cache + content-length: + - '757' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:53:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '49' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-eventhub/3.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003?api-version=2017-04-01 + response: + body: + string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003","name":"cli-test-tsi-ehns000003","type":"Microsoft.EventHub/Namespaces","location":"West + US","tags":{},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590:cli-test-tsi-ehns000003","createdAt":"2020-04-23T08:53:26.513Z","updatedAt":"2020-04-23T08:53:26.513Z","serviceBusEndpoint":"https://cli-test-tsi-ehns000003.servicebus.windows.net:443/","status":"Activating"}}' + headers: + cache-control: + - no-cache + content-length: + - '757' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:53:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-eventhub/3.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003?api-version=2017-04-01 + response: + body: + string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003","name":"cli-test-tsi-ehns000003","type":"Microsoft.EventHub/Namespaces","location":"West + US","tags":{},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590:cli-test-tsi-ehns000003","createdAt":"2020-04-23T08:53:26.513Z","updatedAt":"2020-04-23T08:54:13.757Z","serviceBusEndpoint":"https://cli-test-tsi-ehns000003.servicebus.windows.net:443/","status":"Active"}}' + headers: + cache-control: + - no-cache + content-length: + - '755' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:32 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-eventhub/3.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003?api-version=2017-04-01 + response: + body: + string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003","name":"cli-test-tsi-ehns000003","type":"Microsoft.EventHub/Namespaces","location":"West + US","tags":{},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590:cli-test-tsi-ehns000003","createdAt":"2020-04-23T08:53:26.513Z","updatedAt":"2020-04-23T08:54:13.757Z","serviceBusEndpoint":"https://cli-test-tsi-ehns000003.servicebus.windows.net:443/","status":"Active"}}' + headers: + cache-control: + - no-cache + content-length: + - '755' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:40 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs eventhub create + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --namespace-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-eventhub/3.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004?api-version=2017-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004","name":"cli-test-tsi-eh000004","type":"Microsoft.EventHub/Namespaces/EventHubs","location":"West + US","properties":{"messageRetentionInDays":7,"partitionCount":4,"status":"Active","createdAt":"2020-04-23T08:54:43.85Z","updatedAt":"2020-04-23T08:54:44.367Z","partitionIds":["0","1","2","3"]}}' + headers: + cache-control: + - no-cache + content-length: + - '544' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1191' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs namespace authorization-rule keys list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --namespace-name -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-eventhub/3.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/AuthorizationRules/RootManageSharedAccessKey/listKeys?api-version=2017-04-01 + response: + body: + string: '{"primaryConnectionString":"Endpoint=sb://cli-test-tsi-ehns000003.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=EqhKj+SvaHDKWGT5sKKkAbofTWwoW1LBT1JOmBiveRM=","secondaryConnectionString":"Endpoint=sb://cli-test-tsi-ehns000003.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=A/3CAuapkQ9VWa+4a0Q9zDd3CCJ2k4YNWFBX2m+WCmQ=","primaryKey":"EqhKj+SvaHDKWGT5sKKkAbofTWwoW1LBT1JOmBiveRM=","secondaryKey":"A/3CAuapkQ9VWa+4a0Q9zDd3CCJ2k4YNWFBX2m+WCmQ=","keyName":"RootManageSharedAccessKey"}' + headers: + cache-control: + - no-cache + content-length: + - '559' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:46 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source eventhub create + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name --name --key-name --shared-access-key --event-source-resource-id + --consumer-group-name --timestamp-property-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:47 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: 'b''{"location": "westus", "kind": "Microsoft.EventHub", "properties": {"timestampPropertyName": + "DeviceId", "eventSourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004", + "serviceBusNamespace": "cli-test-tsi-ehns000003", "eventHubName": "cli-test-tsi-eh000004", + "consumerGroupName": "$Default", "keyName": "RootManageSharedAccessKey", "sharedAccessKey": + "EqhKj+SvaHDKWGT5sKKkAbofTWwoW1LBT1JOmBiveRM="}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source eventhub create + Connection: + - keep-alive + Content-Length: + - '611' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --key-name --shared-access-key --event-source-resource-id + --consumer-group-name --timestamp-property-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.EventHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004","serviceBusNamespace":"cli-test-tsi-ehns000003","eventHubName":"cli-test-tsi-eh000004","consumerGroupName":"$Default","keyName":"RootManageSharedAccessKey","creationTime":"Thu, + 23 Apr 2020 08:54:53 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '982' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1197' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"timestampPropertyName": "DeviceId1"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source eventhub update + Connection: + - keep-alive + Content-Length: + - '54' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --timestamp-property-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.EventHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004","serviceBusNamespace":"cli-test-tsi-ehns000003","eventHubName":"cli-test-tsi-eh000004","consumerGroupName":"$Default","keyName":"RootManageSharedAccessKey","creationTime":"Thu, + 23 Apr 2020 08:54:53 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '983' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:56 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1196' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"localTimestamp": {"format": "Embedded"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source eventhub update + Connection: + - keep-alive + Content-Length: + - '58' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --local-timestamp-format + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.EventHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004","serviceBusNamespace":"cli-test-tsi-ehns000003","eventHubName":"cli-test-tsi-eh000004","consumerGroupName":"$Default","keyName":"RootManageSharedAccessKey","creationTime":"Thu, + 23 Apr 2020 08:54:53 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '1044' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1192' + status: + code: 200 + message: OK +- request: + body: '{"keyType": "PrimaryKey"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs namespace authorization-rule keys renew + Connection: + - keep-alive + Content-Length: + - '25' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --namespace-name -n --key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-eventhub/3.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/AuthorizationRules/RootManageSharedAccessKey/regenerateKeys?api-version=2017-04-01 + response: + body: + string: '{"primaryConnectionString":"Endpoint=sb://cli-test-tsi-ehns000003.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=R7iSQjfokTcwmtsi2uqaxVO/8I6Br8wX8GrxFJ3NmqE=","secondaryConnectionString":"Endpoint=sb://cli-test-tsi-ehns000003.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=A/3CAuapkQ9VWa+4a0Q9zDd3CCJ2k4YNWFBX2m+WCmQ=","primaryKey":"R7iSQjfokTcwmtsi2uqaxVO/8I6Br8wX8GrxFJ3NmqE=","secondaryKey":"A/3CAuapkQ9VWa+4a0Q9zDd3CCJ2k4YNWFBX2m+WCmQ=","keyName":"RootManageSharedAccessKey"}' + headers: + cache-control: + - no-cache + content-length: + - '559' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:55:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + 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' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"sharedAccessKey": "R7iSQjfokTcwmtsi2uqaxVO/8I6Br8wX8GrxFJ3NmqE="}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source eventhub update + Connection: + - keep-alive + Content-Length: + - '83' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --shared-access-key + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.EventHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004","serviceBusNamespace":"cli-test-tsi-ehns000003","eventHubName":"cli-test-tsi-eh000004","consumerGroupName":"$Default","keyName":"RootManageSharedAccessKey","creationTime":"Thu, + 23 Apr 2020 08:54:53 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '1044' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:55:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1191' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source list + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventSources?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"kind":"Microsoft.EventHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004","serviceBusNamespace":"cli-test-tsi-ehns000003","eventHubName":"cli-test-tsi-eh000004","consumerGroupName":"$Default","keyName":"RootManageSharedAccessKey","creationTime":"Thu, + 23 Apr 2020 08:54:53 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}]}' + headers: + cache-control: + - no-cache + content-length: + - '1056' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:55:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source show + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.EventHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004","serviceBusNamespace":"cli-test-tsi-ehns000003","eventHubName":"cli-test-tsi-eh000004","consumerGroupName":"$Default","keyName":"RootManageSharedAccessKey","creationTime":"Thu, + 23 Apr 2020 08:54:53 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '1044' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:55:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --environment-name -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 08:55:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 200 + message: OK +version: 1 diff --git a/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_event_source_iothub.yaml b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_event_source_iothub.yaml new file mode 100644 index 00000000000..65b7b15faaa --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_event_source_iothub.yaml @@ -0,0 +1,1501 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:52:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "sku": {"name": "S1", "capacity": 1}, "kind": "Standard", + "properties": {"dataRetentionTime": "P31D", "storageLimitExceededBehavior": + "PauseIngress", "partitionKeyProperties": [{"name": "DeviceId1", "type": "String"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + Content-Length: + - '242' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"2020-04-23T08:52:52+00:00","provisioningState":"Accepted","dataAccessId":"e366c607-9592-48f9-9f57-c274fd9787df","dataAccessFqdn":"e366c607-9592-48f9-9f57-c274fd9787df.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004","name":"cli-test-tsi-env000004","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '798' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:52:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1191' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:52 GMT","provisioningState":"Creating","requestApiVersion":"2018-08-15-preview","dataAccessId":"e366c607-9592-48f9-9f57-c274fd9787df","dataAccessFqdn":"e366c607-9592-48f9-9f57-c274fd9787df.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004","name":"cli-test-tsi-env000004","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '802' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:52 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"e366c607-9592-48f9-9f57-c274fd9787df","dataAccessFqdn":"e366c607-9592-48f9-9f57-c274fd9787df.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004","name":"cli-test-tsi-env000004","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '803' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"name": "cli-test-tsi-iothub000003"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + Content-Length: + - '36' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/checkNameAvailability?api-version=2019-07-01-preview + response: + body: + string: '{"nameAvailable":true,"reason":"Invalid","message":null}' + headers: + cache-control: + - no-cache + content-length: + - '56' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:53:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "properties": {"eventHubEndpoints": {"events": {"retentionTimeInDays": + 1, "partitionCount": 4}}, "storageEndpoints": {"$default": {"sasTtlAsIso8601": + "PT1H", "connectionString": "", "containerName": ""}}, "messagingEndpoints": + {"fileNotifications": {"ttlAsIso8601": "PT1H", "maxDeliveryCount": 10}}, "enableFileUploadNotifications": + false, "cloudToDevice": {"maxDeliveryCount": 10, "defaultTtlAsIso8601": "PT1H", + "feedback": {"lockDurationAsIso8601": "PT5S", "ttlAsIso8601": "PT1H", "maxDeliveryCount": + 10}}}, "sku": {"name": "S1", "capacity": 1}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + Content-Length: + - '570' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003?api-version=2019-07-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","name":"cli-test-tsi-iothub000003","type":"Microsoft.Devices/IotHubs","location":"westus","tags":{},"subscriptionid":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","resourcegroup":"cli_test_timeseriesinsights000001","properties":{"state":"Activating","provisioningState":"Accepted","eventHubEndpoints":{"events":{"retentionTimeInDays":1,"partitionCount":4},"operationsMonitoringEvents":{"retentionTimeInDays":1,"partitionCount":4}},"storageEndpoints":{"$default":{"sasTtlAsIso8601":"PT1H","connectionString":"","containerName":""}},"messagingEndpoints":{"fileNotifications":{"lockDurationAsIso8601":"PT1M","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"enableFileUploadNotifications":false,"cloudToDevice":{"maxDeliveryCount":10,"defaultTtlAsIso8601":"PT1H","feedback":{"lockDurationAsIso8601":"PT5S","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"features":"None"},"sku":{"name":"S1","tier":"Standard","capacity":1}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/operationResults/b3NfaWhfNzgwYTc0ZWItODMwZS00NmNmLThiMzEtYTEzNTE2ZjIwZDYw?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo + cache-control: + - no-cache + content-length: + - '1162' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:09 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '4999' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/operationResults/b3NfaWhfNzgwYTc0ZWItODMwZS00NmNmLThiMzEtYTEzNTE2ZjIwZDYw?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:41 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/operationResults/b3NfaWhfNzgwYTc0ZWItODMwZS00NmNmLThiMzEtYTEzNTE2ZjIwZDYw?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:55:11 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/operationResults/b3NfaWhfNzgwYTc0ZWItODMwZS00NmNmLThiMzEtYTEzNTE2ZjIwZDYw?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:55:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/operationResults/b3NfaWhfNzgwYTc0ZWItODMwZS00NmNmLThiMzEtYTEzNTE2ZjIwZDYw?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003?api-version=2019-07-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","name":"cli-test-tsi-iothub000003","type":"Microsoft.Devices/IotHubs","location":"westus","tags":{},"subscriptionid":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","resourcegroup":"cli_test_timeseriesinsights000001","etag":"AAAAAA0HLQ8=","properties":{"locations":[{"location":"West + US","role":"primary"},{"location":"East US","role":"secondary"}],"state":"Active","provisioningState":"Succeeded","ipFilterRules":[],"hostName":"cli-test-tsi-iothub000003.azure-devices.net","eventHubEndpoints":{"events":{"retentionTimeInDays":1,"partitionCount":4,"partitionIds":["0","1","2","3"],"path":"cli-test-tsi-iothub000003","endpoint":"sb://iothub-ns-cli-test-t-3301249-4bb741b8fe.servicebus.windows.net/"}},"routing":{"endpoints":{"serviceBusQueues":[],"serviceBusTopics":[],"eventHubs":[],"storageContainers":[]},"routes":[],"fallbackRoute":{"name":"$fallback","source":"DeviceMessages","condition":"true","endpointNames":["events"],"isEnabled":true}},"storageEndpoints":{"$default":{"sasTtlAsIso8601":"PT1H","connectionString":"","containerName":""}},"messagingEndpoints":{"fileNotifications":{"lockDurationAsIso8601":"PT1M","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"enableFileUploadNotifications":false,"cloudToDevice":{"maxDeliveryCount":10,"defaultTtlAsIso8601":"PT1H","feedback":{"lockDurationAsIso8601":"PT5S","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"features":"None"},"sku":{"name":"S1","tier":"Standard","capacity":1}}' + headers: + cache-control: + - no-cache + content-length: + - '1673' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --hub-name --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003/listkeys?api-version=2019-07-01-preview + response: + body: + string: '{"value":[{"keyName":"iothubowner","primaryKey":"TDulTUXa7mEtEL0wtQM6C4yKUJNwW6EB49ZjRMTHwnI=","secondaryKey":"PeBGGf/IiiQo23hAxASRJlJqQrqyJ1PXdpfdF+MMU9M=","rights":"RegistryWrite, + ServiceConnect, DeviceConnect"},{"keyName":"service","primaryKey":"dQLAouEOJHUz4KBBkmvhaWFEIkWZ4COrAR+NfVtD96U=","secondaryKey":"3JYW+ZuAtVmilPaqd/Vt/mTPW7yJatMpOidVbVuGWLk=","rights":"ServiceConnect"},{"keyName":"device","primaryKey":"qlEod871Un0IBPBYkljGGFCmSN/ntvc64tRyoVpdaIY=","secondaryKey":"c3BEZTAUoS8cypUbUSUjxCSFtJ9+lGdHqw1hNsZCAqs=","rights":"DeviceConnect"},{"keyName":"registryRead","primaryKey":"GywrLHwOJeigEL5K2h+2bZSk81NG8CsyigNy7durJzs=","secondaryKey":"eRPuE4ZLe4f27RgmKgaBcvP88rk2ipGw9Oohb4B4Ntk=","rights":"RegistryRead"},{"keyName":"registryReadWrite","primaryKey":"JiBa7tsVjJxH1s/WOdSDsGFpJ4xorALBZfHX1rPGtI0=","secondaryKey":"HH/9rpib42v1SwTURYc6mnS2fs3f+mU48ijF+oBgCKY=","rights":"RegistryWrite"}]}' + headers: + cache-control: + - no-cache + content-length: + - '905' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1197' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source iothub create + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name --name --consumer-group-name --key-name --shared-access-key + --event-source-resource-id --timestamp-property-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: 'b''{"location": "westus", "kind": "Microsoft.IoTHub", "properties": {"timestampPropertyName": + "DeviceId", "eventSourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003", + "iotHubName": "cli-test-tsi-iothub000003", "consumerGroupName": "$Default", + "keyName": "iothubowner", "sharedAccessKey": "TDulTUXa7mEtEL0wtQM6C4yKUJNwW6EB49ZjRMTHwnI="}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source iothub create + Connection: + - keep-alive + Content-Length: + - '503' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --consumer-group-name --key-name --shared-access-key + --event-source-resource-id --timestamp-property-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.IoTHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","iotHubName":"cli-test-tsi-iothub000003","consumerGroupName":"$Default","keyName":"iothubowner","creationTime":"Thu, + 23 Apr 2020 08:56:26 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '876' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:56:27 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1191' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"timestampPropertyName": "DeviceId1"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source iothub update + Connection: + - keep-alive + Content-Length: + - '54' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --timestamp-property-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.IoTHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","iotHubName":"cli-test-tsi-iothub000003","consumerGroupName":"$Default","keyName":"iothubowner","creationTime":"Thu, + 23 Apr 2020 08:56:26 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '877' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:56:31 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1196' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"localTimestamp": {"format": "Embedded"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source iothub update + Connection: + - keep-alive + Content-Length: + - '58' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --local-timestamp-format + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.IoTHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","iotHubName":"cli-test-tsi-iothub000003","consumerGroupName":"$Default","keyName":"iothubowner","creationTime":"Thu, + 23 Apr 2020 08:56:26 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '938' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:56:34 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1193' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: HEAD + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 08:56:35 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: '{"name": "cli-test-tsi-iothub000003"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + Content-Length: + - '36' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/checkNameAvailability?api-version=2019-07-01-preview + response: + body: + string: '{"nameAvailable":false,"reason":"AlreadyExists","message":"IotHub name + ''cli-test-tsi-iothub000003'' is not available"}' + headers: + cache-control: + - no-cache + content-length: + - '116' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:36 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003?api-version=2019-07-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","name":"cli-test-tsi-iothub000003","type":"Microsoft.Devices/IotHubs","location":"westus","tags":{},"subscriptionid":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","resourcegroup":"cli_test_timeseriesinsights000001","etag":"AAAAAA0HLQ8=","properties":{"locations":[{"location":"West + US","role":"primary"},{"location":"East US","role":"secondary"}],"state":"Active","provisioningState":"Succeeded","ipFilterRules":[],"hostName":"cli-test-tsi-iothub000003.azure-devices.net","eventHubEndpoints":{"events":{"retentionTimeInDays":1,"partitionCount":4,"partitionIds":["0","1","2","3"],"path":"cli-test-tsi-iothub000003","endpoint":"sb://iothub-ns-cli-test-t-3301249-4bb741b8fe.servicebus.windows.net/"}},"routing":{"endpoints":{"serviceBusQueues":[],"serviceBusTopics":[],"eventHubs":[],"storageContainers":[]},"routes":[],"fallbackRoute":{"name":"$fallback","source":"DeviceMessages","condition":"true","endpointNames":["events"],"isEnabled":true}},"storageEndpoints":{"$default":{"sasTtlAsIso8601":"PT1H","connectionString":"","containerName":""}},"messagingEndpoints":{"fileNotifications":{"lockDurationAsIso8601":"PT1M","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"enableFileUploadNotifications":false,"cloudToDevice":{"maxDeliveryCount":10,"defaultTtlAsIso8601":"PT1H","feedback":{"lockDurationAsIso8601":"PT5S","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"features":"None"},"sku":{"name":"S1","tier":"Standard","capacity":1}}' + headers: + cache-control: + - no-cache + content-length: + - '1673' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:37 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003/listkeys?api-version=2019-07-01-preview + response: + body: + string: '{"value":[{"keyName":"iothubowner","primaryKey":"TDulTUXa7mEtEL0wtQM6C4yKUJNwW6EB49ZjRMTHwnI=","secondaryKey":"PeBGGf/IiiQo23hAxASRJlJqQrqyJ1PXdpfdF+MMU9M=","rights":"RegistryWrite, + ServiceConnect, DeviceConnect"},{"keyName":"service","primaryKey":"dQLAouEOJHUz4KBBkmvhaWFEIkWZ4COrAR+NfVtD96U=","secondaryKey":"3JYW+ZuAtVmilPaqd/Vt/mTPW7yJatMpOidVbVuGWLk=","rights":"ServiceConnect"},{"keyName":"device","primaryKey":"qlEod871Un0IBPBYkljGGFCmSN/ntvc64tRyoVpdaIY=","secondaryKey":"c3BEZTAUoS8cypUbUSUjxCSFtJ9+lGdHqw1hNsZCAqs=","rights":"DeviceConnect"},{"keyName":"registryRead","primaryKey":"GywrLHwOJeigEL5K2h+2bZSk81NG8CsyigNy7durJzs=","secondaryKey":"eRPuE4ZLe4f27RgmKgaBcvP88rk2ipGw9Oohb4B4Ntk=","rights":"RegistryRead"},{"keyName":"registryReadWrite","primaryKey":"JiBa7tsVjJxH1s/WOdSDsGFpJ4xorALBZfHX1rPGtI0=","secondaryKey":"HH/9rpib42v1SwTURYc6mnS2fs3f+mU48ijF+oBgCKY=","rights":"RegistryWrite"}]}' + headers: + cache-control: + - no-cache + content-length: + - '905' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:37 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1197' + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "tags": {}, "etag": "AAAAAA0HLQ8=", "properties": + {"authorizationPolicies": [{"keyName": "service", "primaryKey": "dQLAouEOJHUz4KBBkmvhaWFEIkWZ4COrAR+NfVtD96U=", + "secondaryKey": "3JYW+ZuAtVmilPaqd/Vt/mTPW7yJatMpOidVbVuGWLk=", "rights": "ServiceConnect"}, + {"keyName": "device", "primaryKey": "qlEod871Un0IBPBYkljGGFCmSN/ntvc64tRyoVpdaIY=", + "secondaryKey": "c3BEZTAUoS8cypUbUSUjxCSFtJ9+lGdHqw1hNsZCAqs=", "rights": "DeviceConnect"}, + {"keyName": "registryRead", "primaryKey": "GywrLHwOJeigEL5K2h+2bZSk81NG8CsyigNy7durJzs=", + "secondaryKey": "eRPuE4ZLe4f27RgmKgaBcvP88rk2ipGw9Oohb4B4Ntk=", "rights": "RegistryRead"}, + {"keyName": "registryReadWrite", "primaryKey": "JiBa7tsVjJxH1s/WOdSDsGFpJ4xorALBZfHX1rPGtI0=", + "secondaryKey": "HH/9rpib42v1SwTURYc6mnS2fs3f+mU48ijF+oBgCKY=", "rights": "RegistryWrite"}, + {"keyName": "iothubowner", "primaryKey": "T1syLFUsG1NZG2hgVjkQZ28aLC4mbQ91HGpkdlRxeVc=", + "secondaryKey": "PeBGGf/IiiQo23hAxASRJlJqQrqyJ1PXdpfdF+MMU9M=", "rights": "RegistryWrite, + ServiceConnect, DeviceConnect"}], "ipFilterRules": [], "eventHubEndpoints": + {"events": {"retentionTimeInDays": 1, "partitionCount": 4}}, "routing": {"endpoints": + {"serviceBusQueues": [], "serviceBusTopics": [], "eventHubs": [], "storageContainers": + []}, "routes": [], "fallbackRoute": {"name": "$fallback", "source": "DeviceMessages", + "condition": "true", "endpointNames": ["events"], "isEnabled": true}}, "storageEndpoints": + {"$default": {"sasTtlAsIso8601": "PT1H", "connectionString": "", "containerName": + ""}}, "messagingEndpoints": {"fileNotifications": {"lockDurationAsIso8601": + "PT1M", "ttlAsIso8601": "PT1H", "maxDeliveryCount": 10}}, "enableFileUploadNotifications": + false, "cloudToDevice": {"maxDeliveryCount": 10, "defaultTtlAsIso8601": "PT1H", + "feedback": {"lockDurationAsIso8601": "PT5S", "ttlAsIso8601": "PT1H", "maxDeliveryCount": + 10}}, "features": "None"}, "sku": {"name": "S1", "capacity": 1}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + Content-Length: + - '1910' + Content-Type: + - application/json; charset=utf-8 + If-Match: + - '{''IF-MATCH'': ''AAAAAA0HLQ8=''}' + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003?api-version=2019-07-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","name":"cli-test-tsi-iothub000003","type":"Microsoft.Devices/IotHubs","location":"westus","tags":{},"subscriptionid":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","resourcegroup":"cli_test_timeseriesinsights000001","etag":"AAAAAA0HLQ8=","properties":{"operationsMonitoringProperties":{"events":{"None":"None","Connections":"None","DeviceTelemetry":"None","C2DCommands":"None","DeviceIdentityOperations":"None","FileUploadOperations":"None","Routes":"None"}},"provisioningState":"Accepted","authorizationPolicies":[{"keyName":"service","primaryKey":"dQLAouEOJHUz4KBBkmvhaWFEIkWZ4COrAR+NfVtD96U=","secondaryKey":"3JYW+ZuAtVmilPaqd/Vt/mTPW7yJatMpOidVbVuGWLk=","rights":"ServiceConnect"},{"keyName":"device","primaryKey":"qlEod871Un0IBPBYkljGGFCmSN/ntvc64tRyoVpdaIY=","secondaryKey":"c3BEZTAUoS8cypUbUSUjxCSFtJ9+lGdHqw1hNsZCAqs=","rights":"DeviceConnect"},{"keyName":"registryRead","primaryKey":"GywrLHwOJeigEL5K2h+2bZSk81NG8CsyigNy7durJzs=","secondaryKey":"eRPuE4ZLe4f27RgmKgaBcvP88rk2ipGw9Oohb4B4Ntk=","rights":"RegistryRead"},{"keyName":"registryReadWrite","primaryKey":"JiBa7tsVjJxH1s/WOdSDsGFpJ4xorALBZfHX1rPGtI0=","secondaryKey":"HH/9rpib42v1SwTURYc6mnS2fs3f+mU48ijF+oBgCKY=","rights":"RegistryWrite"},{"keyName":"iothubowner","primaryKey":"T1syLFUsG1NZG2hgVjkQZ28aLC4mbQ91HGpkdlRxeVc=","secondaryKey":"PeBGGf/IiiQo23hAxASRJlJqQrqyJ1PXdpfdF+MMU9M=","rights":"RegistryWrite, + ServiceConnect, DeviceConnect"}],"ipFilterRules":[],"eventHubEndpoints":{"events":{"retentionTimeInDays":1,"partitionCount":4},"operationsMonitoringEvents":{"retentionTimeInDays":1,"partitionCount":4,"partitionIds":["0","1","2","3"],"path":"cli-test-tsi-iothub000003-operationmonitoring","endpoint":"sb://iothub-ns-cli-test-t-3301249-4bb741b8fe.servicebus.windows.net/","internalAuthorizationPolicies":[{"KeyName":"scaleunitsend-14987bca-fb0e-40ec-bf21-84cfca6aa1b0-iothub","PrimaryKey":"wbPTKsgPj/vxNaqtZOPayqvOr0ohIgfTgN66If90t/M=","SecondaryKey":"FmtNTVqiTKH75wu2b1MTYjHQjjRANjvrcHmUw25bF+M=","ClaimType":"SharedAccessKey","ClaimValue":"None","Rights":["Send"],"CreatedTime":"Thu, + 23 Apr 2020 08:56:08 GMT","ModifiedTime":"Thu, 23 Apr 2020 08:56:08 GMT"},{"KeyName":"owner-fb1dd4e5-3660-46a9-a75b-64426209f281-iothub","PrimaryKey":"srCLf/teUitR2iNzCFFE23+ueEIWdVmwjpFRHbnyZNY=","SecondaryKey":"69u1coU+p9T7PpzyciVJUIy6u2fbPC9iTciu6kVdMNk=","ClaimType":"SharedAccessKey","ClaimValue":"None","Rights":["Listen","Manage","Send"],"CreatedTime":"Thu, + 23 Apr 2020 08:56:08 GMT","ModifiedTime":"Thu, 23 Apr 2020 08:56:08 GMT"}],"authorizationPolicies":[{"KeyName":"iothubowner","PrimaryKey":"TDulTUXa7mEtEL0wtQM6C4yKUJNwW6EB49ZjRMTHwnI=","SecondaryKey":"PeBGGf/IiiQo23hAxASRJlJqQrqyJ1PXdpfdF+MMU9M=","ClaimType":"SharedAccessKey","ClaimValue":"None","Rights":["Listen"],"CreatedTime":"Thu, + 23 Apr 2020 08:56:08 GMT","ModifiedTime":"Thu, 23 Apr 2020 08:56:08 GMT"},{"KeyName":"service","PrimaryKey":"dQLAouEOJHUz4KBBkmvhaWFEIkWZ4COrAR+NfVtD96U=","SecondaryKey":"3JYW+ZuAtVmilPaqd/Vt/mTPW7yJatMpOidVbVuGWLk=","ClaimType":"SharedAccessKey","ClaimValue":"None","Rights":["Listen"],"CreatedTime":"Thu, + 23 Apr 2020 08:56:08 GMT","ModifiedTime":"Thu, 23 Apr 2020 08:56:08 GMT"}]}},"routing":{"endpoints":{"serviceBusQueues":[],"serviceBusTopics":[],"eventHubs":[],"storageContainers":[]},"routes":[],"fallbackRoute":{"name":"$fallback","source":"DeviceMessages","condition":"true","endpointNames":["events"],"isEnabled":true}},"storageEndpoints":{"$default":{"sasTtlAsIso8601":"PT1H","connectionString":"","containerName":""}},"messagingEndpoints":{"fileNotifications":{"lockDurationAsIso8601":"PT1M","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"enableFileUploadNotifications":false,"cloudToDevice":{"maxDeliveryCount":10,"defaultTtlAsIso8601":"PT1H","feedback":{"lockDurationAsIso8601":"PT5S","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"features":"None"},"sku":{"name":"S1","tier":"Standard","capacity":1}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/operationResults/b3NfaWhfNWIzODBjNTctYjIzNy00N2EwLTg3NmYtMGZlMmEzN2E4OGJl?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo + cache-control: + - no-cache + content-length: + - '4122' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '4999' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/operationResults/b3NfaWhfNWIzODBjNTctYjIzNy00N2EwLTg3NmYtMGZlMmEzN2E4OGJl?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:57:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003?api-version=2019-07-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","name":"cli-test-tsi-iothub000003","type":"Microsoft.Devices/IotHubs","location":"westus","tags":{},"subscriptionid":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","resourcegroup":"cli_test_timeseriesinsights000001","etag":"AAAAAA0HLgM=","properties":{"locations":[{"location":"West + US","role":"primary"},{"location":"East US","role":"secondary"}],"state":"Active","provisioningState":"Succeeded","ipFilterRules":[],"hostName":"cli-test-tsi-iothub000003.azure-devices.net","eventHubEndpoints":{"events":{"retentionTimeInDays":1,"partitionCount":4,"partitionIds":["0","1","2","3"],"path":"cli-test-tsi-iothub000003","endpoint":"sb://iothub-ns-cli-test-t-3301249-4bb741b8fe.servicebus.windows.net/"}},"routing":{"endpoints":{"serviceBusQueues":[],"serviceBusTopics":[],"eventHubs":[],"storageContainers":[]},"routes":[],"fallbackRoute":{"name":"$fallback","source":"DeviceMessages","condition":"true","endpointNames":["events"],"isEnabled":true}},"storageEndpoints":{"$default":{"sasTtlAsIso8601":"PT1H","connectionString":"","containerName":""}},"messagingEndpoints":{"fileNotifications":{"lockDurationAsIso8601":"PT1M","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"enableFileUploadNotifications":false,"cloudToDevice":{"maxDeliveryCount":10,"defaultTtlAsIso8601":"PT1H","feedback":{"lockDurationAsIso8601":"PT5S","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"features":"None"},"sku":{"name":"S1","tier":"Standard","capacity":1}}' + headers: + cache-control: + - no-cache + content-length: + - '1673' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:57:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003/IotHubKeys/iothubowner/listkeys?api-version=2019-07-01-preview + response: + body: + string: '{"keyName":"iothubowner","primaryKey":"T1syLFUsG1NZG2hgVjkQZ28aLC4mbQ91HGpkdlRxeVc=","secondaryKey":"PeBGGf/IiiQo23hAxASRJlJqQrqyJ1PXdpfdF+MMU9M=","rights":"RegistryWrite, + ServiceConnect, DeviceConnect"}' + headers: + cache-control: + - no-cache + content-length: + - '203' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:57:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1196' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"sharedAccessKey": "T1syLFUsG1NZG2hgVjkQZ28aLC4mbQ91HGpkdlRxeVc="}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source iothub update + Connection: + - keep-alive + Content-Length: + - '83' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --shared-access-key + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.IoTHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","iotHubName":"cli-test-tsi-iothub000003","consumerGroupName":"$Default","keyName":"iothubowner","creationTime":"Thu, + 23 Apr 2020 08:56:26 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '938' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:57:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1190' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source list + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventSources?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"kind":"Microsoft.IoTHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","iotHubName":"cli-test-tsi-iothub000003","consumerGroupName":"$Default","keyName":"iothubowner","creationTime":"Thu, + 23 Apr 2020 08:56:26 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}]}' + headers: + cache-control: + - no-cache + content-length: + - '950' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:57:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source show + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.IoTHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","iotHubName":"cli-test-tsi-iothub000003","consumerGroupName":"$Default","keyName":"iothubowner","creationTime":"Thu, + 23 Apr 2020 08:56:26 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '938' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:57:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --environment-name -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 08:57:31 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 200 + message: OK +version: 1 diff --git a/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_reference_data_set.yaml b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_reference_data_set.yaml new file mode 100644 index 00000000000..f811211ad54 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_reference_data_set.yaml @@ -0,0 +1,506 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:52:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "sku": {"name": "S1", "capacity": 1}, "kind": "Standard", + "properties": {"dataRetentionTime": "P31D", "storageLimitExceededBehavior": + "PauseIngress", "partitionKeyProperties": [{"name": "DeviceId1", "type": "String"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + Content-Length: + - '242' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"2020-04-23T08:52:45+00:00","provisioningState":"Accepted","dataAccessId":"19d80b62-5ad8-413d-b006-9a81ba3dd670","dataAccessFqdn":"19d80b62-5ad8-413d-b006-9a81ba3dd670.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '798' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:52:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1192' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:45 GMT","provisioningState":"Creating","requestApiVersion":"2018-08-15-preview","dataAccessId":"19d80b62-5ad8-413d-b006-9a81ba3dd670","dataAccessFqdn":"19d80b62-5ad8-413d-b006-9a81ba3dd670.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '802' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:45 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"19d80b62-5ad8-413d-b006-9a81ba3dd670","dataAccessFqdn":"19d80b62-5ad8-413d-b006-9a81ba3dd670.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '803' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:01 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights reference-data-set create + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name --name --key-properties --data-string-comparison-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:03 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "properties": {"keyProperties": [{"name": "DeviceId1", + "type": "String"}, {"name": "DeviceFloor", "type": "Double"}], "dataStringComparisonBehavior": + "Ordinal"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights reference-data-set create + Connection: + - keep-alive + Content-Length: + - '184' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --key-properties --data-string-comparison-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002?api-version=2018-08-15-preview + response: + body: + string: '{"location":"westus","tags":null,"properties":{"keyProperties":[{"name":"DeviceId1","type":"String"},{"name":"DeviceFloor","type":"Double"}],"dataStringComparisonBehavior":"Ordinal","creationTime":"Thu, + 23 Apr 2020 08:54:10 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002","name":"clitesttsirds000002","type":"Microsoft.TimeSeriesInsights/Environments/ReferenceDataSets"}' + headers: + cache-control: + - no-cache + content-length: + - '635' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:11 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1197' + status: + code: 200 + message: OK +- request: + body: '{"tags": {"mykey": "myvalue"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights reference-data-set update + Connection: + - keep-alive + Content-Length: + - '30' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --tags + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002?api-version=2018-08-15-preview + response: + body: + string: '{"location":"westus","tags":{"mykey":"myvalue"},"properties":{"keyProperties":[{"name":"DeviceId1","type":"String"},{"name":"DeviceFloor","type":"Double"}],"dataStringComparisonBehavior":"Ordinal","creationTime":"Thu, + 23 Apr 2020 08:54:10 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002","name":"clitesttsirds000002","type":"Microsoft.TimeSeriesInsights/Environments/ReferenceDataSets"}' + headers: + cache-control: + - no-cache + content-length: + - '650' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.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: + - '1195' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights reference-data-set list + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"location":"westus","tags":{"mykey":"myvalue"},"properties":{"keyProperties":[{"name":"DeviceId1","type":"String"},{"name":"DeviceFloor","type":"Double"}],"dataStringComparisonBehavior":"Ordinal","creationTime":"Thu, + 23 Apr 2020 08:54:10 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002","name":"clitesttsirds000002","type":"Microsoft.TimeSeriesInsights/Environments/ReferenceDataSets"}]}' + headers: + cache-control: + - no-cache + content-length: + - '662' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:18 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights reference-data-set show + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002?api-version=2018-08-15-preview + response: + body: + string: '{"location":"westus","tags":{"mykey":"myvalue"},"properties":{"keyProperties":[{"name":"DeviceId1","type":"String"},{"name":"DeviceFloor","type":"Double"}],"dataStringComparisonBehavior":"Ordinal","creationTime":"Thu, + 23 Apr 2020 08:54:10 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002","name":"clitesttsirds000002","type":"Microsoft.TimeSeriesInsights/Environments/ReferenceDataSets"}' + headers: + cache-control: + - no-cache + content-length: + - '650' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights reference-data-set delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --environment-name -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002?api-version=2018-08-15-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 08:54:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/test_timeseriesinsights_scenario.py b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/test_timeseriesinsights_scenario.py new file mode 100644 index 00000000000..d9ef25a84a1 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/test_timeseriesinsights_scenario.py @@ -0,0 +1,262 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +import time +from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class TimeSeriesInsightsClientScenarioTest(ScenarioTest): + + def _create_timeseriesinsights_environment(self): + self.kwargs.update({ + 'env': self.create_random_name('cli-test-tsi-env', 24), + }) + # Create an environment with the name of {env}. Similar to + # https://github.com/Azure/azure-cli/blob/31a9724478c67751ae0bee6cc0d9b75b763df17c/src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/test_keyvault_commands.py#L34 + return self.cmd('az timeseriesinsights environment standard create ' + '--resource-group {rg} ' + '--name {env} ' + '--sku-name S1 ' + '--sku-capacity 1 ' + '--data-retention-time 31 ' + '--partition-key-properties DeviceId1 ' + '--storage-limit-exceeded-behavior PauseIngress') + + @ResourceGroupPreparer(name_prefix='cli_test_timeseriesinsights') + def test_timeseriesinsights_environment_standard(self, resource_group): + self.kwargs.update({ + 'env': self.create_random_name('cli-test-tsi-env', 24), + }) + + # Test environment standard create + self.cmd('az timeseriesinsights environment standard create ' + '--resource-group {rg} ' + '--name {env} ' + '--sku-name S1 ' + '--sku-capacity 1 ' + '--data-retention-time 7 ' + '--partition-key-properties DeviceId1 ' + '--storage-limit-exceeded-behavior PauseIngress', + checks=[self.check('name', '{env}')]) + + self.cmd('az timeseriesinsights environment standard update --resource-group {rg} --name {env} --sku-name S1 --sku-capacity 2', + checks=[self.check('sku.capacity', '2')]) + + self.cmd('az timeseriesinsights environment standard update --resource-group {rg} --name {env} --data-retention-time 8', + checks=[self.check('dataRetentionTime', '8 days, 0:00:00')]) + + self.cmd('az timeseriesinsights environment standard update --resource-group {rg} --name {env} --storage-limit-exceeded-behavior PurgeOldData', + checks=[self.check('storageLimitExceededBehavior', 'PurgeOldData')]) + + self.cmd('az timeseriesinsights environment show ' + '--resource-group {rg} ' + '--name {env}', + checks=[self.check('name', '{env}')]) + + self.cmd('az timeseriesinsights environment list ' + '--resource-group {rg}', + checks=[self.check('length(@)', 1)]) + + self.cmd('az timeseriesinsights environment list', + checks=[self.check("length([?name=='{env}'])", 1)]) + + self.cmd('az timeseriesinsights environment delete ' + '--resource-group {rg} ' + '--name {env} --yes', + checks=[]) + + self.cmd('az timeseriesinsights environment list ' + '--resource-group {rg}', + checks=[self.check('length(@)', 0)]) + + @ResourceGroupPreparer(name_prefix='cli_test_timeseriesinsights') + @StorageAccountPreparer() + def test_timeseriesinsights_environment_longterm(self, resource_group, storage_account): + + self.kwargs.update({ + 'env': self.create_random_name('cli-test-tsi-env', 24), + }) + + # Test environment longterm create + key = self.cmd('az storage account keys list -g {rg} -n {sa} --query "[0].value" --output tsv').output + + self.cmd('az timeseriesinsights environment longterm create ' + '--resource-group {rg} ' + '--name {env} ' + '--sku-name L1 ' + '--sku-capacity 1 ' + '--data-retention 7 ' + '--time-series-id-properties DeviceId1 ' + '--storage-account-name {sa} ' + '--storage-management-key ' + key, + checks=[self.check('name', '{env}')]) + + self.cmd('az timeseriesinsights environment longterm update --resource-group {rg} --name {env} --data-retention 8', + checks=[self.check('dataRetention', '8 days, 0:00:00')]) + + time.sleep(60) + key = self.cmd('az storage account keys renew -g {rg} -n {sa} --key primary --query "[0].value" --output tsv').output + time.sleep(15) + self.cmd('az timeseriesinsights environment longterm update --resource-group {rg} --name {env} --storage-management-key ' + key, + checks=[]) + + @ResourceGroupPreparer(name_prefix='cli_test_timeseriesinsights') + def test_timeseriesinsights_event_source_eventhub(self, resource_group): + self.kwargs.update({ + 'es': self.create_random_name('cli-test-tsi-es', 24), # time series insights event source + 'ehns': self.create_random_name('cli-test-tsi-ehns', 24), # event hub namespace + 'eh': self.create_random_name('cli-test-tsi-eh', 24), # event hub + 'loc': 'westus' + }) + + self._create_timeseriesinsights_environment() + + # Create + + # Prepare the event hub + self.cmd('az eventhubs namespace create -g {rg} -n {ehns}') + result = self.cmd('az eventhubs eventhub create -g {rg} -n {eh} --namespace-name {ehns}').get_output_in_json() + self.kwargs["es_resource_id"] = result["id"] + result = self.cmd('az eventhubs namespace authorization-rule keys list -g {rg} --namespace-name {ehns} -n RootManageSharedAccessKey').get_output_in_json() + self.kwargs["shared_access_key"] = result["primaryKey"] + + self.cmd('az timeseriesinsights event-source eventhub create -g {rg} --environment-name {env} --name {es} ' + '--key-name RootManageSharedAccessKey ' + '--shared-access-key {shared_access_key} ' + '--event-source-resource-id {es_resource_id} ' + '--consumer-group-name $Default --timestamp-property-name DeviceId') + + self.cmd('az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} --name {es} ' + '--timestamp-property-name DeviceId1') + + # Currently only Embedded is supported + self.cmd('az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} --name {es} ' + '--local-timestamp-format Embedded') + + # Iana, TimeSpan + # self.cmd('az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} --name {es} ' + # '--local-timestamp-format Timespan --time-zone-offset-property-name Offset') + + # Renew a key + self.kwargs["shared_access_key"] = self.cmd('az eventhubs namespace authorization-rule keys renew -g {rg} --namespace-name {ehns} -n RootManageSharedAccessKey --key PrimaryKey --query primaryKey --output tsv').output + + self.cmd('az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} --name {es} --shared-access-key {shared_access_key}') + + # List + self.cmd('az timeseriesinsights event-source list -g {rg} --environment-name {env}', + checks=[self.check('length(@)', 1)]) + + # Show + self.cmd('az timeseriesinsights event-source show -g {rg} --environment-name {env} -n {es}') + + # Delete + self.cmd('az timeseriesinsights event-source delete -g {rg} --environment-name {env} -n {es} --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_timeseriesinsights') + def test_timeseriesinsights_event_source_iothub(self): + self.kwargs.update({ + 'es': self.create_random_name('cli-test-tsi-es', 24), # time series insights event source + 'iothub': self.create_random_name('cli-test-tsi-iothub', 24), # iot hub + 'loc': 'westus' + }) + + self._create_timeseriesinsights_environment() + + # Create + # Prepare the iot hub + result = self.cmd('az iot hub create -g {rg} -n {iothub}').get_output_in_json() + self.kwargs["es_resource_id"] = result["id"] + self.kwargs["key_name"] = "iothubowner" + self.kwargs["shared_access_key"] = self.cmd("az iot hub policy list -g {rg} --hub-name {iothub} --query \"[?keyName=='iothubowner']\".primaryKey --output tsv").output + + self.cmd('az timeseriesinsights event-source iothub create -g {rg} --environment-name {env} --name {es} ' + '--consumer-group-name $Default ' + '--key-name {key_name} --shared-access-key {shared_access_key} ' + '--event-source-resource-id {es_resource_id} --timestamp-property-name DeviceId') + + self.cmd('az timeseriesinsights event-source iothub update -g {rg} --environment-name {env} --name {es} ' + '--timestamp-property-name DeviceId1') + + # Currently only Embedded is supported + self.cmd('az timeseriesinsights event-source iothub update -g {rg} --environment-name {env} --name {es} ' + '--local-timestamp-format Embedded') + + # Iana, TimeSpan + # self.cmd('az timeseriesinsights event-source iothub update -g {rg} --environment-name {env} --name {es} ' + # '--local-timestamp-format Timespan --time-zone-offset-property-name Offset') + + self.kwargs["shared_access_key"] = self.cmd('az iot hub policy renew-key -g {rg} --hub-name {iothub} -n {key_name} --renew-key primary --query primaryKey --output tsv').output + + self.cmd('az timeseriesinsights event-source iothub update -g {rg} --environment-name {env} --name {es} ' + '--shared-access-key {shared_access_key}') + + # List + self.cmd('az timeseriesinsights event-source list -g {rg} --environment-name {env}', + checks=[self.check('length(@)', 1)]) + + # Show + self.cmd('az timeseriesinsights event-source show -g {rg} --environment-name {env} -n {es}') + + # Delete + self.cmd('az timeseriesinsights event-source delete -g {rg} --environment-name {env} -n {es} --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_timeseriesinsights') + def test_timeseriesinsights_reference_data_set(self): + self.kwargs.update({ + 'rds': self.create_random_name('clitesttsirds', 24), # time series insights event source + }) + + self._create_timeseriesinsights_environment() + + # Create + self.cmd('az timeseriesinsights reference-data-set create -g {rg} --environment-name {env} --name {rds} ' + '--key-properties DeviceId1 String DeviceFloor Double --data-string-comparison-behavior Ordinal') + + # Update + self.cmd('az timeseriesinsights reference-data-set update -g {rg} --environment-name {env} --name {rds} ' + '--tags mykey=myvalue') + + # List + self.cmd('az timeseriesinsights reference-data-set list -g {rg} --environment-name {env}', + checks=[self.check('length(@)', 1)]) + + # Show + self.cmd('az timeseriesinsights reference-data-set show -g {rg} --environment-name {env} -n {rds}') + + # Delete + self.cmd('az timeseriesinsights reference-data-set delete -g {rg} --environment-name {env} -n {rds} --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_timeseriesinsights') + def test_timeseriesinsights_access_policy(self): + self.kwargs.update({ + }) + + self._create_timeseriesinsights_environment() + + # Create + self.cmd('az timeseriesinsights access-policy create -g {rg} --environment-name {env} --name ap1 --principal-object-id 001 --description "some description" --roles Contributor Reader', + checks=[]) + + # Update + self.cmd('az timeseriesinsights access-policy update -g {rg} --environment-name {env} --name ap1 --description "some description updated"', + checks=[]) + + self.cmd('az timeseriesinsights access-policy update -g {rg} --environment-name {env} --name ap1 --roles Contributor', + checks=[]) + + # Show + self.cmd('az timeseriesinsights access-policy show -g {rg} --environment-name {env} --name ap1', + checks=[]) + # List + self.cmd('az timeseriesinsights access-policy list -g {rg} --environment-name {env}', + checks=[self.check('length(@)', 1)]) + + # Delete + self.cmd('az timeseriesinsights access-policy delete -g {rg} --environment-name {env} --name ap1 --yes', + checks=[]) diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/__init__.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/__init__.py new file mode 100644 index 00000000000..0260537a02b --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/__init__.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/__init__.py new file mode 100644 index 00000000000..b0a15d3e7f0 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._configuration import TimeSeriesInsightsClientConfiguration +from ._time_series_insights_client import TimeSeriesInsightsClient +__all__ = ['TimeSeriesInsightsClient', 'TimeSeriesInsightsClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/_configuration.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/_configuration.py new file mode 100644 index 00000000000..455a14ec7a5 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/_configuration.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class TimeSeriesInsightsClientConfiguration(AzureConfiguration): + """Configuration for TimeSeriesInsightsClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Azure Subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(TimeSeriesInsightsClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-timeseriesinsights/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/_time_series_insights_client.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/_time_series_insights_client.py new file mode 100644 index 00000000000..4eafa141d25 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/_time_series_insights_client.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import TimeSeriesInsightsClientConfiguration +from .operations import Operations +from .operations import EnvironmentsOperations +from .operations import EventSourcesOperations +from .operations import ReferenceDataSetsOperations +from .operations import AccessPoliciesOperations +from . import models + + +class TimeSeriesInsightsClient(SDKClient): + """Time Series Insights client + + :ivar config: Configuration for client. + :vartype config: TimeSeriesInsightsClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.timeseriesinsights.operations.Operations + :ivar environments: Environments operations + :vartype environments: azure.mgmt.timeseriesinsights.operations.EnvironmentsOperations + :ivar event_sources: EventSources operations + :vartype event_sources: azure.mgmt.timeseriesinsights.operations.EventSourcesOperations + :ivar reference_data_sets: ReferenceDataSets operations + :vartype reference_data_sets: azure.mgmt.timeseriesinsights.operations.ReferenceDataSetsOperations + :ivar access_policies: AccessPolicies operations + :vartype access_policies: azure.mgmt.timeseriesinsights.operations.AccessPoliciesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Azure Subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = TimeSeriesInsightsClientConfiguration(credentials, subscription_id, base_url) + super(TimeSeriesInsightsClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-08-15-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.environments = EnvironmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.event_sources = EventSourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.reference_data_sets = ReferenceDataSetsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.access_policies = AccessPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/__init__.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/__init__.py new file mode 100644 index 00000000000..5e36e3b855a --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/__init__.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AccessPolicyCreateOrUpdateParameters + from ._models_py3 import AccessPolicyListResponse + from ._models_py3 import AccessPolicyResource + from ._models_py3 import AccessPolicyUpdateParameters + from ._models_py3 import AzureEventSourceProperties + from ._models_py3 import CreateOrUpdateTrackedResourceProperties + from ._models_py3 import EnvironmentCreateOrUpdateParameters + from ._models_py3 import EnvironmentListResponse + from ._models_py3 import EnvironmentResource + from ._models_py3 import EnvironmentResourceProperties + from ._models_py3 import EnvironmentStateDetails + from ._models_py3 import EnvironmentStatus + from ._models_py3 import EnvironmentUpdateParameters + from ._models_py3 import EventHubEventSourceCommonProperties + from ._models_py3 import EventHubEventSourceCreateOrUpdateParameters + from ._models_py3 import EventHubEventSourceResource + from ._models_py3 import EventHubEventSourceUpdateParameters + from ._models_py3 import EventSourceCommonProperties + from ._models_py3 import EventSourceCreateOrUpdateParameters + from ._models_py3 import EventSourceListResponse + from ._models_py3 import EventSourceMutableProperties + from ._models_py3 import EventSourceResource + from ._models_py3 import EventSourceUpdateParameters + from ._models_py3 import IngressEnvironmentStatus + from ._models_py3 import IoTHubEventSourceCommonProperties + from ._models_py3 import IoTHubEventSourceCreateOrUpdateParameters + from ._models_py3 import IoTHubEventSourceResource + from ._models_py3 import IoTHubEventSourceUpdateParameters + from ._models_py3 import LocalTimestamp + from ._models_py3 import LocalTimestampTimeZoneOffset + from ._models_py3 import LongTermEnvironmentCreateOrUpdateParameters + from ._models_py3 import LongTermEnvironmentResource + from ._models_py3 import LongTermEnvironmentUpdateParameters + from ._models_py3 import LongTermStorageConfigurationInput + from ._models_py3 import LongTermStorageConfigurationMutableProperties + from ._models_py3 import LongTermStorageConfigurationOutput + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import ReferenceDataSetCreateOrUpdateParameters + from ._models_py3 import ReferenceDataSetKeyProperty + from ._models_py3 import ReferenceDataSetListResponse + from ._models_py3 import ReferenceDataSetResource + from ._models_py3 import ReferenceDataSetUpdateParameters + from ._models_py3 import Resource + from ._models_py3 import ResourceProperties + from ._models_py3 import Sku + from ._models_py3 import StandardEnvironmentCreateOrUpdateParameters + from ._models_py3 import StandardEnvironmentResource + from ._models_py3 import StandardEnvironmentUpdateParameters + from ._models_py3 import TimeSeriesIdProperty + from ._models_py3 import TrackedResource + from ._models_py3 import WarmStorageEnvironmentStatus +except (SyntaxError, ImportError): + from ._models import AccessPolicyCreateOrUpdateParameters + from ._models import AccessPolicyListResponse + from ._models import AccessPolicyResource + from ._models import AccessPolicyUpdateParameters + from ._models import AzureEventSourceProperties + from ._models import CreateOrUpdateTrackedResourceProperties + from ._models import EnvironmentCreateOrUpdateParameters + from ._models import EnvironmentListResponse + from ._models import EnvironmentResource + from ._models import EnvironmentResourceProperties + from ._models import EnvironmentStateDetails + from ._models import EnvironmentStatus + from ._models import EnvironmentUpdateParameters + from ._models import EventHubEventSourceCommonProperties + from ._models import EventHubEventSourceCreateOrUpdateParameters + from ._models import EventHubEventSourceResource + from ._models import EventHubEventSourceUpdateParameters + from ._models import EventSourceCommonProperties + from ._models import EventSourceCreateOrUpdateParameters + from ._models import EventSourceListResponse + from ._models import EventSourceMutableProperties + from ._models import EventSourceResource + from ._models import EventSourceUpdateParameters + from ._models import IngressEnvironmentStatus + from ._models import IoTHubEventSourceCommonProperties + from ._models import IoTHubEventSourceCreateOrUpdateParameters + from ._models import IoTHubEventSourceResource + from ._models import IoTHubEventSourceUpdateParameters + from ._models import LocalTimestamp + from ._models import LocalTimestampTimeZoneOffset + from ._models import LongTermEnvironmentCreateOrUpdateParameters + from ._models import LongTermEnvironmentResource + from ._models import LongTermEnvironmentUpdateParameters + from ._models import LongTermStorageConfigurationInput + from ._models import LongTermStorageConfigurationMutableProperties + from ._models import LongTermStorageConfigurationOutput + from ._models import Operation + from ._models import OperationDisplay + from ._models import ReferenceDataSetCreateOrUpdateParameters + from ._models import ReferenceDataSetKeyProperty + from ._models import ReferenceDataSetListResponse + from ._models import ReferenceDataSetResource + from ._models import ReferenceDataSetUpdateParameters + from ._models import Resource + from ._models import ResourceProperties + from ._models import Sku + from ._models import StandardEnvironmentCreateOrUpdateParameters + from ._models import StandardEnvironmentResource + from ._models import StandardEnvironmentUpdateParameters + from ._models import TimeSeriesIdProperty + from ._models import TrackedResource + from ._models import WarmStorageEnvironmentStatus +from ._paged_models import OperationPaged +from ._time_series_insights_client_enums import ( + ProvisioningState, + SkuName, + StorageLimitExceededBehavior, + PropertyType, + IngressState, + WarmStoragePropertiesState, + LocalTimestampFormat, + ReferenceDataKeyPropertyType, + DataStringComparisonBehavior, + AccessPolicyRole, +) + +__all__ = [ + 'AccessPolicyCreateOrUpdateParameters', + 'AccessPolicyListResponse', + 'AccessPolicyResource', + 'AccessPolicyUpdateParameters', + 'AzureEventSourceProperties', + 'CreateOrUpdateTrackedResourceProperties', + 'EnvironmentCreateOrUpdateParameters', + 'EnvironmentListResponse', + 'EnvironmentResource', + 'EnvironmentResourceProperties', + 'EnvironmentStateDetails', + 'EnvironmentStatus', + 'EnvironmentUpdateParameters', + 'EventHubEventSourceCommonProperties', + 'EventHubEventSourceCreateOrUpdateParameters', + 'EventHubEventSourceResource', + 'EventHubEventSourceUpdateParameters', + 'EventSourceCommonProperties', + 'EventSourceCreateOrUpdateParameters', + 'EventSourceListResponse', + 'EventSourceMutableProperties', + 'EventSourceResource', + 'EventSourceUpdateParameters', + 'IngressEnvironmentStatus', + 'IoTHubEventSourceCommonProperties', + 'IoTHubEventSourceCreateOrUpdateParameters', + 'IoTHubEventSourceResource', + 'IoTHubEventSourceUpdateParameters', + 'LocalTimestamp', + 'LocalTimestampTimeZoneOffset', + 'LongTermEnvironmentCreateOrUpdateParameters', + 'LongTermEnvironmentResource', + 'LongTermEnvironmentUpdateParameters', + 'LongTermStorageConfigurationInput', + 'LongTermStorageConfigurationMutableProperties', + 'LongTermStorageConfigurationOutput', + 'Operation', + 'OperationDisplay', + 'ReferenceDataSetCreateOrUpdateParameters', + 'ReferenceDataSetKeyProperty', + 'ReferenceDataSetListResponse', + 'ReferenceDataSetResource', + 'ReferenceDataSetUpdateParameters', + 'Resource', + 'ResourceProperties', + 'Sku', + 'StandardEnvironmentCreateOrUpdateParameters', + 'StandardEnvironmentResource', + 'StandardEnvironmentUpdateParameters', + 'TimeSeriesIdProperty', + 'TrackedResource', + 'WarmStorageEnvironmentStatus', + 'OperationPaged', + 'ProvisioningState', + 'SkuName', + 'StorageLimitExceededBehavior', + 'PropertyType', + 'IngressState', + 'WarmStoragePropertiesState', + 'LocalTimestampFormat', + 'ReferenceDataKeyPropertyType', + 'DataStringComparisonBehavior', + 'AccessPolicyRole', +] diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_models.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_models.py new file mode 100644 index 00000000000..2b70d8ff066 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_models.py @@ -0,0 +1,2241 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AccessPolicyCreateOrUpdateParameters(Model): + """AccessPolicyCreateOrUpdateParameters. + + :param principal_object_id: The objectId of the principal in Azure Active + Directory. + :type principal_object_id: str + :param description: An description of the access policy. + :type description: str + :param roles: The list of roles the principal is assigned on the + environment. + :type roles: list[str or + ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + """ + + _attribute_map = { + 'principal_object_id': {'key': 'properties.principalObjectId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AccessPolicyCreateOrUpdateParameters, self).__init__(**kwargs) + self.principal_object_id = kwargs.get('principal_object_id', None) + self.description = kwargs.get('description', None) + self.roles = kwargs.get('roles', None) + + +class AccessPolicyListResponse(Model): + """The response of the List access policies operation. + + :param value: Result of the List access policies operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.AccessPolicyResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AccessPolicyResource]'}, + } + + def __init__(self, **kwargs): + super(AccessPolicyListResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class Resource(Model): + """Time Series Insights resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AccessPolicyResource(Resource): + """An access policy is used to grant users and applications access to the + environment. Roles are assigned to service principals in Azure Active + Directory. These roles define the actions the principal can perform through + the Time Series Insights data plane APIs. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param principal_object_id: The objectId of the principal in Azure Active + Directory. + :type principal_object_id: str + :param description: An description of the access policy. + :type description: str + :param roles: The list of roles the principal is assigned on the + environment. + :type roles: list[str or + ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'principal_object_id': {'key': 'properties.principalObjectId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AccessPolicyResource, self).__init__(**kwargs) + self.principal_object_id = kwargs.get('principal_object_id', None) + self.description = kwargs.get('description', None) + self.roles = kwargs.get('roles', None) + + +class AccessPolicyUpdateParameters(Model): + """AccessPolicyUpdateParameters. + + :param description: An description of the access policy. + :type description: str + :param roles: The list of roles the principal is assigned on the + environment. + :type roles: list[str or + ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + """ + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AccessPolicyUpdateParameters, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.roles = kwargs.get('roles', None) + + +class ResourceProperties(Model): + """Properties that are common to all tracked resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + """ + + _validation = { + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ResourceProperties, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + + +class EventSourceCommonProperties(ResourceProperties): + """Properties of the event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventSourceCommonProperties, self).__init__(**kwargs) + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + + +class AzureEventSourceProperties(EventSourceCommonProperties): + """Properties of an event source that reads events from an event broker in + Azure. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEventSourceProperties, self).__init__(**kwargs) + self.event_source_resource_id = kwargs.get('event_source_resource_id', None) + + +class CloudError(Model): + """Contains information about an API error. + + :param error: Describes a particular API error with an error code and a + message. + :type error: ~azure.mgmt.timeseriesinsights.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """Describes a particular API error with an error code and a message. + + :param code: An error code that describes the error condition more + precisely than an HTTP status code. Can be used to programmatically handle + specific error cases. + :type code: str + :param message: A message that describes the error in detail and provides + debugging information. + :type message: str + :param target: The target of the particular error (for example, the name + of the property in error). + :type target: str + :param details: Contains nested errors that are related to this error. + :type details: list[~azure.mgmt.timeseriesinsights.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, **kwargs): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class CreateOrUpdateTrackedResourceProperties(Model): + """Properties required to create any resource tracked by Azure Resource + Manager. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'location': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(CreateOrUpdateTrackedResourceProperties, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class EnvironmentCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): + """Parameters supplied to the CreateOrUpdate Environment operation. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: StandardEnvironmentCreateOrUpdateParameters, + LongTermEnvironmentCreateOrUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Standard': 'StandardEnvironmentCreateOrUpdateParameters', 'LongTerm': 'LongTermEnvironmentCreateOrUpdateParameters'} + } + + def __init__(self, **kwargs): + super(EnvironmentCreateOrUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = None + self.kind = 'EnvironmentCreateOrUpdateParameters' + + +class EnvironmentListResponse(Model): + """The response of the List Environments operation. + + :param value: Result of the List Environments operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EnvironmentResource]'}, + } + + def __init__(self, **kwargs): + super(EnvironmentListResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class TrackedResource(Resource): + """Time Series Insights resource that is tracked by Azure Resource Manager. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class EnvironmentResource(TrackedResource): + """An environment is a set of time-series data available for query, and is the + top level Azure Time Series Insights resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: StandardEnvironmentResource, LongTermEnvironmentResource + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Standard': 'StandardEnvironmentResource', 'LongTerm': 'LongTermEnvironmentResource'} + } + + def __init__(self, **kwargs): + super(EnvironmentResource, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = None + self.kind = 'EnvironmentResource' + + +class EnvironmentResourceProperties(ResourceProperties): + """Properties of the environment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :ivar data_access_id: An id used to access the environment data, e.g. to + query the environment's events or upload reference data for the + environment. + :vartype data_access_id: str + :ivar data_access_fqdn: The fully qualified domain name used to access the + environment data, e.g. to query the environment's events or upload + reference data for the environment. + :vartype data_access_fqdn: str + :param status: An object that represents the status of the environment, + and its internal state in the Time Series Insights service. + :type status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'data_access_id': {'readonly': True}, + 'data_access_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'data_access_id': {'key': 'dataAccessId', 'type': 'str'}, + 'data_access_fqdn': {'key': 'dataAccessFqdn', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'EnvironmentStatus'}, + } + + def __init__(self, **kwargs): + super(EnvironmentResourceProperties, self).__init__(**kwargs) + self.data_access_id = None + self.data_access_fqdn = None + self.status = kwargs.get('status', None) + + +class EnvironmentStateDetails(Model): + """An object that contains the details about an environment's state. + + :param code: Contains the code that represents the reason of an + environment being in a particular state. Can be used to programmatically + handle specific cases. + :type code: str + :param message: A message that describes the state in detail. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnvironmentStateDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class EnvironmentStatus(Model): + """An object that represents the status of the environment, and its internal + state in the Time Series Insights service. + + :param ingress: An object that represents the status of ingress on an + environment. + :type ingress: + ~azure.mgmt.timeseriesinsights.models.IngressEnvironmentStatus + :param warm_storage: An object that represents the status of warm storage + on an environment. + :type warm_storage: + ~azure.mgmt.timeseriesinsights.models.WarmStorageEnvironmentStatus + """ + + _attribute_map = { + 'ingress': {'key': 'ingress', 'type': 'IngressEnvironmentStatus'}, + 'warm_storage': {'key': 'warmStorage', 'type': 'WarmStorageEnvironmentStatus'}, + } + + def __init__(self, **kwargs): + super(EnvironmentStatus, self).__init__(**kwargs) + self.ingress = kwargs.get('ingress', None) + self.warm_storage = kwargs.get('warm_storage', None) + + +class EnvironmentUpdateParameters(Model): + """Parameters supplied to the Update Environment operation. + + :param tags: Key-value pairs of additional properties for the environment. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(EnvironmentUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class EventHubEventSourceCommonProperties(AzureEventSourceProperties): + """Properties of the EventHub event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param service_bus_namespace: Required. The name of the service bus that + contains the event hub. + :type service_bus_namespace: str + :param event_hub_name: Required. The name of the event hub. + :type event_hub_name: str + :param consumer_group_name: Required. The name of the event hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the SAS key that grants the Time + Series Insights service access to the event hub. The shared access + policies for this key must grant 'Listen' permissions to the event hub. + :type key_name: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'service_bus_namespace': {'required': True}, + 'event_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, + 'service_bus_namespace': {'key': 'serviceBusNamespace', 'type': 'str'}, + 'event_hub_name': {'key': 'eventHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventHubEventSourceCommonProperties, self).__init__(**kwargs) + self.service_bus_namespace = kwargs.get('service_bus_namespace', None) + self.event_hub_name = kwargs.get('event_hub_name', None) + self.consumer_group_name = kwargs.get('consumer_group_name', None) + self.key_name = kwargs.get('key_name', None) + + +class EventSourceCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): + """Parameters supplied to the Create or Update Event Source operation. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EventHubEventSourceCreateOrUpdateParameters, + IoTHubEventSourceCreateOrUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'location': {'required': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Microsoft.EventHub': 'EventHubEventSourceCreateOrUpdateParameters', 'Microsoft.IoTHub': 'IoTHubEventSourceCreateOrUpdateParameters'} + } + + def __init__(self, **kwargs): + super(EventSourceCreateOrUpdateParameters, self).__init__(**kwargs) + self.kind = None + self.kind = 'EventSourceCreateOrUpdateParameters' + + +class EventHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Event Source operation for an + EventHub event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param service_bus_namespace: Required. The name of the service bus that + contains the event hub. + :type service_bus_namespace: str + :param event_hub_name: Required. The name of the event hub. + :type event_hub_name: str + :param consumer_group_name: Required. The name of the event hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the SAS key that grants the Time + Series Insights service access to the event hub. The shared access + policies for this key must grant 'Listen' permissions to the event hub. + :type key_name: str + :param shared_access_key: Required. The value of the shared access key + that grants the Time Series Insights service read access to the event hub. + This property is not shown in event source responses. + :type shared_access_key: str + """ + + _validation = { + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'service_bus_namespace': {'required': True}, + 'event_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + 'shared_access_key': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, + 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventHubEventSourceCreateOrUpdateParameters, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + self.event_source_resource_id = kwargs.get('event_source_resource_id', None) + self.service_bus_namespace = kwargs.get('service_bus_namespace', None) + self.event_hub_name = kwargs.get('event_hub_name', None) + self.consumer_group_name = kwargs.get('consumer_group_name', None) + self.key_name = kwargs.get('key_name', None) + self.shared_access_key = kwargs.get('shared_access_key', None) + self.kind = 'Microsoft.EventHub' + + +class EventSourceResource(TrackedResource): + """An environment receives data from one or more event sources. Each event + source has associated connection info that allows the Time Series Insights + ingress pipeline to connect to and pull data from the event source. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EventHubEventSourceResource, IoTHubEventSourceResource + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Microsoft.EventHub': 'EventHubEventSourceResource', 'Microsoft.IotHub': 'IoTHubEventSourceResource'} + } + + def __init__(self, **kwargs): + super(EventSourceResource, self).__init__(**kwargs) + self.kind = None + self.kind = 'EventSourceResource' + + +class EventHubEventSourceResource(EventSourceResource): + """An event source that receives its data from an Azure EventHub. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param service_bus_namespace: Required. The name of the service bus that + contains the event hub. + :type service_bus_namespace: str + :param event_hub_name: Required. The name of the event hub. + :type event_hub_name: str + :param consumer_group_name: Required. The name of the event hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the SAS key that grants the Time + Series Insights service access to the event hub. The shared access + policies for this key must grant 'Listen' permissions to the event hub. + :type key_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'service_bus_namespace': {'required': True}, + 'event_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, + 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventHubEventSourceResource, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + self.event_source_resource_id = kwargs.get('event_source_resource_id', None) + self.service_bus_namespace = kwargs.get('service_bus_namespace', None) + self.event_hub_name = kwargs.get('event_hub_name', None) + self.consumer_group_name = kwargs.get('consumer_group_name', None) + self.key_name = kwargs.get('key_name', None) + self.kind = 'Microsoft.EventHub' + + +class EventSourceUpdateParameters(Model): + """Parameters supplied to the Update Event Source operation. + + :param tags: Key-value pairs of additional properties for the event + source. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(EventSourceUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class EventHubEventSourceUpdateParameters(EventSourceUpdateParameters): + """Parameters supplied to the Update Event Source operation to update an + EventHub event source. + + :param tags: Key-value pairs of additional properties for the event + source. + :type tags: dict[str, str] + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :param shared_access_key: The value of the shared access key that grants + the Time Series Insights service read access to the event hub. This + property is not shown in event source responses. + :type shared_access_key: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventHubEventSourceUpdateParameters, self).__init__(**kwargs) + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + self.local_timestamp = kwargs.get('local_timestamp', None) + self.shared_access_key = kwargs.get('shared_access_key', None) + + +class EventSourceListResponse(Model): + """The response of the List EventSources operation. + + :param value: Result of the List EventSources operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.EventSourceResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EventSourceResource]'}, + } + + def __init__(self, **kwargs): + super(EventSourceListResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class EventSourceMutableProperties(Model): + """An object that represents a set of mutable event source resource + properties. + + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + """ + + _attribute_map = { + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, + } + + def __init__(self, **kwargs): + super(EventSourceMutableProperties, self).__init__(**kwargs) + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + self.local_timestamp = kwargs.get('local_timestamp', None) + + +class IngressEnvironmentStatus(Model): + """An object that represents the status of ingress on an environment. + + :param state: This string represents the state of ingress operations on an + environment. It can be "Disabled", "Ready", "Running", "Paused" or + "Unknown". Possible values include: 'Disabled', 'Ready', 'Running', + 'Paused', 'Unknown' + :type state: str or ~azure.mgmt.timeseriesinsights.models.IngressState + :param state_details: An object that contains the details about an + environment's state. + :type state_details: + ~azure.mgmt.timeseriesinsights.models.EnvironmentStateDetails + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'state_details': {'key': 'stateDetails', 'type': 'EnvironmentStateDetails'}, + } + + def __init__(self, **kwargs): + super(IngressEnvironmentStatus, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.state_details = kwargs.get('state_details', None) + + +class IoTHubEventSourceCommonProperties(AzureEventSourceProperties): + """Properties of the IoTHub event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param iot_hub_name: Required. The name of the iot hub. + :type iot_hub_name: str + :param consumer_group_name: Required. The name of the iot hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the Shared Access Policy key that + grants the Time Series Insights service access to the iot hub. This shared + access policy key must grant 'service connect' permissions to the iot hub. + :type key_name: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'iot_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, + 'iot_hub_name': {'key': 'iotHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IoTHubEventSourceCommonProperties, self).__init__(**kwargs) + self.iot_hub_name = kwargs.get('iot_hub_name', None) + self.consumer_group_name = kwargs.get('consumer_group_name', None) + self.key_name = kwargs.get('key_name', None) + + +class IoTHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Event Source operation for an + IoTHub event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param iot_hub_name: Required. The name of the iot hub. + :type iot_hub_name: str + :param consumer_group_name: Required. The name of the iot hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the Shared Access Policy key that + grants the Time Series Insights service access to the iot hub. This shared + access policy key must grant 'service connect' permissions to the iot hub. + :type key_name: str + :param shared_access_key: Required. The value of the Shared Access Policy + key that grants the Time Series Insights service read access to the iot + hub. This property is not shown in event source responses. + :type shared_access_key: str + """ + + _validation = { + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'iot_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + 'shared_access_key': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'iot_hub_name': {'key': 'properties.iotHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IoTHubEventSourceCreateOrUpdateParameters, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + self.event_source_resource_id = kwargs.get('event_source_resource_id', None) + self.iot_hub_name = kwargs.get('iot_hub_name', None) + self.consumer_group_name = kwargs.get('consumer_group_name', None) + self.key_name = kwargs.get('key_name', None) + self.shared_access_key = kwargs.get('shared_access_key', None) + self.kind = 'Microsoft.IoTHub' + + +class IoTHubEventSourceResource(EventSourceResource): + """An event source that receives its data from an Azure IoTHub. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param iot_hub_name: Required. The name of the iot hub. + :type iot_hub_name: str + :param consumer_group_name: Required. The name of the iot hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the Shared Access Policy key that + grants the Time Series Insights service access to the iot hub. This shared + access policy key must grant 'service connect' permissions to the iot hub. + :type key_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'iot_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'iot_hub_name': {'key': 'properties.iotHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IoTHubEventSourceResource, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + self.event_source_resource_id = kwargs.get('event_source_resource_id', None) + self.iot_hub_name = kwargs.get('iot_hub_name', None) + self.consumer_group_name = kwargs.get('consumer_group_name', None) + self.key_name = kwargs.get('key_name', None) + self.kind = 'Microsoft.IotHub' + + +class IoTHubEventSourceUpdateParameters(EventSourceUpdateParameters): + """Parameters supplied to the Update Event Source operation to update an + IoTHub event source. + + :param tags: Key-value pairs of additional properties for the event + source. + :type tags: dict[str, str] + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :param shared_access_key: The value of the shared access key that grants + the Time Series Insights service read access to the iot hub. This property + is not shown in event source responses. + :type shared_access_key: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IoTHubEventSourceUpdateParameters, self).__init__(**kwargs) + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + self.local_timestamp = kwargs.get('local_timestamp', None) + self.shared_access_key = kwargs.get('shared_access_key', None) + + +class LocalTimestamp(Model): + """An object that represents the local timestamp property. It contains the + format of local timestamp that needs to be used and the corresponding + timezone offset information. If a value isn't specified for localTimestamp, + or if null, then the local timestamp will not be ingressed with the events. + + :param format: An enum that represents the format of the local timestamp + property that needs to be set. Possible values include: 'Embedded', + 'Iana', 'TimeSpan' + :type format: str or + ~azure.mgmt.timeseriesinsights.models.LocalTimestampFormat + :param time_zone_offset: An object that represents the offset information + for the local timestamp format specified. Should not be specified for + LocalTimestampFormat - Embedded. + :type time_zone_offset: + ~azure.mgmt.timeseriesinsights.models.LocalTimestampTimeZoneOffset + """ + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'time_zone_offset': {'key': 'timeZoneOffset', 'type': 'LocalTimestampTimeZoneOffset'}, + } + + def __init__(self, **kwargs): + super(LocalTimestamp, self).__init__(**kwargs) + self.format = kwargs.get('format', None) + self.time_zone_offset = kwargs.get('time_zone_offset', None) + + +class LocalTimestampTimeZoneOffset(Model): + """An object that represents the offset information for the local timestamp + format specified. Should not be specified for LocalTimestampFormat - + Embedded. + + :param property_name: The event property that will be contain the offset + information to calculate the local timestamp. When the + LocalTimestampFormat is Iana, the property name will contain the name of + the column which contains IANA Timezone Name (eg: Americas/Los Angeles). + When LocalTimestampFormat is Timespan, it contains the name of property + which contains values representing the offset (eg: P1D or 1.00:00:00) + :type property_name: str + """ + + _attribute_map = { + 'property_name': {'key': 'propertyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LocalTimestampTimeZoneOffset, self).__init__(**kwargs) + self.property_name = kwargs.get('property_name', None) + + +class LongTermEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Environment operation for a + long-term environment. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :param time_series_id_properties: Required. The list of event properties + which will be used to define the environment's time series id. + :type time_series_id_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + :param storage_configuration: Required. The storage configuration provides + the connection details that allows the Time Series Insights service to + connect to the customer storage account that is used to store the + environment's data. + :type storage_configuration: + ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationInput + :param data_retention: Required. ISO8601 timespan specifying the number of + days the environment's events will be available for query from the warm + store. + :type data_retention: timedelta + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'time_series_id_properties': {'required': True}, + 'storage_configuration': {'required': True}, + 'data_retention': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, + 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationInput'}, + 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(LongTermEnvironmentCreateOrUpdateParameters, self).__init__(**kwargs) + self.time_series_id_properties = kwargs.get('time_series_id_properties', None) + self.storage_configuration = kwargs.get('storage_configuration', None) + self.data_retention = kwargs.get('data_retention', None) + self.kind = 'LongTerm' + + +class LongTermEnvironmentResource(EnvironmentResource): + """An environment is a set of time-series data available for query, and is the + top level Azure Time Series Insights resource. LongTerm environments do not + have set data retention limits. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :ivar data_access_id: An id used to access the environment data, e.g. to + query the environment's events or upload reference data for the + environment. + :vartype data_access_id: str + :ivar data_access_fqdn: The fully qualified domain name used to access the + environment data, e.g. to query the environment's events or upload + reference data for the environment. + :vartype data_access_fqdn: str + :param status: An object that represents the status of the environment, + and its internal state in the Time Series Insights service. + :type status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param time_series_id_properties: Required. The list of event properties + which will be used to define the environment's time series id. + :type time_series_id_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + :param storage_configuration: Required. The storage configuration provides + the connection details that allows the Time Series Insights service to + connect to the customer storage account that is used to store the + environment's data. + :type storage_configuration: + ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationOutput + :param data_retention: Required. ISO8601 timespan specifying the number of + days the environment's events will be available for query from the warm + store. + :type data_retention: timedelta + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'data_access_id': {'readonly': True}, + 'data_access_fqdn': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'time_series_id_properties': {'required': True}, + 'storage_configuration': {'required': True}, + 'data_retention': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_access_id': {'key': 'properties.dataAccessId', 'type': 'str'}, + 'data_access_fqdn': {'key': 'properties.dataAccessFqdn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'EnvironmentStatus'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, + 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationOutput'}, + 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(LongTermEnvironmentResource, self).__init__(**kwargs) + self.data_access_id = None + self.data_access_fqdn = None + self.status = kwargs.get('status', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + self.time_series_id_properties = kwargs.get('time_series_id_properties', None) + self.storage_configuration = kwargs.get('storage_configuration', None) + self.data_retention = kwargs.get('data_retention', None) + self.kind = 'LongTerm' + + +class LongTermEnvironmentUpdateParameters(EnvironmentUpdateParameters): + """Parameters supplied to the Update Environment operation to update a + long-term environment. + + All required parameters must be populated in order to send to Azure. + + :param tags: Key-value pairs of additional properties for the environment. + :type tags: dict[str, str] + :param storage_configuration: The storage configuration provides the + connection details that allows the Time Series Insights service to connect + to the customer storage account that is used to store the environment's + data. + :type storage_configuration: + ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationMutableProperties + :param data_retention: Required. ISO8601 timespan specifying the number of + days the environment's events will be available for query from the warm + store. + :type data_retention: timedelta + """ + + _validation = { + 'data_retention': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationMutableProperties'}, + 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(LongTermEnvironmentUpdateParameters, self).__init__(**kwargs) + self.storage_configuration = kwargs.get('storage_configuration', None) + self.data_retention = kwargs.get('data_retention', None) + + +class LongTermStorageConfigurationInput(Model): + """The storage configuration provides the connection details that allows the + Time Series Insights service to connect to the customer storage account + that is used to store the environment's data. + + All required parameters must be populated in order to send to Azure. + + :param account_name: Required. The name of the storage account that will + hold the environment's long term data. + :type account_name: str + :param management_key: Required. The value of the management key that + grants the Time Series Insights service write access to the storage + account. This property is not shown in environment responses. + :type management_key: str + """ + + _validation = { + 'account_name': {'required': True}, + 'management_key': {'required': True}, + } + + _attribute_map = { + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'management_key': {'key': 'managementKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LongTermStorageConfigurationInput, self).__init__(**kwargs) + self.account_name = kwargs.get('account_name', None) + self.management_key = kwargs.get('management_key', None) + + +class LongTermStorageConfigurationMutableProperties(Model): + """The storage configuration provides the connection details that allows the + Time Series Insights service to connect to the customer storage account + that is used to store the environment's data. + + All required parameters must be populated in order to send to Azure. + + :param management_key: Required. The value of the management key that + grants the Time Series Insights service write access to the storage + account. This property is not shown in environment responses. + :type management_key: str + """ + + _validation = { + 'management_key': {'required': True}, + } + + _attribute_map = { + 'management_key': {'key': 'managementKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LongTermStorageConfigurationMutableProperties, self).__init__(**kwargs) + self.management_key = kwargs.get('management_key', None) + + +class LongTermStorageConfigurationOutput(Model): + """The storage configuration provides the non-secret connection details about + the customer storage account that is used to store the environment's data. + + All required parameters must be populated in order to send to Azure. + + :param account_name: Required. The name of the storage account that will + hold the environment's long term data. + :type account_name: str + """ + + _validation = { + 'account_name': {'required': True}, + } + + _attribute_map = { + 'account_name': {'key': 'accountName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LongTermStorageConfigurationOutput, self).__init__(**kwargs) + self.account_name = kwargs.get('account_name', None) + + +class Operation(Model): + """A Time Series Insights REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation being performed on this particular + object. + :vartype name: str + :ivar display: Contains the localized display information for this + particular operation / action. + :vartype display: ~azure.mgmt.timeseriesinsights.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + + +class OperationDisplay(Model): + """Contains the localized display information for this particular operation / + action. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The localized friendly form of the resource provider name. + :vartype provider: str + :ivar resource: The localized friendly form of the resource type related + to this action/operation. + :vartype resource: str + :ivar operation: The localized friendly name for the operation. + :vartype operation: str + :ivar description: The localized friendly description for the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class ReferenceDataSetCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): + """ReferenceDataSetCreateOrUpdateParameters. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param key_properties: Required. The list of key properties for the + reference data set. + :type key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :param data_string_comparison_behavior: The reference data set key + comparison behavior can be set using this property. By default, the value + is 'Ordinal' - which means case sensitive key comparison will be performed + while joining reference data with events or while adding new reference + data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be + used. Possible values include: 'Ordinal', 'OrdinalIgnoreCase' + :type data_string_comparison_behavior: str or + ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior + """ + + _validation = { + 'location': {'required': True}, + 'key_properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'key_properties': {'key': 'properties.keyProperties', 'type': '[ReferenceDataSetKeyProperty]'}, + 'data_string_comparison_behavior': {'key': 'properties.dataStringComparisonBehavior', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ReferenceDataSetCreateOrUpdateParameters, self).__init__(**kwargs) + self.key_properties = kwargs.get('key_properties', None) + self.data_string_comparison_behavior = kwargs.get('data_string_comparison_behavior', None) + + +class ReferenceDataSetKeyProperty(Model): + """A key property for the reference data set. A reference data set can have + multiple key properties. + + :param name: The name of the key property. + :type name: str + :param type: The type of the key property. Possible values include: + 'String', 'Double', 'Bool', 'DateTime' + :type type: str or + ~azure.mgmt.timeseriesinsights.models.ReferenceDataKeyPropertyType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ReferenceDataSetKeyProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class ReferenceDataSetListResponse(Model): + """The response of the List Reference Data Sets operation. + + :param value: Result of the List Reference Data Sets operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ReferenceDataSetResource]'}, + } + + def __init__(self, **kwargs): + super(ReferenceDataSetListResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ReferenceDataSetResource(TrackedResource): + """A reference data set provides metadata about the events in an environment. + Metadata in the reference data set will be joined with events as they are + read from event sources. The metadata that makes up the reference data set + is uploaded or modified through the Time Series Insights data plane APIs. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param key_properties: Required. The list of key properties for the + reference data set. + :type key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :param data_string_comparison_behavior: The reference data set key + comparison behavior can be set using this property. By default, the value + is 'Ordinal' - which means case sensitive key comparison will be performed + while joining reference data with events or while adding new reference + data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be + used. Possible values include: 'Ordinal', 'OrdinalIgnoreCase' + :type data_string_comparison_behavior: str or + ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'key_properties': {'required': True}, + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'key_properties': {'key': 'properties.keyProperties', 'type': '[ReferenceDataSetKeyProperty]'}, + 'data_string_comparison_behavior': {'key': 'properties.dataStringComparisonBehavior', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ReferenceDataSetResource, self).__init__(**kwargs) + self.key_properties = kwargs.get('key_properties', None) + self.data_string_comparison_behavior = kwargs.get('data_string_comparison_behavior', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + + +class ReferenceDataSetUpdateParameters(Model): + """Parameters supplied to the Update Reference Data Set operation. + + :param tags: Key-value pairs of additional properties for the reference + data set. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ReferenceDataSetUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class Sku(Model): + """The sku determines the type of environment, either standard (S1 or S2) or + long-term (L1). For standard environments the sku determines the capacity + of the environment, the ingress rate, and the billing rate. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of this SKU. Possible values include: + 'S1', 'S2', 'P1', 'L1' + :type name: str or ~azure.mgmt.timeseriesinsights.models.SkuName + :param capacity: Required. The capacity of the sku. For standard + environments, this value can be changed to support scale out of + environments after they have been created. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + 'capacity': {'required': True, 'maximum': 10, 'minimum': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.capacity = kwargs.get('capacity', None) + + +class StandardEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Environment operation for a + standard environment. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :param data_retention_time: Required. ISO8601 timespan specifying the + minimum number of days the environment's events will be available for + query. + :type data_retention_time: timedelta + :param storage_limit_exceeded_behavior: The behavior the Time Series + Insights service should take when the environment's capacity has been + exceeded. If "PauseIngress" is specified, new events will not be read from + the event source. If "PurgeOldData" is specified, new events will continue + to be read and old events will be deleted from the environment. The + default behavior is PurgeOldData. Possible values include: 'PurgeOldData', + 'PauseIngress' + :type storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :param partition_key_properties: The list of event properties which will + be used to partition data in the environment. + :type partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'data_retention_time': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, + 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, + 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, + } + + def __init__(self, **kwargs): + super(StandardEnvironmentCreateOrUpdateParameters, self).__init__(**kwargs) + self.data_retention_time = kwargs.get('data_retention_time', None) + self.storage_limit_exceeded_behavior = kwargs.get('storage_limit_exceeded_behavior', None) + self.partition_key_properties = kwargs.get('partition_key_properties', None) + self.kind = 'Standard' + + +class StandardEnvironmentResource(EnvironmentResource): + """An environment is a set of time-series data available for query, and is the + top level Azure Time Series Insights resource. Standard environments have + data retention limits. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :param data_retention_time: Required. ISO8601 timespan specifying the + minimum number of days the environment's events will be available for + query. + :type data_retention_time: timedelta + :param storage_limit_exceeded_behavior: The behavior the Time Series + Insights service should take when the environment's capacity has been + exceeded. If "PauseIngress" is specified, new events will not be read from + the event source. If "PurgeOldData" is specified, new events will continue + to be read and old events will be deleted from the environment. The + default behavior is PurgeOldData. Possible values include: 'PurgeOldData', + 'PauseIngress' + :type storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :param partition_key_properties: The list of event properties which will + be used to partition data in the environment. + :type partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + :ivar data_access_id: An id used to access the environment data, e.g. to + query the environment's events or upload reference data for the + environment. + :vartype data_access_id: str + :ivar data_access_fqdn: The fully qualified domain name used to access the + environment data, e.g. to query the environment's events or upload + reference data for the environment. + :vartype data_access_fqdn: str + :param status: An object that represents the status of the environment, + and its internal state in the Time Series Insights service. + :type status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'data_retention_time': {'required': True}, + 'data_access_id': {'readonly': True}, + 'data_access_fqdn': {'readonly': True}, + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, + 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, + 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, + 'data_access_id': {'key': 'properties.dataAccessId', 'type': 'str'}, + 'data_access_fqdn': {'key': 'properties.dataAccessFqdn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'EnvironmentStatus'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(StandardEnvironmentResource, self).__init__(**kwargs) + self.data_retention_time = kwargs.get('data_retention_time', None) + self.storage_limit_exceeded_behavior = kwargs.get('storage_limit_exceeded_behavior', None) + self.partition_key_properties = kwargs.get('partition_key_properties', None) + self.data_access_id = None + self.data_access_fqdn = None + self.status = kwargs.get('status', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + self.kind = 'Standard' + + +class StandardEnvironmentUpdateParameters(EnvironmentUpdateParameters): + """Parameters supplied to the Update Environment operation to update a + standard environment. + + :param tags: Key-value pairs of additional properties for the environment. + :type tags: dict[str, str] + :param sku: The sku of the environment. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param data_retention_time: ISO8601 timespan specifying the minimum number + of days the environment's events will be available for query. + :type data_retention_time: timedelta + :param storage_limit_exceeded_behavior: The behavior the Time Series + Insights service should take when the environment's capacity has been + exceeded. If "PauseIngress" is specified, new events will not be read from + the event source. If "PurgeOldData" is specified, new events will continue + to be read and old events will be deleted from the environment. The + default behavior is PurgeOldData. Possible values include: 'PurgeOldData', + 'PauseIngress' + :type storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :param partition_key_properties: The list of event properties which will + be used to partition data in the environment. + :type partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, + 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, + 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, + } + + def __init__(self, **kwargs): + super(StandardEnvironmentUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.data_retention_time = kwargs.get('data_retention_time', None) + self.storage_limit_exceeded_behavior = kwargs.get('storage_limit_exceeded_behavior', None) + self.partition_key_properties = kwargs.get('partition_key_properties', None) + + +class TimeSeriesIdProperty(Model): + """The structure of the property that a time series id can have. An + environment can have multiple such properties. + + :param name: The name of the property. + :type name: str + :param type: The type of the property. Possible values include: 'String' + :type type: str or ~azure.mgmt.timeseriesinsights.models.PropertyType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TimeSeriesIdProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class WarmStorageEnvironmentStatus(Model): + """An object that represents the status of warm storage on an environment. + + :param state: This string represents the state of warm storage properties + usage. It can be "Ok", "Error", "Unknown". Possible values include: 'Ok', + 'Error', 'Unknown' + :type state: str or + ~azure.mgmt.timeseriesinsights.models.WarmStoragePropertiesState + :param current_count: A value that represents the number of properties + used by the environment for S1/S2 SKU and number of properties used by + Warm Store for PAYG SKU + :type current_count: int + :param max_count: A value that represents the maximum number of properties + used allowed by the environment for S1/S2 SKU and maximum number of + properties allowed by Warm Store for PAYG SKU. + :type max_count: int + """ + + _validation = { + 'current_count': {'maximum': 10, 'minimum': 1}, + 'max_count': {'maximum': 10, 'minimum': 1}, + } + + _attribute_map = { + 'state': {'key': 'propertiesUsage.state', 'type': 'str'}, + 'current_count': {'key': 'propertiesUsage.stateDetails.currentCount', 'type': 'int'}, + 'max_count': {'key': 'propertiesUsage.stateDetails.maxCount', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(WarmStorageEnvironmentStatus, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.current_count = kwargs.get('current_count', None) + self.max_count = kwargs.get('max_count', None) diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_models_py3.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_models_py3.py new file mode 100644 index 00000000000..15c32a03692 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_models_py3.py @@ -0,0 +1,2237 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AccessPolicyCreateOrUpdateParameters(Model): + """AccessPolicyCreateOrUpdateParameters. + + :param principal_object_id: The objectId of the principal in Azure Active + Directory. + :type principal_object_id: str + :param description: An description of the access policy. + :type description: str + :param roles: The list of roles the principal is assigned on the + environment. + :type roles: list[str or + ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + """ + + _attribute_map = { + 'principal_object_id': {'key': 'properties.principalObjectId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': '[str]'}, + } + + def __init__(self, *, principal_object_id: str=None, description: str=None, roles=None, **kwargs) -> None: + super(AccessPolicyCreateOrUpdateParameters, self).__init__(**kwargs) + self.principal_object_id = principal_object_id + self.description = description + self.roles = roles + + +class AccessPolicyListResponse(Model): + """The response of the List access policies operation. + + :param value: Result of the List access policies operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.AccessPolicyResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AccessPolicyResource]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(AccessPolicyListResponse, self).__init__(**kwargs) + self.value = value + + +class Resource(Model): + """Time Series Insights resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AccessPolicyResource(Resource): + """An access policy is used to grant users and applications access to the + environment. Roles are assigned to service principals in Azure Active + Directory. These roles define the actions the principal can perform through + the Time Series Insights data plane APIs. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param principal_object_id: The objectId of the principal in Azure Active + Directory. + :type principal_object_id: str + :param description: An description of the access policy. + :type description: str + :param roles: The list of roles the principal is assigned on the + environment. + :type roles: list[str or + ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'principal_object_id': {'key': 'properties.principalObjectId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': '[str]'}, + } + + def __init__(self, *, principal_object_id: str=None, description: str=None, roles=None, **kwargs) -> None: + super(AccessPolicyResource, self).__init__(**kwargs) + self.principal_object_id = principal_object_id + self.description = description + self.roles = roles + + +class AccessPolicyUpdateParameters(Model): + """AccessPolicyUpdateParameters. + + :param description: An description of the access policy. + :type description: str + :param roles: The list of roles the principal is assigned on the + environment. + :type roles: list[str or + ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + """ + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': '[str]'}, + } + + def __init__(self, *, description: str=None, roles=None, **kwargs) -> None: + super(AccessPolicyUpdateParameters, self).__init__(**kwargs) + self.description = description + self.roles = roles + + +class ResourceProperties(Model): + """Properties that are common to all tracked resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + """ + + _validation = { + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'rfc-1123'}, + } + + def __init__(self, *, provisioning_state=None, **kwargs) -> None: + super(ResourceProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.creation_time = None + + +class EventSourceCommonProperties(ResourceProperties): + """Properties of the event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + } + + def __init__(self, *, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(EventSourceCommonProperties, self).__init__(provisioning_state=provisioning_state, **kwargs) + self.timestamp_property_name = timestamp_property_name + + +class AzureEventSourceProperties(EventSourceCommonProperties): + """Properties of an event source that reads events from an event broker in + Azure. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, + } + + def __init__(self, *, event_source_resource_id: str, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(AzureEventSourceProperties, self).__init__(provisioning_state=provisioning_state, timestamp_property_name=timestamp_property_name, **kwargs) + self.event_source_resource_id = event_source_resource_id + + +class CloudError(Model): + """Contains information about an API error. + + :param error: Describes a particular API error with an error code and a + message. + :type error: ~azure.mgmt.timeseriesinsights.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """Describes a particular API error with an error code and a message. + + :param code: An error code that describes the error condition more + precisely than an HTTP status code. Can be used to programmatically handle + specific error cases. + :type code: str + :param message: A message that describes the error in detail and provides + debugging information. + :type message: str + :param target: The target of the particular error (for example, the name + of the property in error). + :type target: str + :param details: Contains nested errors that are related to this error. + :type details: list[~azure.mgmt.timeseriesinsights.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class CreateOrUpdateTrackedResourceProperties(Model): + """Properties required to create any resource tracked by Azure Resource + Manager. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'location': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(CreateOrUpdateTrackedResourceProperties, self).__init__(**kwargs) + self.location = location + self.tags = tags + + +class EnvironmentCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): + """Parameters supplied to the CreateOrUpdate Environment operation. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: StandardEnvironmentCreateOrUpdateParameters, + LongTermEnvironmentCreateOrUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Standard': 'StandardEnvironmentCreateOrUpdateParameters', 'LongTerm': 'LongTermEnvironmentCreateOrUpdateParameters'} + } + + def __init__(self, *, location: str, sku, tags=None, **kwargs) -> None: + super(EnvironmentCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.kind = None + self.kind = 'EnvironmentCreateOrUpdateParameters' + + +class EnvironmentListResponse(Model): + """The response of the List Environments operation. + + :param value: Result of the List Environments operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EnvironmentResource]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EnvironmentListResponse, self).__init__(**kwargs) + self.value = value + + +class TrackedResource(Resource): + """Time Series Insights resource that is tracked by Azure Resource Manager. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.location = location + self.tags = tags + + +class EnvironmentResource(TrackedResource): + """An environment is a set of time-series data available for query, and is the + top level Azure Time Series Insights resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: StandardEnvironmentResource, LongTermEnvironmentResource + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Standard': 'StandardEnvironmentResource', 'LongTerm': 'LongTermEnvironmentResource'} + } + + def __init__(self, *, location: str, sku, tags=None, **kwargs) -> None: + super(EnvironmentResource, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.kind = None + self.kind = 'EnvironmentResource' + + +class EnvironmentResourceProperties(ResourceProperties): + """Properties of the environment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :ivar data_access_id: An id used to access the environment data, e.g. to + query the environment's events or upload reference data for the + environment. + :vartype data_access_id: str + :ivar data_access_fqdn: The fully qualified domain name used to access the + environment data, e.g. to query the environment's events or upload + reference data for the environment. + :vartype data_access_fqdn: str + :param status: An object that represents the status of the environment, + and its internal state in the Time Series Insights service. + :type status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'data_access_id': {'readonly': True}, + 'data_access_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'rfc-1123'}, + 'data_access_id': {'key': 'dataAccessId', 'type': 'str'}, + 'data_access_fqdn': {'key': 'dataAccessFqdn', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'EnvironmentStatus'}, + } + + def __init__(self, *, provisioning_state=None, status=None, **kwargs) -> None: + super(EnvironmentResourceProperties, self).__init__(provisioning_state=provisioning_state, **kwargs) + self.data_access_id = None + self.data_access_fqdn = None + self.status = status + + +class EnvironmentStateDetails(Model): + """An object that contains the details about an environment's state. + + :param code: Contains the code that represents the reason of an + environment being in a particular state. Can be used to programmatically + handle specific cases. + :type code: str + :param message: A message that describes the state in detail. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(EnvironmentStateDetails, self).__init__(**kwargs) + self.code = code + self.message = message + + +class EnvironmentStatus(Model): + """An object that represents the status of the environment, and its internal + state in the Time Series Insights service. + + :param ingress: An object that represents the status of ingress on an + environment. + :type ingress: + ~azure.mgmt.timeseriesinsights.models.IngressEnvironmentStatus + :param warm_storage: An object that represents the status of warm storage + on an environment. + :type warm_storage: + ~azure.mgmt.timeseriesinsights.models.WarmStorageEnvironmentStatus + """ + + _attribute_map = { + 'ingress': {'key': 'ingress', 'type': 'IngressEnvironmentStatus'}, + 'warm_storage': {'key': 'warmStorage', 'type': 'WarmStorageEnvironmentStatus'}, + } + + def __init__(self, *, ingress=None, warm_storage=None, **kwargs) -> None: + super(EnvironmentStatus, self).__init__(**kwargs) + self.ingress = ingress + self.warm_storage = warm_storage + + +class EnvironmentUpdateParameters(Model): + """Parameters supplied to the Update Environment operation. + + :param tags: Key-value pairs of additional properties for the environment. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(EnvironmentUpdateParameters, self).__init__(**kwargs) + self.tags = tags + + +class EventHubEventSourceCommonProperties(AzureEventSourceProperties): + """Properties of the EventHub event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param service_bus_namespace: Required. The name of the service bus that + contains the event hub. + :type service_bus_namespace: str + :param event_hub_name: Required. The name of the event hub. + :type event_hub_name: str + :param consumer_group_name: Required. The name of the event hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the SAS key that grants the Time + Series Insights service access to the event hub. The shared access + policies for this key must grant 'Listen' permissions to the event hub. + :type key_name: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'service_bus_namespace': {'required': True}, + 'event_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, + 'service_bus_namespace': {'key': 'serviceBusNamespace', 'type': 'str'}, + 'event_hub_name': {'key': 'eventHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, event_source_resource_id: str, service_bus_namespace: str, event_hub_name: str, consumer_group_name: str, key_name: str, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(EventHubEventSourceCommonProperties, self).__init__(provisioning_state=provisioning_state, timestamp_property_name=timestamp_property_name, event_source_resource_id=event_source_resource_id, **kwargs) + self.service_bus_namespace = service_bus_namespace + self.event_hub_name = event_hub_name + self.consumer_group_name = consumer_group_name + self.key_name = key_name + + +class EventSourceCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): + """Parameters supplied to the Create or Update Event Source operation. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EventHubEventSourceCreateOrUpdateParameters, + IoTHubEventSourceCreateOrUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'location': {'required': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Microsoft.EventHub': 'EventHubEventSourceCreateOrUpdateParameters', 'Microsoft.IoTHub': 'IoTHubEventSourceCreateOrUpdateParameters'} + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(EventSourceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + self.kind = None + self.kind = 'EventSourceCreateOrUpdateParameters' + + +class EventHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Event Source operation for an + EventHub event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param service_bus_namespace: Required. The name of the service bus that + contains the event hub. + :type service_bus_namespace: str + :param event_hub_name: Required. The name of the event hub. + :type event_hub_name: str + :param consumer_group_name: Required. The name of the event hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the SAS key that grants the Time + Series Insights service access to the event hub. The shared access + policies for this key must grant 'Listen' permissions to the event hub. + :type key_name: str + :param shared_access_key: Required. The value of the shared access key + that grants the Time Series Insights service read access to the event hub. + This property is not shown in event source responses. + :type shared_access_key: str + """ + + _validation = { + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'service_bus_namespace': {'required': True}, + 'event_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + 'shared_access_key': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, + 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, *, location: str, event_source_resource_id: str, service_bus_namespace: str, event_hub_name: str, consumer_group_name: str, key_name: str, shared_access_key: str, tags=None, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(EventHubEventSourceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.creation_time = None + self.timestamp_property_name = timestamp_property_name + self.event_source_resource_id = event_source_resource_id + self.service_bus_namespace = service_bus_namespace + self.event_hub_name = event_hub_name + self.consumer_group_name = consumer_group_name + self.key_name = key_name + self.shared_access_key = shared_access_key + self.kind = 'Microsoft.EventHub' + + +class EventSourceResource(TrackedResource): + """An environment receives data from one or more event sources. Each event + source has associated connection info that allows the Time Series Insights + ingress pipeline to connect to and pull data from the event source. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EventHubEventSourceResource, IoTHubEventSourceResource + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Microsoft.EventHub': 'EventHubEventSourceResource', 'Microsoft.IotHub': 'IoTHubEventSourceResource'} + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(EventSourceResource, self).__init__(location=location, tags=tags, **kwargs) + self.kind = None + self.kind = 'EventSourceResource' + + +class EventHubEventSourceResource(EventSourceResource): + """An event source that receives its data from an Azure EventHub. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param service_bus_namespace: Required. The name of the service bus that + contains the event hub. + :type service_bus_namespace: str + :param event_hub_name: Required. The name of the event hub. + :type event_hub_name: str + :param consumer_group_name: Required. The name of the event hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the SAS key that grants the Time + Series Insights service access to the event hub. The shared access + policies for this key must grant 'Listen' permissions to the event hub. + :type key_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'service_bus_namespace': {'required': True}, + 'event_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, + 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + } + + def __init__(self, *, location: str, event_source_resource_id: str, service_bus_namespace: str, event_hub_name: str, consumer_group_name: str, key_name: str, tags=None, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(EventHubEventSourceResource, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.creation_time = None + self.timestamp_property_name = timestamp_property_name + self.event_source_resource_id = event_source_resource_id + self.service_bus_namespace = service_bus_namespace + self.event_hub_name = event_hub_name + self.consumer_group_name = consumer_group_name + self.key_name = key_name + self.kind = 'Microsoft.EventHub' + + +class EventSourceUpdateParameters(Model): + """Parameters supplied to the Update Event Source operation. + + :param tags: Key-value pairs of additional properties for the event + source. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(EventSourceUpdateParameters, self).__init__(**kwargs) + self.tags = tags + + +class EventHubEventSourceUpdateParameters(EventSourceUpdateParameters): + """Parameters supplied to the Update Event Source operation to update an + EventHub event source. + + :param tags: Key-value pairs of additional properties for the event + source. + :type tags: dict[str, str] + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :param shared_access_key: The value of the shared access key that grants + the Time Series Insights service read access to the event hub. This + property is not shown in event source responses. + :type shared_access_key: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, *, tags=None, timestamp_property_name: str=None, local_timestamp=None, shared_access_key: str=None, **kwargs) -> None: + super(EventHubEventSourceUpdateParameters, self).__init__(tags=tags, **kwargs) + self.timestamp_property_name = timestamp_property_name + self.local_timestamp = local_timestamp + self.shared_access_key = shared_access_key + + +class EventSourceListResponse(Model): + """The response of the List EventSources operation. + + :param value: Result of the List EventSources operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.EventSourceResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EventSourceResource]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EventSourceListResponse, self).__init__(**kwargs) + self.value = value + + +class EventSourceMutableProperties(Model): + """An object that represents a set of mutable event source resource + properties. + + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + """ + + _attribute_map = { + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, + } + + def __init__(self, *, timestamp_property_name: str=None, local_timestamp=None, **kwargs) -> None: + super(EventSourceMutableProperties, self).__init__(**kwargs) + self.timestamp_property_name = timestamp_property_name + self.local_timestamp = local_timestamp + + +class IngressEnvironmentStatus(Model): + """An object that represents the status of ingress on an environment. + + :param state: This string represents the state of ingress operations on an + environment. It can be "Disabled", "Ready", "Running", "Paused" or + "Unknown". Possible values include: 'Disabled', 'Ready', 'Running', + 'Paused', 'Unknown' + :type state: str or ~azure.mgmt.timeseriesinsights.models.IngressState + :param state_details: An object that contains the details about an + environment's state. + :type state_details: + ~azure.mgmt.timeseriesinsights.models.EnvironmentStateDetails + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'state_details': {'key': 'stateDetails', 'type': 'EnvironmentStateDetails'}, + } + + def __init__(self, *, state=None, state_details=None, **kwargs) -> None: + super(IngressEnvironmentStatus, self).__init__(**kwargs) + self.state = state + self.state_details = state_details + + +class IoTHubEventSourceCommonProperties(AzureEventSourceProperties): + """Properties of the IoTHub event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param iot_hub_name: Required. The name of the iot hub. + :type iot_hub_name: str + :param consumer_group_name: Required. The name of the iot hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the Shared Access Policy key that + grants the Time Series Insights service access to the iot hub. This shared + access policy key must grant 'service connect' permissions to the iot hub. + :type key_name: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'iot_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, + 'iot_hub_name': {'key': 'iotHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, event_source_resource_id: str, iot_hub_name: str, consumer_group_name: str, key_name: str, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(IoTHubEventSourceCommonProperties, self).__init__(provisioning_state=provisioning_state, timestamp_property_name=timestamp_property_name, event_source_resource_id=event_source_resource_id, **kwargs) + self.iot_hub_name = iot_hub_name + self.consumer_group_name = consumer_group_name + self.key_name = key_name + + +class IoTHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Event Source operation for an + IoTHub event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param iot_hub_name: Required. The name of the iot hub. + :type iot_hub_name: str + :param consumer_group_name: Required. The name of the iot hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the Shared Access Policy key that + grants the Time Series Insights service access to the iot hub. This shared + access policy key must grant 'service connect' permissions to the iot hub. + :type key_name: str + :param shared_access_key: Required. The value of the Shared Access Policy + key that grants the Time Series Insights service read access to the iot + hub. This property is not shown in event source responses. + :type shared_access_key: str + """ + + _validation = { + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'iot_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + 'shared_access_key': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'iot_hub_name': {'key': 'properties.iotHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, *, location: str, event_source_resource_id: str, iot_hub_name: str, consumer_group_name: str, key_name: str, shared_access_key: str, tags=None, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(IoTHubEventSourceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.creation_time = None + self.timestamp_property_name = timestamp_property_name + self.event_source_resource_id = event_source_resource_id + self.iot_hub_name = iot_hub_name + self.consumer_group_name = consumer_group_name + self.key_name = key_name + self.shared_access_key = shared_access_key + self.kind = 'Microsoft.IoTHub' + + +class IoTHubEventSourceResource(EventSourceResource): + """An event source that receives its data from an Azure IoTHub. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param iot_hub_name: Required. The name of the iot hub. + :type iot_hub_name: str + :param consumer_group_name: Required. The name of the iot hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the Shared Access Policy key that + grants the Time Series Insights service access to the iot hub. This shared + access policy key must grant 'service connect' permissions to the iot hub. + :type key_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'iot_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'iot_hub_name': {'key': 'properties.iotHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + } + + def __init__(self, *, location: str, event_source_resource_id: str, iot_hub_name: str, consumer_group_name: str, key_name: str, tags=None, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(IoTHubEventSourceResource, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.creation_time = None + self.timestamp_property_name = timestamp_property_name + self.event_source_resource_id = event_source_resource_id + self.iot_hub_name = iot_hub_name + self.consumer_group_name = consumer_group_name + self.key_name = key_name + self.kind = 'Microsoft.IotHub' + + +class IoTHubEventSourceUpdateParameters(EventSourceUpdateParameters): + """Parameters supplied to the Update Event Source operation to update an + IoTHub event source. + + :param tags: Key-value pairs of additional properties for the event + source. + :type tags: dict[str, str] + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :param shared_access_key: The value of the shared access key that grants + the Time Series Insights service read access to the iot hub. This property + is not shown in event source responses. + :type shared_access_key: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, *, tags=None, timestamp_property_name: str=None, local_timestamp=None, shared_access_key: str=None, **kwargs) -> None: + super(IoTHubEventSourceUpdateParameters, self).__init__(tags=tags, **kwargs) + self.timestamp_property_name = timestamp_property_name + self.local_timestamp = local_timestamp + self.shared_access_key = shared_access_key + + +class LocalTimestamp(Model): + """An object that represents the local timestamp property. It contains the + format of local timestamp that needs to be used and the corresponding + timezone offset information. If a value isn't specified for localTimestamp, + or if null, then the local timestamp will not be ingressed with the events. + + :param format: An enum that represents the format of the local timestamp + property that needs to be set. Possible values include: 'Embedded', + 'Iana', 'TimeSpan' + :type format: str or + ~azure.mgmt.timeseriesinsights.models.LocalTimestampFormat + :param time_zone_offset: An object that represents the offset information + for the local timestamp format specified. Should not be specified for + LocalTimestampFormat - Embedded. + :type time_zone_offset: + ~azure.mgmt.timeseriesinsights.models.LocalTimestampTimeZoneOffset + """ + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'time_zone_offset': {'key': 'timeZoneOffset', 'type': 'LocalTimestampTimeZoneOffset'}, + } + + def __init__(self, *, format=None, time_zone_offset=None, **kwargs) -> None: + super(LocalTimestamp, self).__init__(**kwargs) + self.format = format + self.time_zone_offset = time_zone_offset + + +class LocalTimestampTimeZoneOffset(Model): + """An object that represents the offset information for the local timestamp + format specified. Should not be specified for LocalTimestampFormat - + Embedded. + + :param property_name: The event property that will be contain the offset + information to calculate the local timestamp. When the + LocalTimestampFormat is Iana, the property name will contain the name of + the column which contains IANA Timezone Name (eg: Americas/Los Angeles). + When LocalTimestampFormat is Timespan, it contains the name of property + which contains values representing the offset (eg: P1D or 1.00:00:00) + :type property_name: str + """ + + _attribute_map = { + 'property_name': {'key': 'propertyName', 'type': 'str'}, + } + + def __init__(self, *, property_name: str=None, **kwargs) -> None: + super(LocalTimestampTimeZoneOffset, self).__init__(**kwargs) + self.property_name = property_name + + +class LongTermEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Environment operation for a + long-term environment. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :param time_series_id_properties: Required. The list of event properties + which will be used to define the environment's time series id. + :type time_series_id_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + :param storage_configuration: Required. The storage configuration provides + the connection details that allows the Time Series Insights service to + connect to the customer storage account that is used to store the + environment's data. + :type storage_configuration: + ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationInput + :param data_retention: Required. ISO8601 timespan specifying the number of + days the environment's events will be available for query from the warm + store. + :type data_retention: timedelta + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'time_series_id_properties': {'required': True}, + 'storage_configuration': {'required': True}, + 'data_retention': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, + 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationInput'}, + 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + } + + def __init__(self, *, location: str, sku, time_series_id_properties, storage_configuration, data_retention, tags=None, **kwargs) -> None: + super(LongTermEnvironmentCreateOrUpdateParameters, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.time_series_id_properties = time_series_id_properties + self.storage_configuration = storage_configuration + self.data_retention = data_retention + self.kind = 'LongTerm' + + +class LongTermEnvironmentResource(EnvironmentResource): + """An environment is a set of time-series data available for query, and is the + top level Azure Time Series Insights resource. LongTerm environments do not + have set data retention limits. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :ivar data_access_id: An id used to access the environment data, e.g. to + query the environment's events or upload reference data for the + environment. + :vartype data_access_id: str + :ivar data_access_fqdn: The fully qualified domain name used to access the + environment data, e.g. to query the environment's events or upload + reference data for the environment. + :vartype data_access_fqdn: str + :param status: An object that represents the status of the environment, + and its internal state in the Time Series Insights service. + :type status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param time_series_id_properties: Required. The list of event properties + which will be used to define the environment's time series id. + :type time_series_id_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + :param storage_configuration: Required. The storage configuration provides + the connection details that allows the Time Series Insights service to + connect to the customer storage account that is used to store the + environment's data. + :type storage_configuration: + ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationOutput + :param data_retention: Required. ISO8601 timespan specifying the number of + days the environment's events will be available for query from the warm + store. + :type data_retention: timedelta + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'data_access_id': {'readonly': True}, + 'data_access_fqdn': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'time_series_id_properties': {'required': True}, + 'storage_configuration': {'required': True}, + 'data_retention': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_access_id': {'key': 'properties.dataAccessId', 'type': 'str'}, + 'data_access_fqdn': {'key': 'properties.dataAccessFqdn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'EnvironmentStatus'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, + 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationOutput'}, + 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + } + + def __init__(self, *, location: str, sku, time_series_id_properties, storage_configuration, data_retention, tags=None, status=None, provisioning_state=None, **kwargs) -> None: + super(LongTermEnvironmentResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.data_access_id = None + self.data_access_fqdn = None + self.status = status + self.provisioning_state = provisioning_state + self.creation_time = None + self.time_series_id_properties = time_series_id_properties + self.storage_configuration = storage_configuration + self.data_retention = data_retention + self.kind = 'LongTerm' + + +class LongTermEnvironmentUpdateParameters(EnvironmentUpdateParameters): + """Parameters supplied to the Update Environment operation to update a + long-term environment. + + All required parameters must be populated in order to send to Azure. + + :param tags: Key-value pairs of additional properties for the environment. + :type tags: dict[str, str] + :param storage_configuration: The storage configuration provides the + connection details that allows the Time Series Insights service to connect + to the customer storage account that is used to store the environment's + data. + :type storage_configuration: + ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationMutableProperties + :param data_retention: Required. ISO8601 timespan specifying the number of + days the environment's events will be available for query from the warm + store. + :type data_retention: timedelta + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationMutableProperties'}, + 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + } + + def __init__(self, *, data_retention, tags=None, storage_configuration=None, **kwargs) -> None: + super(LongTermEnvironmentUpdateParameters, self).__init__(tags=tags, **kwargs) + self.storage_configuration = storage_configuration + self.data_retention = data_retention + + +class LongTermStorageConfigurationInput(Model): + """The storage configuration provides the connection details that allows the + Time Series Insights service to connect to the customer storage account + that is used to store the environment's data. + + All required parameters must be populated in order to send to Azure. + + :param account_name: Required. The name of the storage account that will + hold the environment's long term data. + :type account_name: str + :param management_key: Required. The value of the management key that + grants the Time Series Insights service write access to the storage + account. This property is not shown in environment responses. + :type management_key: str + """ + + _validation = { + 'account_name': {'required': True}, + 'management_key': {'required': True}, + } + + _attribute_map = { + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'management_key': {'key': 'managementKey', 'type': 'str'}, + } + + def __init__(self, *, account_name: str, management_key: str, **kwargs) -> None: + super(LongTermStorageConfigurationInput, self).__init__(**kwargs) + self.account_name = account_name + self.management_key = management_key + + +class LongTermStorageConfigurationMutableProperties(Model): + """The storage configuration provides the connection details that allows the + Time Series Insights service to connect to the customer storage account + that is used to store the environment's data. + + All required parameters must be populated in order to send to Azure. + + :param management_key: Required. The value of the management key that + grants the Time Series Insights service write access to the storage + account. This property is not shown in environment responses. + :type management_key: str + """ + + _validation = { + 'management_key': {'required': True}, + } + + _attribute_map = { + 'management_key': {'key': 'managementKey', 'type': 'str'}, + } + + def __init__(self, *, management_key: str, **kwargs) -> None: + super(LongTermStorageConfigurationMutableProperties, self).__init__(**kwargs) + self.management_key = management_key + + +class LongTermStorageConfigurationOutput(Model): + """The storage configuration provides the non-secret connection details about + the customer storage account that is used to store the environment's data. + + All required parameters must be populated in order to send to Azure. + + :param account_name: Required. The name of the storage account that will + hold the environment's long term data. + :type account_name: str + """ + + _validation = { + 'account_name': {'required': True}, + } + + _attribute_map = { + 'account_name': {'key': 'accountName', 'type': 'str'}, + } + + def __init__(self, *, account_name: str, **kwargs) -> None: + super(LongTermStorageConfigurationOutput, self).__init__(**kwargs) + self.account_name = account_name + + +class Operation(Model): + """A Time Series Insights REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation being performed on this particular + object. + :vartype name: str + :ivar display: Contains the localized display information for this + particular operation / action. + :vartype display: ~azure.mgmt.timeseriesinsights.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + + +class OperationDisplay(Model): + """Contains the localized display information for this particular operation / + action. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The localized friendly form of the resource provider name. + :vartype provider: str + :ivar resource: The localized friendly form of the resource type related + to this action/operation. + :vartype resource: str + :ivar operation: The localized friendly name for the operation. + :vartype operation: str + :ivar description: The localized friendly description for the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class ReferenceDataSetCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): + """ReferenceDataSetCreateOrUpdateParameters. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param key_properties: Required. The list of key properties for the + reference data set. + :type key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :param data_string_comparison_behavior: The reference data set key + comparison behavior can be set using this property. By default, the value + is 'Ordinal' - which means case sensitive key comparison will be performed + while joining reference data with events or while adding new reference + data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be + used. Possible values include: 'Ordinal', 'OrdinalIgnoreCase' + :type data_string_comparison_behavior: str or + ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior + """ + + _validation = { + 'location': {'required': True}, + 'key_properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'key_properties': {'key': 'properties.keyProperties', 'type': '[ReferenceDataSetKeyProperty]'}, + 'data_string_comparison_behavior': {'key': 'properties.dataStringComparisonBehavior', 'type': 'str'}, + } + + def __init__(self, *, location: str, key_properties, tags=None, data_string_comparison_behavior=None, **kwargs) -> None: + super(ReferenceDataSetCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + self.key_properties = key_properties + self.data_string_comparison_behavior = data_string_comparison_behavior + + +class ReferenceDataSetKeyProperty(Model): + """A key property for the reference data set. A reference data set can have + multiple key properties. + + :param name: The name of the key property. + :type name: str + :param type: The type of the key property. Possible values include: + 'String', 'Double', 'Bool', 'DateTime' + :type type: str or + ~azure.mgmt.timeseriesinsights.models.ReferenceDataKeyPropertyType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type=None, **kwargs) -> None: + super(ReferenceDataSetKeyProperty, self).__init__(**kwargs) + self.name = name + self.type = type + + +class ReferenceDataSetListResponse(Model): + """The response of the List Reference Data Sets operation. + + :param value: Result of the List Reference Data Sets operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ReferenceDataSetResource]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ReferenceDataSetListResponse, self).__init__(**kwargs) + self.value = value + + +class ReferenceDataSetResource(TrackedResource): + """A reference data set provides metadata about the events in an environment. + Metadata in the reference data set will be joined with events as they are + read from event sources. The metadata that makes up the reference data set + is uploaded or modified through the Time Series Insights data plane APIs. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param key_properties: Required. The list of key properties for the + reference data set. + :type key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :param data_string_comparison_behavior: The reference data set key + comparison behavior can be set using this property. By default, the value + is 'Ordinal' - which means case sensitive key comparison will be performed + while joining reference data with events or while adding new reference + data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be + used. Possible values include: 'Ordinal', 'OrdinalIgnoreCase' + :type data_string_comparison_behavior: str or + ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'key_properties': {'required': True}, + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'key_properties': {'key': 'properties.keyProperties', 'type': '[ReferenceDataSetKeyProperty]'}, + 'data_string_comparison_behavior': {'key': 'properties.dataStringComparisonBehavior', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'rfc-1123'}, + } + + def __init__(self, *, location: str, key_properties, tags=None, data_string_comparison_behavior=None, provisioning_state=None, **kwargs) -> None: + super(ReferenceDataSetResource, self).__init__(location=location, tags=tags, **kwargs) + self.key_properties = key_properties + self.data_string_comparison_behavior = data_string_comparison_behavior + self.provisioning_state = provisioning_state + self.creation_time = None + + +class ReferenceDataSetUpdateParameters(Model): + """Parameters supplied to the Update Reference Data Set operation. + + :param tags: Key-value pairs of additional properties for the reference + data set. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ReferenceDataSetUpdateParameters, self).__init__(**kwargs) + self.tags = tags + + +class Sku(Model): + """The sku determines the type of environment, either standard (S1 or S2) or + long-term (L1). For standard environments the sku determines the capacity + of the environment, the ingress rate, and the billing rate. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of this SKU. Possible values include: + 'S1', 'S2', 'P1', 'L1' + :type name: str or ~azure.mgmt.timeseriesinsights.models.SkuName + :param capacity: Required. The capacity of the sku. For standard + environments, this value can be changed to support scale out of + environments after they have been created. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + 'capacity': {'required': True, 'maximum': 10, 'minimum': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name, capacity: int, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.capacity = capacity + + +class StandardEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Environment operation for a + standard environment. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :param data_retention_time: Required. ISO8601 timespan specifying the + minimum number of days the environment's events will be available for + query. + :type data_retention_time: timedelta + :param storage_limit_exceeded_behavior: The behavior the Time Series + Insights service should take when the environment's capacity has been + exceeded. If "PauseIngress" is specified, new events will not be read from + the event source. If "PurgeOldData" is specified, new events will continue + to be read and old events will be deleted from the environment. The + default behavior is PurgeOldData. Possible values include: 'PurgeOldData', + 'PauseIngress' + :type storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :param partition_key_properties: The list of event properties which will + be used to partition data in the environment. + :type partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'data_retention_time': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, + 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, + 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, + } + + def __init__(self, *, location: str, sku, data_retention_time, tags=None, storage_limit_exceeded_behavior=None, partition_key_properties=None, **kwargs) -> None: + super(StandardEnvironmentCreateOrUpdateParameters, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.data_retention_time = data_retention_time + self.storage_limit_exceeded_behavior = storage_limit_exceeded_behavior + self.partition_key_properties = partition_key_properties + self.kind = 'Standard' + + +class StandardEnvironmentResource(EnvironmentResource): + """An environment is a set of time-series data available for query, and is the + top level Azure Time Series Insights resource. Standard environments have + data retention limits. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :param data_retention_time: Required. ISO8601 timespan specifying the + minimum number of days the environment's events will be available for + query. + :type data_retention_time: timedelta + :param storage_limit_exceeded_behavior: The behavior the Time Series + Insights service should take when the environment's capacity has been + exceeded. If "PauseIngress" is specified, new events will not be read from + the event source. If "PurgeOldData" is specified, new events will continue + to be read and old events will be deleted from the environment. The + default behavior is PurgeOldData. Possible values include: 'PurgeOldData', + 'PauseIngress' + :type storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :param partition_key_properties: The list of event properties which will + be used to partition data in the environment. + :type partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + :ivar data_access_id: An id used to access the environment data, e.g. to + query the environment's events or upload reference data for the + environment. + :vartype data_access_id: str + :ivar data_access_fqdn: The fully qualified domain name used to access the + environment data, e.g. to query the environment's events or upload + reference data for the environment. + :vartype data_access_fqdn: str + :param status: An object that represents the status of the environment, + and its internal state in the Time Series Insights service. + :type status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'data_retention_time': {'required': True}, + 'data_access_id': {'readonly': True}, + 'data_access_fqdn': {'readonly': True}, + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, + 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, + 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, + 'data_access_id': {'key': 'properties.dataAccessId', 'type': 'str'}, + 'data_access_fqdn': {'key': 'properties.dataAccessFqdn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'EnvironmentStatus'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + } + + def __init__(self, *, location: str, sku, data_retention_time, tags=None, storage_limit_exceeded_behavior=None, partition_key_properties=None, status=None, provisioning_state=None, **kwargs) -> None: + super(StandardEnvironmentResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.data_retention_time = data_retention_time + self.storage_limit_exceeded_behavior = storage_limit_exceeded_behavior + self.partition_key_properties = partition_key_properties + self.data_access_id = None + self.data_access_fqdn = None + self.status = status + self.provisioning_state = provisioning_state + self.creation_time = None + self.kind = 'Standard' + + +class StandardEnvironmentUpdateParameters(EnvironmentUpdateParameters): + """Parameters supplied to the Update Environment operation to update a + standard environment. + + :param tags: Key-value pairs of additional properties for the environment. + :type tags: dict[str, str] + :param sku: The sku of the environment. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param data_retention_time: ISO8601 timespan specifying the minimum number + of days the environment's events will be available for query. + :type data_retention_time: timedelta + :param storage_limit_exceeded_behavior: The behavior the Time Series + Insights service should take when the environment's capacity has been + exceeded. If "PauseIngress" is specified, new events will not be read from + the event source. If "PurgeOldData" is specified, new events will continue + to be read and old events will be deleted from the environment. The + default behavior is PurgeOldData. Possible values include: 'PurgeOldData', + 'PauseIngress' + :type storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :param partition_key_properties: The list of event properties which will + be used to partition data in the environment. + :type partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, + 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, + 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, + } + + def __init__(self, *, tags=None, sku=None, data_retention_time=None, storage_limit_exceeded_behavior=None, partition_key_properties=None, **kwargs) -> None: + super(StandardEnvironmentUpdateParameters, self).__init__(tags=tags, **kwargs) + self.sku = sku + self.data_retention_time = data_retention_time + self.storage_limit_exceeded_behavior = storage_limit_exceeded_behavior + self.partition_key_properties = partition_key_properties + + +class TimeSeriesIdProperty(Model): + """The structure of the property that a time series id can have. An + environment can have multiple such properties. + + :param name: The name of the property. + :type name: str + :param type: The type of the property. Possible values include: 'String' + :type type: str or ~azure.mgmt.timeseriesinsights.models.PropertyType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type=None, **kwargs) -> None: + super(TimeSeriesIdProperty, self).__init__(**kwargs) + self.name = name + self.type = type + + +class WarmStorageEnvironmentStatus(Model): + """An object that represents the status of warm storage on an environment. + + :param state: This string represents the state of warm storage properties + usage. It can be "Ok", "Error", "Unknown". Possible values include: 'Ok', + 'Error', 'Unknown' + :type state: str or + ~azure.mgmt.timeseriesinsights.models.WarmStoragePropertiesState + :param current_count: A value that represents the number of properties + used by the environment for S1/S2 SKU and number of properties used by + Warm Store for PAYG SKU + :type current_count: int + :param max_count: A value that represents the maximum number of properties + used allowed by the environment for S1/S2 SKU and maximum number of + properties allowed by Warm Store for PAYG SKU. + :type max_count: int + """ + + _validation = { + 'current_count': {'maximum': 10, 'minimum': 1}, + 'max_count': {'maximum': 10, 'minimum': 1}, + } + + _attribute_map = { + 'state': {'key': 'propertiesUsage.state', 'type': 'str'}, + 'current_count': {'key': 'propertiesUsage.stateDetails.currentCount', 'type': 'int'}, + 'max_count': {'key': 'propertiesUsage.stateDetails.maxCount', 'type': 'int'}, + } + + def __init__(self, *, state=None, current_count: int=None, max_count: int=None, **kwargs) -> None: + super(WarmStorageEnvironmentStatus, self).__init__(**kwargs) + self.state = state + self.current_count = current_count + self.max_count = max_count diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_paged_models.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_paged_models.py new file mode 100644 index 00000000000..bbc646194ad --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_paged_models.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_time_series_insights_client_enums.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_time_series_insights_client_enums.py new file mode 100644 index 00000000000..361e35e738e --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_time_series_insights_client_enums.py @@ -0,0 +1,84 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ProvisioningState(str, Enum): + + accepted = "Accepted" + creating = "Creating" + updating = "Updating" + succeeded = "Succeeded" + failed = "Failed" + deleting = "Deleting" + + +class SkuName(str, Enum): + + s1 = "S1" + s2 = "S2" + p1 = "P1" + l1 = "L1" + + +class StorageLimitExceededBehavior(str, Enum): + + purge_old_data = "PurgeOldData" + pause_ingress = "PauseIngress" + + +class PropertyType(str, Enum): + + string = "String" + + +class IngressState(str, Enum): + + disabled = "Disabled" + ready = "Ready" + running = "Running" + paused = "Paused" + unknown = "Unknown" + + +class WarmStoragePropertiesState(str, Enum): + + ok = "Ok" + error = "Error" + unknown = "Unknown" + + +class LocalTimestampFormat(str, Enum): + + embedded = "Embedded" + iana = "Iana" + time_span = "TimeSpan" + + +class ReferenceDataKeyPropertyType(str, Enum): + + string = "String" + double = "Double" + bool_enum = "Bool" + date_time_enum = "DateTime" + + +class DataStringComparisonBehavior(str, Enum): + + ordinal = "Ordinal" + ordinal_ignore_case = "OrdinalIgnoreCase" + + +class AccessPolicyRole(str, Enum): + + reader = "Reader" + contributor = "Contributor" diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/__init__.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/__init__.py new file mode 100644 index 00000000000..c5850384c34 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/__init__.py @@ -0,0 +1,24 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._environments_operations import EnvironmentsOperations +from ._event_sources_operations import EventSourcesOperations +from ._reference_data_sets_operations import ReferenceDataSetsOperations +from ._access_policies_operations import AccessPoliciesOperations + +__all__ = [ + 'Operations', + 'EnvironmentsOperations', + 'EventSourcesOperations', + 'ReferenceDataSetsOperations', + 'AccessPoliciesOperations', +] diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_access_policies_operations.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_access_policies_operations.py new file mode 100644 index 00000000000..fb0b9da8c2b --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_access_policies_operations.py @@ -0,0 +1,382 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class AccessPoliciesOperations(object): + """AccessPoliciesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-08-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-15-preview" + + self.config = config + + def create_or_update( + self, resource_group_name, environment_name, access_policy_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update an access policy in the specified environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param access_policy_name: Name of the access policy. + :type access_policy_name: str + :param parameters: Parameters for creating an access policy. + :type parameters: + ~azure.mgmt.timeseriesinsights.models.AccessPolicyCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessPolicyResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.AccessPolicyResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AccessPolicyCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessPolicyResource', response) + if response.status_code == 201: + deserialized = self._deserialize('AccessPolicyResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} + + def get( + self, resource_group_name, environment_name, access_policy_name, custom_headers=None, raw=False, **operation_config): + """Gets the access policy with the specified name in the specified + environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param access_policy_name: The name of the Time Series Insights access + policy associated with the specified environment. + :type access_policy_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessPolicyResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.AccessPolicyResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessPolicyResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} + + def update( + self, resource_group_name, environment_name, access_policy_name, description=None, roles=None, custom_headers=None, raw=False, **operation_config): + """Updates the access policy with the specified name in the specified + subscription, resource group, and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param access_policy_name: The name of the Time Series Insights access + policy associated with the specified environment. + :type access_policy_name: str + :param description: An description of the access policy. + :type description: str + :param roles: The list of roles the principal is assigned on the + environment. + :type roles: list[str or + ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessPolicyResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.AccessPolicyResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + access_policy_update_parameters = models.AccessPolicyUpdateParameters(description=description, roles=roles) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(access_policy_update_parameters, 'AccessPolicyUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessPolicyResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} + + def delete( + self, resource_group_name, environment_name, access_policy_name, custom_headers=None, raw=False, **operation_config): + """Deletes the access policy with the specified name in the specified + subscription, resource group, and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param access_policy_name: The name of the Time Series Insights access + policy associated with the specified environment. + :type access_policy_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} + + def list_by_environment( + self, resource_group_name, environment_name, custom_headers=None, raw=False, **operation_config): + """Lists all the available access policies associated with the + environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessPolicyListResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.AccessPolicyListResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_environment.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessPolicyListResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies'} diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_environments_operations.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_environments_operations.py new file mode 100644 index 00000000000..8125a6efbdd --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_environments_operations.py @@ -0,0 +1,489 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class EnvironmentsOperations(object): + """EnvironmentsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-08-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-15-preview" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, environment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'EnvironmentCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EnvironmentResource', response) + if response.status_code == 201: + deserialized = self._deserialize('EnvironmentResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, environment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update an environment in the specified subscription and + resource group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: Name of the environment + :type environment_name: str + :param parameters: Parameters for creating an environment resource. + :type parameters: + ~azure.mgmt.timeseriesinsights.models.EnvironmentCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns EnvironmentResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.timeseriesinsights.models.EnvironmentResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + environment_name=environment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('EnvironmentResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} + + def get( + self, resource_group_name, environment_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the environment with the specified name in the specified + subscription and resource group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param expand: Setting $expand=status will include the status of the + internal services of the environment in the Time Series Insights + service. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EnvironmentResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.EnvironmentResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EnvironmentResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} + + + def _update_initial( + self, resource_group_name, environment_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'EnvironmentUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EnvironmentResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, environment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates the environment with the specified name in the specified + subscription and resource group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param parameters: Request object that + contains the updated information for the environment. + :type parameters: + ~azure.mgmt.timeseriesinsights.models.StandardEnvironmentUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns EnvironmentResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.timeseriesinsights.models.EnvironmentResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + environment_name=environment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('EnvironmentResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} + + def delete( + self, resource_group_name, environment_name, custom_headers=None, raw=False, **operation_config): + """Deletes the environment with the specified name in the specified + subscription and resource group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the available environments associated with the subscription + and within the specified resource group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EnvironmentListResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.EnvironmentListResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EnvironmentListResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the available environments within a subscription, + irrespective of the resource groups. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EnvironmentListResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.EnvironmentListResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EnvironmentListResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.TimeSeriesInsights/environments'} diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_event_sources_operations.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_event_sources_operations.py new file mode 100644 index 00000000000..dde291dc09e --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_event_sources_operations.py @@ -0,0 +1,379 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class EventSourcesOperations(object): + """EventSourcesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-08-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-15-preview" + + self.config = config + + def create_or_update( + self, resource_group_name, environment_name, event_source_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update an event source under the specified environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param event_source_name: Name of the event source. + :type event_source_name: str + :param parameters: Parameters for creating an event source resource. + :type parameters: + ~azure.mgmt.timeseriesinsights.models.EventSourceCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EventSourceResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.EventSourceResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'eventSourceName': self._serialize.url("event_source_name", event_source_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'EventSourceCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EventSourceResource', response) + if response.status_code == 201: + deserialized = self._deserialize('EventSourceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} + + def get( + self, resource_group_name, environment_name, event_source_name, custom_headers=None, raw=False, **operation_config): + """Gets the event source with the specified name in the specified + environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param event_source_name: The name of the Time Series Insights event + source associated with the specified environment. + :type event_source_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EventSourceResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.EventSourceResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'eventSourceName': self._serialize.url("event_source_name", event_source_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EventSourceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} + + def update( + self, resource_group_name, environment_name, event_source_name, parameters, custom_headers=None, raw=False, **operation_config): + """Updates the event source with the specified name in the specified + subscription, resource group, and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param event_source_name: The name of the Time Series Insights event + source associated with the specified environment. + :type event_source_name: str + :param tags: Key-value pairs of additional properties for the event + source. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EventSourceResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.EventSourceResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + event_source_update_parameters = parameters + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'eventSourceName': self._serialize.url("event_source_name", event_source_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(event_source_update_parameters, 'EventSourceUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EventSourceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} + + def delete( + self, resource_group_name, environment_name, event_source_name, custom_headers=None, raw=False, **operation_config): + """Deletes the event source with the specified name in the specified + subscription, resource group, and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param event_source_name: The name of the Time Series Insights event + source associated with the specified environment. + :type event_source_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'eventSourceName': self._serialize.url("event_source_name", event_source_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} + + def list_by_environment( + self, resource_group_name, environment_name, custom_headers=None, raw=False, **operation_config): + """Lists all the available event sources associated with the subscription + and within the specified resource group and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EventSourceListResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.EventSourceListResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_environment.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EventSourceListResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources'} diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_operations.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_operations.py new file mode 100644 index 00000000000..dcd7df980be --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_operations.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-08-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-15-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Time Series Insights related operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.timeseriesinsights.models.OperationPaged[~azure.mgmt.timeseriesinsights.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.TimeSeriesInsights/operations'} diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_reference_data_sets_operations.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_reference_data_sets_operations.py new file mode 100644 index 00000000000..f1d46529b72 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_reference_data_sets_operations.py @@ -0,0 +1,380 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ReferenceDataSetsOperations(object): + """ReferenceDataSetsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-08-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-15-preview" + + self.config = config + + def create_or_update( + self, resource_group_name, environment_name, reference_data_set_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update a reference data set in the specified environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param reference_data_set_name: Name of the reference data set. + :type reference_data_set_name: str + :param parameters: Parameters for creating a reference data set. + :type parameters: + ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ReferenceDataSetResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ReferenceDataSetCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ReferenceDataSetResource', response) + if response.status_code == 201: + deserialized = self._deserialize('ReferenceDataSetResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} + + def get( + self, resource_group_name, environment_name, reference_data_set_name, custom_headers=None, raw=False, **operation_config): + """Gets the reference data set with the specified name in the specified + environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param reference_data_set_name: The name of the Time Series Insights + reference data set associated with the specified environment. + :type reference_data_set_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ReferenceDataSetResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ReferenceDataSetResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} + + def update( + self, resource_group_name, environment_name, reference_data_set_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates the reference data set with the specified name in the specified + subscription, resource group, and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param reference_data_set_name: The name of the Time Series Insights + reference data set associated with the specified environment. + :type reference_data_set_name: str + :param tags: Key-value pairs of additional properties for the + reference data set. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ReferenceDataSetResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + reference_data_set_update_parameters = models.ReferenceDataSetUpdateParameters(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(reference_data_set_update_parameters, 'ReferenceDataSetUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ReferenceDataSetResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} + + def delete( + self, resource_group_name, environment_name, reference_data_set_name, custom_headers=None, raw=False, **operation_config): + """Deletes the reference data set with the specified name in the specified + subscription, resource group, and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param reference_data_set_name: The name of the Time Series Insights + reference data set associated with the specified environment. + :type reference_data_set_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} + + def list_by_environment( + self, resource_group_name, environment_name, custom_headers=None, raw=False, **operation_config): + """Lists all the available reference data sets associated with the + subscription and within the specified resource group and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ReferenceDataSetListResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetListResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_environment.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ReferenceDataSetListResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets'} diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/version.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/version.py new file mode 100644 index 00000000000..9bd1dfac7ec --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "0.2.0" + diff --git a/src/timeseriesinsights/setup.cfg b/src/timeseriesinsights/setup.cfg new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/timeseriesinsights/setup.py b/src/timeseriesinsights/setup.py new file mode 100644 index 00000000000..819630a743b --- /dev/null +++ b/src/timeseriesinsights/setup.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages +try: + from azure_bdist_wheel import cmdclass +except ImportError: + from distutils import log as logger + logger.warn("Wheel is not available, disabling bdist_wheel hook") + +VERSION = '0.1.0' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='timeseriesinsights', + version=VERSION, + description='Microsoft Azure Command-Line Tools TimeSeriesInsightsClient Extension', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/src/timeseriesinsights', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_timeseriesinsights': ['azext_metadata.json']}, +)