コード例 #1
0
    def regenerate_key(self,
                       resource_group_name,
                       resource_name,
                       key_type=None,
                       custom_headers=None,
                       raw=False,
                       polling=True,
                       **operation_config):
        """Regenerate SignalR service access key. PrimaryKey and SecondaryKey
        cannot be regenerated at the same time.

        :param resource_group_name: The name of the resource group that
         contains the resource. You can obtain this value from the Azure
         Resource Manager API or the portal.
        :type resource_group_name: str
        :param resource_name: The name of the SignalR resource.
        :type resource_name: str
        :param key_type: The keyType to regenerate. Must be either 'primary'
         or 'secondary'(case-insensitive). Possible values include: 'Primary',
         'Secondary'
        :type key_type: str or ~azure.mgmt.signalr.models.KeyType
        :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 SignalRKeys or
         ClientRawResponse<SignalRKeys> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.signalr.models.SignalRKeys]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.signalr.models.SignalRKeys]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._regenerate_key_initial(
            resource_group_name=resource_group_name,
            resource_name=resource_name,
            key_type=key_type,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('SignalRKeys', 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)
コード例 #2
0
    def create_or_update(self,
                         resource_group_name,
                         circuit_name,
                         authorization_name,
                         authorization_parameters,
                         custom_headers=None,
                         raw=False,
                         polling=True,
                         **operation_config):
        """Creates or updates an authorization in the specified express route
        circuit.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param circuit_name: The name of the express route circuit.
        :type circuit_name: str
        :param authorization_name: The name of the authorization.
        :type authorization_name: str
        :param authorization_parameters: Parameters supplied to the create or
         update express route circuit authorization operation.
        :type authorization_parameters:
         ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitAuthorization
        :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
         ExpressRouteCircuitAuthorization or
         ClientRawResponse<ExpressRouteCircuitAuthorization> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitAuthorization]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitAuthorization]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._create_or_update_initial(
            resource_group_name=resource_group_name,
            circuit_name=circuit_name,
            authorization_name=authorization_name,
            authorization_parameters=authorization_parameters,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize(
                'ExpressRouteCircuitAuthorization', 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)
コード例 #3
0
    def backend_health(self,
                       resource_group_name,
                       application_gateway_name,
                       expand=None,
                       custom_headers=None,
                       raw=False,
                       polling=True,
                       **operation_config):
        """Gets the backend health of the specified application gateway in a
        resource group.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param application_gateway_name: The name of the application gateway.
        :type application_gateway_name: str
        :param expand: Expands BackendAddressPool and BackendHttpSettings
         referenced in backend health.
        :type expand: str
        :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
         ApplicationGatewayBackendHealth or
         ClientRawResponse<ApplicationGatewayBackendHealth> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendHealth]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendHealth]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._backend_health_initial(
            resource_group_name=resource_group_name,
            application_gateway_name=application_gateway_name,
            expand=expand,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('ApplicationGatewayBackendHealth',
                                             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)
コード例 #4
0
    def update(self,
               resource_group_name,
               registry_name,
               replication_name,
               tags=None,
               custom_headers=None,
               raw=False,
               polling=True,
               **operation_config):
        """Updates a replication for a container registry with the specified
        parameters.

        :param resource_group_name: The name of the resource group to which
         the container registry belongs.
        :type resource_group_name: str
        :param registry_name: The name of the container registry.
        :type registry_name: str
        :param replication_name: The name of the replication.
        :type replication_name: str
        :param tags: The tags for the replication.
        :type tags: dict[str, str]
        :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 Replication or
         ClientRawResponse<Replication> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.Replication]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2017_10_01.models.Replication]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._update_initial(
            resource_group_name=resource_group_name,
            registry_name=registry_name,
            replication_name=replication_name,
            tags=tags,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('Replication', 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)
    def query(self,
              resource_group_name,
              network_watcher_name,
              connection_monitor_name,
              custom_headers=None,
              raw=False,
              polling=True,
              **operation_config):
        """Query a snapshot of the most recent connection states.

        :param resource_group_name: The name of the resource group containing
         Network Watcher.
        :type resource_group_name: str
        :param network_watcher_name: The name of the Network Watcher resource.
        :type network_watcher_name: str
        :param connection_monitor_name: The name given to the connection
         monitor.
        :type connection_monitor_name: str
        :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
         ConnectionMonitorQueryResult or
         ClientRawResponse<ConnectionMonitorQueryResult> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorQueryResult]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorQueryResult]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._query_initial(
            resource_group_name=resource_group_name,
            network_watcher_name=network_watcher_name,
            connection_monitor_name=connection_monitor_name,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('ConnectionMonitorQueryResult',
                                             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)
コード例 #6
0
    def delete(self,
               resource_group_name,
               profile_name,
               endpoint_name,
               custom_domain_name,
               custom_headers=None,
               raw=False,
               polling=True,
               **operation_config):
        """Deletes an existing custom domain within an endpoint.

        :param resource_group_name: Name of the Resource group within the
         Azure subscription.
        :type resource_group_name: str
        :param profile_name: Name of the CDN profile which is unique within
         the resource group.
        :type profile_name: str
        :param endpoint_name: Name of the endpoint under the profile which is
         unique globally.
        :type endpoint_name: str
        :param custom_domain_name: Name of the custom domain within an
         endpoint.
        :type custom_domain_name: str
        :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 CustomDomain or
         ClientRawResponse<CustomDomain> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cdn.models.CustomDomain]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cdn.models.CustomDomain]]
        :raises:
         :class:`ErrorResponseException<azure.mgmt.cdn.models.ErrorResponseException>`
        """
        raw_result = self._delete_initial(
            resource_group_name=resource_group_name,
            profile_name=profile_name,
            endpoint_name=endpoint_name,
            custom_domain_name=custom_domain_name,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('CustomDomain', 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)
    def update(self,
               resource_group_name,
               disk_name,
               disk,
               custom_headers=None,
               raw=False,
               polling=True,
               **operation_config):
        """Updates (patches) a disk.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param disk_name: The name of the managed disk that is being created.
         The name can't be changed after the disk is created. Supported
         characters for the name are a-z, A-Z, 0-9 and _. The maximum name
         length is 80 characters.
        :type disk_name: str
        :param disk: Disk object supplied in the body of the Patch disk
         operation.
        :type disk: ~azure.mgmt.compute.v2018_04_01.models.DiskUpdate
        :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 Disk or
         ClientRawResponse<Disk> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.Disk]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.Disk]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._update_initial(
            resource_group_name=resource_group_name,
            disk_name=disk_name,
            disk=disk,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('Disk', 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)
    def update(self,
               resource_group_name,
               server_name,
               database_name,
               retention_days=None,
               custom_headers=None,
               raw=False,
               polling=True,
               **operation_config):
        """Updates a database's short term retention policy.

        :param resource_group_name: The name of the resource group that
         contains the resource. You can obtain this value from the Azure
         Resource Manager API or the portal.
        :type resource_group_name: str
        :param server_name: The name of the server.
        :type server_name: str
        :param database_name: The name of the database.
        :type database_name: str
        :param retention_days: The backup retention period in days. This is
         how many days Point-in-Time Restore will be supported.
        :type retention_days: int
        :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
         BackupShortTermRetentionPolicy or
         ClientRawResponse<BackupShortTermRetentionPolicy> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._update_initial(
            resource_group_name=resource_group_name,
            server_name=server_name,
            database_name=database_name,
            retention_days=retention_days,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('BackupShortTermRetentionPolicy',
                                             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)
    def create_or_update(self,
                         resource_group_name,
                         config_store_name,
                         private_endpoint_connection_name,
                         private_link_service_connection_state,
                         private_endpoint=None,
                         custom_headers=None,
                         raw=False,
                         polling=True,
                         **operation_config):
        """Update the state of the specified private endpoint connection
        associated with the configuration store.

        :param resource_group_name: The name of the resource group to which
         the container registry belongs.
        :type resource_group_name: str
        :param config_store_name: The name of the configuration store.
        :type config_store_name: str
        :param private_endpoint_connection_name: Private endpoint connection
         name
        :type private_endpoint_connection_name: str
        :param private_link_service_connection_state: A collection of
         information about the state of the connection between service consumer
         and provider.
        :type private_link_service_connection_state:
         ~azure.mgmt.appconfiguration.models.PrivateLinkServiceConnectionState
        :param private_endpoint: The resource of private endpoint.
        :type private_endpoint:
         ~azure.mgmt.appconfiguration.models.PrivateEndpoint
        :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
         PrivateEndpointConnection or
         ClientRawResponse<PrivateEndpointConnection> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appconfiguration.models.PrivateEndpointConnection]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appconfiguration.models.PrivateEndpointConnection]]
        :raises:
         :class:`ErrorException<azure.mgmt.appconfiguration.models.ErrorException>`
        """
        raw_result = self._create_or_update_initial(
            resource_group_name=resource_group_name,
            config_store_name=config_store_name,
            private_endpoint_connection_name=private_endpoint_connection_name,
            private_link_service_connection_state=
            private_link_service_connection_state,
            private_endpoint=private_endpoint,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('PrivateEndpointConnection',
                                             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)
コード例 #10
0
    def get_p2s_vpn_connection_health_detailed(self,
                                               resource_group_name,
                                               gateway_name,
                                               vpn_user_names_filter=None,
                                               output_blob_sas_url=None,
                                               custom_headers=None,
                                               raw=False,
                                               polling=True,
                                               **operation_config):
        """Gets the sas url to get the connection health detail of P2S clients of
        the virtual wan P2SVpnGateway in the specified resource group.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param gateway_name: The name of the P2SVpnGateway.
        :type gateway_name: str
        :param vpn_user_names_filter: The list of p2s vpn user names whose p2s
         vpn connection detailed health to retrieve for.
        :type vpn_user_names_filter: list[str]
        :param output_blob_sas_url: The sas-url to download the P2S Vpn
         connection health detail.
        :type output_blob_sas_url: str
        :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 P2SVpnConnectionHealth
         or ClientRawResponse<P2SVpnConnectionHealth> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2019_11_01.models.P2SVpnConnectionHealth]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2019_11_01.models.P2SVpnConnectionHealth]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._get_p2s_vpn_connection_health_detailed_initial(
            resource_group_name=resource_group_name,
            gateway_name=gateway_name,
            vpn_user_names_filter=vpn_user_names_filter,
            output_blob_sas_url=output_blob_sas_url,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('P2SVpnConnectionHealth',
                                             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,
                lro_options={'final-state-via': 'location'},
                **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)
コード例 #11
0
    def create_or_update(self,
                         resource_group_name,
                         vpn_site_name,
                         vpn_site_parameters,
                         custom_headers=None,
                         raw=False,
                         polling=True,
                         **operation_config):
        """Creates a VpnSite resource if it doesn't exist else updates the
        existing VpnSite.

        :param resource_group_name: The resource group name of the VpnSite.
        :type resource_group_name: str
        :param vpn_site_name: The name of the VpnSite being created or
         updated.
        :type vpn_site_name: str
        :param vpn_site_parameters: Parameters supplied to create or update
         VpnSite.
        :type vpn_site_parameters:
         ~azure.mgmt.network.v2018_11_01.models.VpnSite
        :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 VpnSite or
         ClientRawResponse<VpnSite> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_11_01.models.VpnSite]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_11_01.models.VpnSite]]
        :raises:
         :class:`ErrorException<azure.mgmt.network.v2018_11_01.models.ErrorException>`
        """
        raw_result = self._create_or_update_initial(
            resource_group_name=resource_group_name,
            vpn_site_name=vpn_site_name,
            vpn_site_parameters=vpn_site_parameters,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('VpnSite', 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)
コード例 #12
0
    def generate_vpn_profile(self,
                             resource_group_name,
                             gateway_name,
                             authentication_method=None,
                             custom_headers=None,
                             raw=False,
                             polling=True,
                             **operation_config):
        """Generates VPN profile for P2S client of the P2SVpnGateway in the
        specified resource group.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param gateway_name: The name of the P2SVpnGateway.
        :type gateway_name: str
        :param authentication_method: VPN client authentication method.
         Possible values include: 'EAPTLS', 'EAPMSCHAPv2'
        :type authentication_method: str or
         ~azure.mgmt.network.v2019_11_01.models.AuthenticationMethod
        :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 VpnProfileResponse or
         ClientRawResponse<VpnProfileResponse> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2019_11_01.models.VpnProfileResponse]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2019_11_01.models.VpnProfileResponse]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._generate_vpn_profile_initial(
            resource_group_name=resource_group_name,
            gateway_name=gateway_name,
            authentication_method=authentication_method,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('VpnProfileResponse', 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,
                lro_options={'final-state-via': 'location'},
                **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)
コード例 #13
0
    def create_or_update(self,
                         resource_group_name,
                         gateway_name,
                         p2_svpn_gateway_parameters,
                         custom_headers=None,
                         raw=False,
                         polling=True,
                         **operation_config):
        """Creates a virtual wan p2s vpn gateway if it doesn't exist else updates
        the existing gateway.

        :param resource_group_name: The resource group name of the
         P2SVpnGateway.
        :type resource_group_name: str
        :param gateway_name: The name of the gateway.
        :type gateway_name: str
        :param p2_svpn_gateway_parameters: Parameters supplied to create or
         Update a virtual wan p2s vpn gateway.
        :type p2_svpn_gateway_parameters:
         ~azure.mgmt.network.v2019_11_01.models.P2SVpnGateway
        :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 P2SVpnGateway or
         ClientRawResponse<P2SVpnGateway> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2019_11_01.models.P2SVpnGateway]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2019_11_01.models.P2SVpnGateway]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._create_or_update_initial(
            resource_group_name=resource_group_name,
            gateway_name=gateway_name,
            p2_svpn_gateway_parameters=p2_svpn_gateway_parameters,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('P2SVpnGateway', 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)
コード例 #14
0
    def create_or_update(self,
                         resource_group_name,
                         server_name,
                         configuration_name,
                         value=None,
                         source=None,
                         custom_headers=None,
                         raw=False,
                         polling=True,
                         **operation_config):
        """Updates a configuration of a server.

        :param resource_group_name: The name of the resource group that
         contains the resource. You can obtain this value from the Azure
         Resource Manager API or the portal.
        :type resource_group_name: str
        :param server_name: The name of the server.
        :type server_name: str
        :param configuration_name: The name of the server configuration.
        :type configuration_name: str
        :param value: Value of the configuration.
        :type value: str
        :param source: Source of the configuration.
        :type source: str
        :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 Configuration or
         ClientRawResponse<Configuration> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mariadb.models.Configuration]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.mariadb.models.Configuration]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._create_or_update_initial(
            resource_group_name=resource_group_name,
            server_name=server_name,
            configuration_name=configuration_name,
            value=value,
            source=source,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('Configuration', 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)
コード例 #15
0
    def create_and_start_migration(self,
                                   resource_group_name,
                                   namespace_name,
                                   target_namespace,
                                   post_migration_name,
                                   custom_headers=None,
                                   raw=False,
                                   polling=True,
                                   **operation_config):
        """Creates Migration configuration and starts migration of enties from
        Standard to Premium namespace.

        :param resource_group_name: Name of the Resource group within the
         Azure subscription.
        :type resource_group_name: str
        :param namespace_name: The namespace name
        :type namespace_name: str
        :param target_namespace: Existing premium Namespace ARM Id name which
         has no entities, will be used for migration
        :type target_namespace: str
        :param post_migration_name: Name to access Standard Namespace after
         migration
        :type post_migration_name: str
        :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
         MigrationConfigProperties or
         ClientRawResponse<MigrationConfigProperties> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servicebus.models.MigrationConfigProperties]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.servicebus.models.MigrationConfigProperties]]
        :raises:
         :class:`ErrorResponseException<azure.mgmt.servicebus.models.ErrorResponseException>`
        """
        raw_result = self._create_and_start_migration_initial(
            resource_group_name=resource_group_name,
            namespace_name=namespace_name,
            target_namespace=target_namespace,
            post_migration_name=post_migration_name,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('MigrationConfigProperties',
                                             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)
コード例 #16
0
    def create_or_update(self,
                         resource_group_name,
                         workspace_name,
                         sql_pool_name,
                         workload_group_name,
                         parameters,
                         custom_headers=None,
                         raw=False,
                         polling=True,
                         **operation_config):
        """Create Or Update workload group.

        Create Or Update a Sql pool's workload group.

        :param resource_group_name: The name of the resource group. The name
         is case insensitive.
        :type resource_group_name: str
        :param workspace_name: The name of the workspace
        :type workspace_name: str
        :param sql_pool_name: SQL pool name
        :type sql_pool_name: str
        :param workload_group_name: The name of the workload group.
        :type workload_group_name: str
        :param parameters: The requested workload group state.
        :type parameters: ~azure.mgmt.synapse.models.WorkloadGroup
        :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 WorkloadGroup or
         ClientRawResponse<WorkloadGroup> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.synapse.models.WorkloadGroup]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.synapse.models.WorkloadGroup]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._create_or_update_initial(
            resource_group_name=resource_group_name,
            workspace_name=workspace_name,
            sql_pool_name=sql_pool_name,
            workload_group_name=workload_group_name,
            parameters=parameters,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('WorkloadGroup', 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)
    def create_or_update(self,
                         resource_group_name,
                         firewall_policy_name,
                         rule_group_name,
                         parameters,
                         custom_headers=None,
                         raw=False,
                         polling=True,
                         **operation_config):
        """Creates or updates the specified FirewallPolicyRuleGroup.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param firewall_policy_name: The name of the Firewall Policy.
        :type firewall_policy_name: str
        :param rule_group_name: The name of the FirewallPolicyRuleGroup.
        :type rule_group_name: str
        :param parameters: Parameters supplied to the create or update
         FirewallPolicyRuleGroup operation.
        :type parameters:
         ~azure.mgmt.network.v2019_06_01.models.FirewallPolicyRuleGroup
        :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 FirewallPolicyRuleGroup
         or ClientRawResponse<FirewallPolicyRuleGroup> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2019_06_01.models.FirewallPolicyRuleGroup]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2019_06_01.models.FirewallPolicyRuleGroup]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._create_or_update_initial(
            resource_group_name=resource_group_name,
            firewall_policy_name=firewall_policy_name,
            rule_group_name=rule_group_name,
            parameters=parameters,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('FirewallPolicyRuleGroup',
                                             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)
    def create_or_update(self,
                         resource_group_name,
                         managed_instance_name,
                         server_key_type,
                         server_key_name=None,
                         custom_headers=None,
                         raw=False,
                         polling=True,
                         **operation_config):
        """Updates an existing encryption protector.

        :param resource_group_name: The name of the resource group that
         contains the resource. You can obtain this value from the Azure
         Resource Manager API or the portal.
        :type resource_group_name: str
        :param managed_instance_name: The name of the managed instance.
        :type managed_instance_name: str
        :param server_key_type: The encryption protector type like
         'ServiceManaged', 'AzureKeyVault'. Possible values include:
         'ServiceManaged', 'AzureKeyVault'
        :type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType
        :param server_key_name: The name of the managed instance key.
        :type server_key_name: str
        :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
         ManagedInstanceEncryptionProtector or
         ClientRawResponse<ManagedInstanceEncryptionProtector> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._create_or_update_initial(
            resource_group_name=resource_group_name,
            managed_instance_name=managed_instance_name,
            server_key_type=server_key_type,
            server_key_name=server_key_name,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize(
                'ManagedInstanceEncryptionProtector', 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)
    def update(self,
               resource_group_name,
               cluster_name,
               database_name,
               data_connection_name,
               parameters,
               custom_headers=None,
               raw=False,
               polling=True,
               **operation_config):
        """Updates a data connection.

        :param resource_group_name: The name of the resource group containing
         the Kusto cluster.
        :type resource_group_name: str
        :param cluster_name: The name of the Kusto cluster.
        :type cluster_name: str
        :param database_name: The name of the database in the Kusto cluster.
        :type database_name: str
        :param data_connection_name: The name of the data connection.
        :type data_connection_name: str
        :param parameters: The data connection parameters supplied to the
         Update operation.
        :type parameters: ~azure.mgmt.kusto.models.DataConnection
        :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 DataConnection or
         ClientRawResponse<DataConnection> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.kusto.models.DataConnection]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.kusto.models.DataConnection]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._update_initial(
            resource_group_name=resource_group_name,
            cluster_name=cluster_name,
            database_name=database_name,
            data_connection_name=data_connection_name,
            parameters=parameters,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('DataConnection', 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)
コード例 #20
0
    def update_tags(self,
                    resource_group_name,
                    virtual_network_gateway_connection_name,
                    tags=None,
                    custom_headers=None,
                    raw=False,
                    polling=True,
                    **operation_config):
        """Updates a virtual network gateway connection tags.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param virtual_network_gateway_connection_name: The name of the
         virtual network gateway connection.
        :type virtual_network_gateway_connection_name: str
        :param tags: Resource tags.
        :type tags: dict[str, str]
        :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
         VirtualNetworkGatewayConnection or
         ClientRawResponse<VirtualNetworkGatewayConnection> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGatewayConnection]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGatewayConnection]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._update_tags_initial(
            resource_group_name=resource_group_name,
            virtual_network_gateway_connection_name=
            virtual_network_gateway_connection_name,
            tags=tags,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('VirtualNetworkGatewayConnection',
                                             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)
    def grant_access(self,
                     resource_group_name,
                     disk_name,
                     access,
                     duration_in_seconds,
                     custom_headers=None,
                     raw=False,
                     polling=True,
                     **operation_config):
        """Grants access to a disk.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param disk_name: The name of the managed disk that is being created.
         The name can't be changed after the disk is created. Supported
         characters for the name are a-z, A-Z, 0-9 and _. The maximum name
         length is 80 characters.
        :type disk_name: str
        :param access: Possible values include: 'None', 'Read'
        :type access: str or
         ~azure.mgmt.compute.v2018_04_01.models.AccessLevel
        :param duration_in_seconds: Time duration in seconds until the SAS
         access expires.
        :type duration_in_seconds: int
        :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 AccessUri or
         ClientRawResponse<AccessUri> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.AccessUri]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.AccessUri]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._grant_access_initial(
            resource_group_name=resource_group_name,
            disk_name=disk_name,
            access=access,
            duration_in_seconds=duration_in_seconds,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('AccessUri', 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,
                lro_options={'final-state-via': 'location'},
                **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)
コード例 #22
0
    def reset_shared_key(self,
                         resource_group_name,
                         virtual_network_gateway_connection_name,
                         key_length,
                         custom_headers=None,
                         raw=False,
                         polling=True,
                         **operation_config):
        """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the
        virtual network gateway connection shared key for passed virtual
        network gateway connection in the specified resource group through
        Network resource provider.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param virtual_network_gateway_connection_name: The virtual network
         gateway connection reset shared key Name.
        :type virtual_network_gateway_connection_name: str
        :param key_length: The virtual network connection reset shared key
         length, should between 1 and 128.
        :type key_length: int
        :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
         ConnectionResetSharedKey or
         ClientRawResponse<ConnectionResetSharedKey> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2019_06_01.models.ConnectionResetSharedKey]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2019_06_01.models.ConnectionResetSharedKey]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._reset_shared_key_initial(
            resource_group_name=resource_group_name,
            virtual_network_gateway_connection_name=
            virtual_network_gateway_connection_name,
            key_length=key_length,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('ConnectionResetSharedKey',
                                             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,
                lro_options={'final-state-via': 'location'},
                **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)
コード例 #23
0
    def list_routes_table(self,
                          resource_group_name,
                          cross_connection_name,
                          peering_name,
                          device_path,
                          custom_headers=None,
                          raw=False,
                          polling=True,
                          **operation_config):
        """Gets the currently advertised routes table associated with the express
        route cross connection in a resource group.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param cross_connection_name: The name of the
         ExpressRouteCrossConnection.
        :type cross_connection_name: str
        :param peering_name: The name of the peering.
        :type peering_name: str
        :param device_path: The path of the device.
        :type device_path: str
        :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
         ExpressRouteCircuitsRoutesTableListResult or
         ClientRawResponse<ExpressRouteCircuitsRoutesTableListResult> if
         raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitsRoutesTableListResult]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitsRoutesTableListResult]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._list_routes_table_initial(
            resource_group_name=resource_group_name,
            cross_connection_name=cross_connection_name,
            peering_name=peering_name,
            device_path=device_path,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize(
                'ExpressRouteCircuitsRoutesTableListResult', 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,
                lro_options={'final-state-via': 'location'},
                **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)
コード例 #24
0
    def update(self,
               resource_group_name,
               host_group_name,
               host_name,
               parameters,
               custom_headers=None,
               raw=False,
               polling=True,
               **operation_config):
        """Update an dedicated host .

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param host_group_name: The name of the dedicated host group.
        :type host_group_name: str
        :param host_name: The name of the dedicated host .
        :type host_name: str
        :param parameters: Parameters supplied to the Update Dedicated Host
         operation.
        :type parameters:
         ~azure.mgmt.compute.v2019_12_01.models.DedicatedHostUpdate
        :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 DedicatedHost or
         ClientRawResponse<DedicatedHost> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2019_12_01.models.DedicatedHost]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2019_12_01.models.DedicatedHost]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._update_initial(
            resource_group_name=resource_group_name,
            host_group_name=host_group_name,
            host_name=host_name,
            parameters=parameters,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('DedicatedHost', 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)
コード例 #25
0
    def update(self,
               resource_group_name,
               cluster_name,
               application_name,
               service_name,
               parameters,
               custom_headers=None,
               raw=False,
               polling=True,
               **operation_config):
        """Updates a Service Fabric service resource.

        Update a Service Fabric service resource with the specified name.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param cluster_name: The name of the cluster resource.
        :type cluster_name: str
        :param application_name: The name of the application resource.
        :type application_name: str
        :param service_name: The name of the service resource in the format of
         {applicationName}~{serviceName}.
        :type service_name: str
        :param parameters: The service resource for patch operations.
        :type parameters:
         ~azure.mgmt.servicefabric.models.ServiceResourceUpdate
        :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 ServiceResource or
         ClientRawResponse<ServiceResource> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servicefabric.models.ServiceResource]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.servicefabric.models.ServiceResource]]
        :raises:
         :class:`ErrorModelException<azure.mgmt.servicefabric.models.ErrorModelException>`
        """
        raw_result = self._update_initial(
            resource_group_name=resource_group_name,
            cluster_name=cluster_name,
            application_name=application_name,
            service_name=service_name,
            parameters=parameters,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('ServiceResource', 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)
コード例 #26
0
    def create_or_update(self,
                         resource_group_name,
                         gallery_name,
                         gallery_image_name,
                         gallery_image,
                         custom_headers=None,
                         raw=False,
                         polling=True,
                         **operation_config):
        """Create or update a gallery Image Definition.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param gallery_name: The name of the Shared Image Gallery in which the
         Image Definition is to be created.
        :type gallery_name: str
        :param gallery_image_name: The name of the gallery Image Definition to
         be created or updated. The allowed characters are alphabets and
         numbers with dots, dashes, and periods allowed in the middle. The
         maximum length is 80 characters.
        :type gallery_image_name: str
        :param gallery_image: Parameters supplied to the create or update
         gallery image operation.
        :type gallery_image:
         ~azure.mgmt.compute.v2019_07_01.models.GalleryImage
        :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 GalleryImage or
         ClientRawResponse<GalleryImage> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2019_07_01.models.GalleryImage]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2019_07_01.models.GalleryImage]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._create_or_update_initial(
            resource_group_name=resource_group_name,
            gallery_name=gallery_name,
            gallery_image_name=gallery_image_name,
            gallery_image=gallery_image,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('GalleryImage', 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)
コード例 #27
0
    def create(self,
               resource_group_name,
               hana_instance_name,
               hana_instance_parameter,
               custom_headers=None,
               raw=False,
               polling=True,
               **operation_config):
        """Creates a SAP HANA instance.

        Creates a SAP HANA instance for the specified subscription, resource
        group, and instance name.

        :param resource_group_name: Name of the resource group.
        :type resource_group_name: str
        :param hana_instance_name: Name of the SAP HANA on Azure instance.
        :type hana_instance_name: str
        :param hana_instance_parameter: Request body representing a
         HanaInstance
        :type hana_instance_parameter:
         ~azure.mgmt.hanaonazure.models.HanaInstance
        :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 HanaInstance or
         ClientRawResponse<HanaInstance> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.hanaonazure.models.HanaInstance]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.hanaonazure.models.HanaInstance]]
        :raises:
         :class:`ErrorResponseException<azure.mgmt.hanaonazure.models.ErrorResponseException>`
        """
        raw_result = self._create_initial(
            resource_group_name=resource_group_name,
            hana_instance_name=hana_instance_name,
            hana_instance_parameter=hana_instance_parameter,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('HanaInstance', 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)
    def update(self,
               resource_group_name,
               registry_name,
               scope_map_name,
               description=None,
               actions=None,
               custom_headers=None,
               raw=False,
               polling=True,
               **operation_config):
        """Updates a scope map with the specified parameters.

        :param resource_group_name: The name of the resource group to which
         the container registry belongs.
        :type resource_group_name: str
        :param registry_name: The name of the container registry.
        :type registry_name: str
        :param scope_map_name: The name of the scope map.
        :type scope_map_name: str
        :param description: The user friendly description of the scope map.
        :type description: str
        :param actions: The list of scope permissions for registry artifacts.
         E.g. repositories/repository-name/pull,
         repositories/repository-name/delete
        :type actions: list[str]
        :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 ScopeMap or
         ClientRawResponse<ScopeMap> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_06_01_preview.models.ScopeMap]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_06_01_preview.models.ScopeMap]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._update_initial(
            resource_group_name=resource_group_name,
            registry_name=registry_name,
            scope_map_name=scope_map_name,
            description=description,
            actions=actions,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('ScopeMap', 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)
    def create_or_update(self,
                         resource_group_name,
                         load_balancer_name,
                         inbound_nat_rule_name,
                         inbound_nat_rule_parameters,
                         custom_headers=None,
                         raw=False,
                         polling=True,
                         **operation_config):
        """Creates or updates a load balancer inbound nat rule.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param load_balancer_name: The name of the load balancer.
        :type load_balancer_name: str
        :param inbound_nat_rule_name: The name of the inbound nat rule.
        :type inbound_nat_rule_name: str
        :param inbound_nat_rule_parameters: Parameters supplied to the create
         or update inbound nat rule operation.
        :type inbound_nat_rule_parameters:
         ~azure.mgmt.network.v2018_01_01.models.InboundNatRule
        :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 InboundNatRule or
         ClientRawResponse<InboundNatRule> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.InboundNatRule]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.InboundNatRule]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._create_or_update_initial(
            resource_group_name=resource_group_name,
            load_balancer_name=load_balancer_name,
            inbound_nat_rule_name=inbound_nat_rule_name,
            inbound_nat_rule_parameters=inbound_nat_rule_parameters,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            deserialized = self._deserialize('InboundNatRule', 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)
コード例 #30
0
    def create(
            self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config):
        """Creates a new Batch account with the specified parameters. Existing
        accounts cannot be updated with this API and should instead be updated
        with the Update Batch Account API.

        :param resource_group_name: The name of the resource group that
         contains the Batch account.
        :type resource_group_name: str
        :param account_name: A name for the Batch account which must be unique
         within the region. Batch account names must be between 3 and 24
         characters in length and must use only numbers and lowercase letters.
         This name is used as part of the DNS name that is used to access the
         Batch service in the region in which the account is created. For
         example: http://accountname.region.batch.azure.com/.
        :type account_name: str
        :param parameters: Additional parameters for account creation.
        :type parameters:
         ~azure.mgmt.batch.models.BatchAccountCreateParameters
        :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 BatchAccount or
         ClientRawResponse<BatchAccount> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.batch.models.BatchAccount]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.batch.models.BatchAccount]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._create_initial(
            resource_group_name=resource_group_name,
            account_name=account_name,
            parameters=parameters,
            custom_headers=custom_headers,
            raw=True,
            **operation_config
        )

        def get_long_running_output(response):
            header_dict = {
                'Location': 'str',
                'Retry-After': 'int',
            }
            deserialized = self._deserialize('BatchAccount', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                client_raw_response.add_headers(header_dict)
                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)