id
int64 0
843k
| repository_name
stringlengths 7
55
| file_path
stringlengths 9
332
| class_name
stringlengths 3
290
| human_written_code
stringlengths 12
4.36M
| class_skeleton
stringlengths 19
2.2M
| total_program_units
int64 1
9.57k
| total_doc_str
int64 0
4.2k
| AvgCountLine
float64 0
7.89k
| AvgCountLineBlank
float64 0
300
| AvgCountLineCode
float64 0
7.89k
| AvgCountLineComment
float64 0
7.89k
| AvgCyclomatic
float64 0
130
| CommentToCodeRatio
float64 0
176
| CountClassBase
float64 0
48
| CountClassCoupled
float64 0
589
| CountClassCoupledModified
float64 0
581
| CountClassDerived
float64 0
5.37k
| CountDeclInstanceMethod
float64 0
4.2k
| CountDeclInstanceVariable
float64 0
299
| CountDeclMethod
float64 0
4.2k
| CountDeclMethodAll
float64 0
4.2k
| CountLine
float64 1
115k
| CountLineBlank
float64 0
9.01k
| CountLineCode
float64 0
94.4k
| CountLineCodeDecl
float64 0
46.1k
| CountLineCodeExe
float64 0
91.3k
| CountLineComment
float64 0
27k
| CountStmt
float64 1
93.2k
| CountStmtDecl
float64 0
46.1k
| CountStmtExe
float64 0
90.2k
| MaxCyclomatic
float64 0
759
| MaxInheritanceTree
float64 0
16
| MaxNesting
float64 0
34
| SumCyclomatic
float64 0
6k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8,400 |
Azure/azure-cli-extensions
|
src/databox/azext_databox/__init__.py
|
azext_databox.DataBoxCommandsLoader
|
class DataBoxCommandsLoader(AzCommandsLoader):
def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
custom_command_type = CliCommandType(
operations_tmpl='azext_databox.custom#{}')
super().__init__(cli_ctx=cli_ctx,
custom_command_type=custom_command_type)
def load_command_table(self, args):
from azext_databox.commands import load_command_table
from azure.cli.core.aaz import load_aaz_command_table
try:
from . import aaz
except ImportError:
aaz = None
if aaz:
load_aaz_command_table(
loader=self,
aaz_pkg_name=aaz.__name__,
args=args
)
load_command_table(self, args)
return self.command_table
def load_arguments(self, command):
from azext_databox._params import load_arguments
load_arguments(self, command)
|
class DataBoxCommandsLoader(AzCommandsLoader):
def __init__(self, cli_ctx=None):
pass
def load_command_table(self, args):
pass
def load_arguments(self, command):
pass
| 4 | 0 | 8 | 0 | 8 | 0 | 2 | 0.04 | 1 | 2 | 0 | 0 | 3 | 0 | 3 | 3 | 28 | 3 | 25 | 10 | 16 | 1 | 19 | 10 | 10 | 3 | 1 | 1 | 5 |
8,401 |
Azure/azure-cli-extensions
|
src/databox/azext_databox/aaz/latest/databox/__cmd_group.py
|
azext_databox.aaz.latest.databox.__cmd_group.__CMDGroup
|
class __CMDGroup(AAZCommandGroup):
"""Manage data box
"""
pass
|
class __CMDGroup(AAZCommandGroup):
'''Manage data box
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 2 | 1 | 1 | 2 | 2 | 1 | 1 | 0 | 1 | 0 | 0 |
8,402 |
Azure/azure-cli-extensions
|
src/databox/azext_databox/aaz/latest/databox/job/__cmd_group.py
|
azext_databox.aaz.latest.databox.job.__cmd_group.__CMDGroup
|
class __CMDGroup(AAZCommandGroup):
"""Manage data box job
"""
pass
|
class __CMDGroup(AAZCommandGroup):
'''Manage data box job
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 2 | 1 | 1 | 2 | 2 | 1 | 1 | 0 | 1 | 0 | 0 |
8,403 |
Azure/azure-cli-extensions
|
src/databox/azext_databox/aaz/latest/databox/job/_cancel.py
|
azext_databox.aaz.latest.databox.job._cancel.Cancel
|
class Cancel(AAZCommand):
"""CancelJob.
:example: Cancel job
az databox job cancel -g rg --job-name name --reason reason
"""
_aaz_info = {
"version": "2022-12-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databox/jobs/{}/cancel", "2022-12-01"],
]
}
def _handler(self, command_args):
super()._handler(command_args)
self._execute_operations()
return None
_args_schema = None
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
if cls._args_schema is not None:
return cls._args_schema
cls._args_schema = super()._build_arguments_schema(*args, **kwargs)
# define Arg Group ""
_args_schema = cls._args_schema
_args_schema.job_name = AAZStrArg(
options=["-n", "--name", "--job-name"],
help="The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[-\w\.]+$",
max_length=24,
min_length=3,
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
# define Arg Group "CancellationReason"
_args_schema = cls._args_schema
_args_schema.reason = AAZStrArg(
options=["--reason"],
arg_group="CancellationReason",
help="Reason for cancellation.",
required=True,
)
return cls._args_schema
def _execute_operations(self):
self.pre_operations()
self.JobsCancel(ctx=self.ctx)()
self.post_operations()
@register_callback
def pre_operations(self):
pass
@register_callback
def post_operations(self):
pass
class JobsCancel(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(request=request, stream=False, **kwargs)
if session.http_response.status_code in [204]:
return self.on_204(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel",
**self.url_parameters
)
@property
def method(self):
return "POST"
@property
def error_format(self):
return "ODataV4Format"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"jobName", self.ctx.args.job_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-12-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("reason", AAZStrType, ".reason", typ_kwargs={"flags": {"required": True}})
return self.serialize_content(_content_value)
def on_204(self, session):
pass
|
class Cancel(AAZCommand):
'''CancelJob.
:example: Cancel job
az databox job cancel -g rg --job-name name --reason reason
'''
def _handler(self, command_args):
pass
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
pass
def _execute_operations(self):
pass
@register_callback
def pre_operations(self):
pass
@register_callback
def post_operations(self):
pass
class JobsCancel(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
@property
def content(self):
pass
def on_204(self, session):
pass
| 26 | 1 | 7 | 0 | 7 | 0 | 1 | 0.05 | 1 | 2 | 1 | 0 | 4 | 0 | 5 | 5 | 145 | 24 | 115 | 36 | 89 | 6 | 54 | 26 | 38 | 2 | 1 | 1 | 16 |
8,404 |
Azure/azure-cli-extensions
|
src/databox/azext_databox/aaz/latest/databox/job/_create.py
|
azext_databox.aaz.latest.databox.job._create.Create
|
class Create(AAZCommand):
"""Create a new job with the specified parameters.
:example: Create job
az databox job create -g rg -n job-name --sku databox --contact-name 'test' --phone 14258828080 --email-list testing@microsoft.com --street-address1 "1 MICROSOFT WAY" --city Redmond --state-or-province WA --country US --postal-code 98052 --company-name Microsoft --storage-account account-id --staging-storage-account account-id --resource-group-for-managed-disk rg --transfer-type ImportToAzure --kek-type MicrosoftManaged
"""
_aaz_info = {
"version": "2022-12-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databox/jobs/{}", "2022-12-01"],
]
}
AZ_SUPPORT_NO_WAIT = True
def _handler(self, command_args):
super()._handler(command_args)
return self.build_lro_poller(self._execute_operations, self._output)
_args_schema = None
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
if cls._args_schema is not None:
return cls._args_schema
cls._args_schema = super()._build_arguments_schema(*args, **kwargs)
# define Arg Group ""
_args_schema = cls._args_schema
_args_schema.job_name = AAZStrArg(
options=["-n", "--name", "--job-name"],
help="The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only",
required=True,
fmt=AAZStrArgFormat(
pattern="^[-\w\.]+$",
max_length=24,
min_length=3,
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
# define Arg Group "ContactDetails"
_args_schema = cls._args_schema
_args_schema.contact_name = AAZStrArg(
options=["--contact-name"],
arg_group="ContactDetails",
help="Contact name of the person.",
)
_args_schema.email_list = AAZListArg(
options=["--email-list"],
arg_group="ContactDetails",
help="List of Email-ids to be notified about job progress.",
)
_args_schema.mobile = AAZStrArg(
options=["--mobile"],
arg_group="ContactDetails",
help="Mobile number of the contact person.",
)
_args_schema.phone = AAZStrArg(
options=["--phone"],
arg_group="ContactDetails",
help="Phone number of the contact person.",
)
email_list = cls._args_schema.email_list
email_list.Element = AAZStrArg()
# define Arg Group "Details"
_args_schema = cls._args_schema
_args_schema.data_box = AAZObjectArg(
options=["--data-box"],
arg_group="Details",
help="Databox Job Details.",
)
_args_schema.data_box_customer_disk = AAZObjectArg(
options=["--data-box-customer-disk"],
arg_group="Details",
help="Customer disk job details.",
)
_args_schema.data_box_disk = AAZObjectArg(
options=["--data-box-disk"],
arg_group="Details",
help="Databox Heavy Device Job Details",
)
_args_schema.data_box_heavy = AAZObjectArg(
options=["--data-box-heavy"],
arg_group="Details",
help="Databox Heavy Device Job Details",
)
_args_schema.data_export_details = AAZListArg(
options=["--data-export-details"],
arg_group="Details",
help="Details of the data to be exported from azure.",
)
_args_schema.data_import_details = AAZListArg(
options=["--data-import-details"],
arg_group="Details",
help="Details of the data to be imported into azure.",
)
_args_schema.expected_data_size = AAZIntArg(
options=["--expected-data-size"],
arg_group="Details",
help="The expected size of the data, which needs to be transferred in this job, in terabytes.",
)
data_box = cls._args_schema.data_box
data_box.device_password = AAZStrArg(
options=["device-password"],
help="Set Device password for unlocking Databox. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#\-$%^!+=;:_()]+",
)
data_box_customer_disk = cls._args_schema.data_box_customer_disk
data_box_customer_disk.enable_manifest_backup = AAZBoolArg(
options=["enable-manifest-backup"],
help="Flag to indicate if disk manifest should be backed-up in the Storage Account.",
default=False,
)
data_box_customer_disk.import_disk_details_collection = AAZDictArg(
options=["import-disk-details-collection"],
help="Contains the map of disk serial number to the disk details for import jobs.",
)
data_box_customer_disk.return_to_customer_package_details = AAZObjectArg(
options=["return-to-customer-package-details"],
help="Return package shipping details.",
required=True,
)
import_disk_details_collection = cls._args_schema.data_box_customer_disk.import_disk_details_collection
import_disk_details_collection.Element = AAZObjectArg()
_element = cls._args_schema.data_box_customer_disk.import_disk_details_collection.Element
_element.bit_locker_key = AAZStrArg(
options=["bit-locker-key"],
help="BitLocker key used to encrypt the disk.",
required=True,
)
_element.manifest_file = AAZStrArg(
options=["manifest-file"],
help="The relative path of the manifest file on the disk.",
required=True,
)
_element.manifest_hash = AAZStrArg(
options=["manifest-hash"],
help="The Base16-encoded MD5 hash of the manifest file on the disk.",
required=True,
)
return_to_customer_package_details = cls._args_schema.data_box_customer_disk.return_to_customer_package_details
return_to_customer_package_details.carrier_account_number = AAZStrArg(
options=["carrier-account-number"],
help="Carrier Account Number of customer for customer disk.",
)
return_to_customer_package_details.carrier_name = AAZStrArg(
options=["carrier-name"],
help="Name of the carrier.",
)
return_to_customer_package_details.tracking_id = AAZStrArg(
options=["tracking-id"],
help="Tracking Id of shipment.",
)
data_box_disk = cls._args_schema.data_box_disk
data_box_disk.passkey = AAZStrArg(
options=["passkey"],
help="User entered passkey for DataBox Disk job.",
)
data_box_disk.preferred_disks = AAZDictArg(
options=["preferred-disks"],
help="User preference on what size disks are needed for the job. The map is from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but will be checked against an int.",
)
preferred_disks = cls._args_schema.data_box_disk.preferred_disks
preferred_disks.Element = AAZIntArg()
data_box_heavy = cls._args_schema.data_box_heavy
data_box_heavy.device_password = AAZStrArg(
options=["device-password"],
help="Set Device password for unlocking Databox Heavy. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#\-$%^!+=;:_()]+",
)
data_export_details = cls._args_schema.data_export_details
data_export_details.Element = AAZObjectArg()
_element = cls._args_schema.data_export_details.Element
_element.account_details = AAZObjectArg(
options=["account-details"],
help="Account details of the data to be transferred",
required=True,
)
_element.log_collection_level = AAZStrArg(
options=["log-collection-level"],
help="Level of the logs to be collected.",
default="Error",
enum={"Error": "Error", "Verbose": "Verbose"},
)
_element.transfer_configuration = AAZObjectArg(
options=["transfer-configuration"],
help="Configuration for the data transfer.",
required=True,
)
account_details = cls._args_schema.data_export_details.Element.account_details
account_details.managed_disk = AAZObjectArg(
options=["managed-disk"],
)
account_details.storage_account = AAZObjectArg(
options=["storage-account"],
)
account_details.share_password = AAZStrArg(
options=["share-password"],
help="Password for all the shares to be created on the device. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#\-$%^!+=;:_()]+",
)
managed_disk = cls._args_schema.data_export_details.Element.account_details.managed_disk
managed_disk.resource_group_id = AAZStrArg(
options=["resource-group-id"],
help="Resource Group Id of the compute disks.",
required=True,
)
managed_disk.staging_storage_account_id = AAZStrArg(
options=["staging-storage-account-id"],
help="Resource Id of the storage account that can be used to copy the vhd for staging.",
required=True,
)
storage_account = cls._args_schema.data_export_details.Element.account_details.storage_account
storage_account.storage_account_id = AAZStrArg(
options=["storage-account-id"],
help="Storage Account Resource Id.",
required=True,
)
transfer_configuration = cls._args_schema.data_export_details.Element.transfer_configuration
transfer_configuration.transfer_all_details = AAZObjectArg(
options=["transfer-all-details"],
help="Map of filter type and the details to transfer all data. This field is required only if the TransferConfigurationType is given as TransferAll",
)
transfer_configuration.transfer_configuration_type = AAZStrArg(
options=["transfer-configuration-type"],
help="Type of the configuration for transfer.",
required=True,
enum={"TransferAll": "TransferAll", "TransferUsingFilter": "TransferUsingFilter"},
)
transfer_configuration.transfer_filter_details = AAZObjectArg(
options=["transfer-filter-details"],
help="Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is given as TransferUsingFilter.",
)
transfer_all_details = cls._args_schema.data_export_details.Element.transfer_configuration.transfer_all_details
transfer_all_details.include = AAZObjectArg(
options=["include"],
help="Details to transfer all data.",
)
include = cls._args_schema.data_export_details.Element.transfer_configuration.transfer_all_details.include
include.data_account_type = AAZStrArg(
options=["data-account-type"],
help="Type of the account of data",
required=True,
default="StorageAccount",
enum={"ManagedDisk": "ManagedDisk", "StorageAccount": "StorageAccount"},
)
include.transfer_all_blobs = AAZBoolArg(
options=["transfer-all-blobs"],
help="To indicate if all Azure blobs have to be transferred",
)
include.transfer_all_files = AAZBoolArg(
options=["transfer-all-files"],
help="To indicate if all Azure Files have to be transferred",
)
transfer_filter_details = cls._args_schema.data_export_details.Element.transfer_configuration.transfer_filter_details
transfer_filter_details.azure_file_filter_details = AAZObjectArg(
options=["azure-file-filter-details"],
help="Filter details to transfer Azure files.",
)
transfer_filter_details.blob_filter_details = AAZObjectArg(
options=["blob-filter-details"],
help="Filter details to transfer blobs.",
)
transfer_filter_details.data_account_type = AAZStrArg(
options=["data-account-type"],
help="Type of the account of data.",
default="StorageAccount",
enum={"ManagedDisk": "ManagedDisk", "StorageAccount": "StorageAccount"},
)
transfer_filter_details.filter_file_details = AAZListArg(
options=["filter-file-details"],
help="Details of the filter files to be used for data transfer.",
)
azure_file_filter_details = cls._args_schema.data_export_details.Element.transfer_configuration.transfer_filter_details.azure_file_filter_details
azure_file_filter_details.file_path_list = AAZListArg(
options=["file-path-list"],
help="List of full path of the files to be transferred.",
)
azure_file_filter_details.file_prefix_list = AAZListArg(
options=["file-prefix-list"],
help="Prefix list of the Azure files to be transferred.",
)
azure_file_filter_details.file_share_list = AAZListArg(
options=["file-share-list"],
help="List of file shares to be transferred.",
)
file_path_list = cls._args_schema.data_export_details.Element.transfer_configuration.transfer_filter_details.azure_file_filter_details.file_path_list
file_path_list.Element = AAZStrArg()
file_prefix_list = cls._args_schema.data_export_details.Element.transfer_configuration.transfer_filter_details.azure_file_filter_details.file_prefix_list
file_prefix_list.Element = AAZStrArg()
file_share_list = cls._args_schema.data_export_details.Element.transfer_configuration.transfer_filter_details.azure_file_filter_details.file_share_list
file_share_list.Element = AAZStrArg()
blob_filter_details = cls._args_schema.data_export_details.Element.transfer_configuration.transfer_filter_details.blob_filter_details
blob_filter_details.blob_path_list = AAZListArg(
options=["blob-path-list"],
help="List of full path of the blobs to be transferred.",
)
blob_filter_details.blob_prefix_list = AAZListArg(
options=["blob-prefix-list"],
help="Prefix list of the Azure blobs to be transferred.",
)
blob_filter_details.container_list = AAZListArg(
options=["container-list"],
help="List of blob containers to be transferred.",
)
blob_path_list = cls._args_schema.data_export_details.Element.transfer_configuration.transfer_filter_details.blob_filter_details.blob_path_list
blob_path_list.Element = AAZStrArg()
blob_prefix_list = cls._args_schema.data_export_details.Element.transfer_configuration.transfer_filter_details.blob_filter_details.blob_prefix_list
blob_prefix_list.Element = AAZStrArg()
container_list = cls._args_schema.data_export_details.Element.transfer_configuration.transfer_filter_details.blob_filter_details.container_list
container_list.Element = AAZStrArg()
filter_file_details = cls._args_schema.data_export_details.Element.transfer_configuration.transfer_filter_details.filter_file_details
filter_file_details.Element = AAZObjectArg()
_element = cls._args_schema.data_export_details.Element.transfer_configuration.transfer_filter_details.filter_file_details.Element
_element.filter_file_path = AAZStrArg(
options=["filter-file-path"],
help="Path of the file that contains the details of all items to transfer.",
required=True,
)
_element.filter_file_type = AAZStrArg(
options=["filter-file-type"],
help="Type of the filter file.",
required=True,
enum={"AzureBlob": "AzureBlob", "AzureFile": "AzureFile"},
)
data_import_details = cls._args_schema.data_import_details
data_import_details.Element = AAZObjectArg()
_element = cls._args_schema.data_import_details.Element
_element.account_details = AAZObjectArg(
options=["account-details"],
help="Account details of the data to be transferred",
required=True,
)
_element.log_collection_level = AAZStrArg(
options=["log-collection-level"],
help="Level of the logs to be collected.",
default="Error",
enum={"Error": "Error", "Verbose": "Verbose"},
)
account_details = cls._args_schema.data_import_details.Element.account_details
account_details.managed_disk = AAZObjectArg(
options=["managed-disk"],
)
account_details.storage_account = AAZObjectArg(
options=["storage-account"],
)
account_details.share_password = AAZStrArg(
options=["share-password"],
help="Password for all the shares to be created on the device. Should not be passed for TransferType:ExportFromAzure jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one uppercase alphabet, one number and one special character. Password cannot have the following characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#\-$%^!+=;:_()]+",
)
managed_disk = cls._args_schema.data_import_details.Element.account_details.managed_disk
managed_disk.resource_group_id = AAZStrArg(
options=["resource-group-id"],
help="Resource Group Id of the compute disks.",
required=True,
)
managed_disk.staging_storage_account_id = AAZStrArg(
options=["staging-storage-account-id"],
help="Resource Id of the storage account that can be used to copy the vhd for staging.",
required=True,
)
storage_account = cls._args_schema.data_import_details.Element.account_details.storage_account
storage_account.storage_account_id = AAZStrArg(
options=["storage-account-id"],
help="Storage Account Resource Id.",
required=True,
)
# define Arg Group "JobResource"
_args_schema = cls._args_schema
_args_schema.identity = AAZObjectArg(
options=["--identity"],
arg_group="JobResource",
help="Msi identity of the resource",
)
_args_schema.location = AAZResourceLocationArg(
arg_group="JobResource",
help="The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed.",
required=True,
fmt=AAZResourceLocationArgFormat(
resource_group_arg="resource_group",
),
)
_args_schema.tags = AAZDictArg(
options=["--tags"],
arg_group="JobResource",
help="The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups).",
)
identity = cls._args_schema.identity
identity.type = AAZStrArg(
options=["type"],
help="Identity type",
default="None",
)
identity.user_assigned_identities = AAZDictArg(
options=["user-assigned-identities"],
help="User Assigned Identities",
)
user_assigned_identities = cls._args_schema.identity.user_assigned_identities
user_assigned_identities.Element = AAZObjectArg(
blank={},
)
tags = cls._args_schema.tags
tags.Element = AAZStrArg()
# define Arg Group "KeyEncryptionKey"
_args_schema = cls._args_schema
_args_schema.kek_identity = AAZObjectArg(
options=["--kek-identity"],
arg_group="KeyEncryptionKey",
help="Managed identity properties used for key encryption.",
)
_args_schema.kek_type = AAZStrArg(
options=["--kek-type"],
arg_group="KeyEncryptionKey",
help="Type of encryption key used for key encryption.",
default="MicrosoftManaged",
enum={"CustomerManaged": "CustomerManaged", "MicrosoftManaged": "MicrosoftManaged"},
)
_args_schema.kek_url = AAZStrArg(
options=["--kek-url"],
arg_group="KeyEncryptionKey",
help="Key encryption key. It is required in case of Customer managed KekType.",
)
_args_schema.kek_vault_resource_id = AAZStrArg(
options=["--kek-vault-resource-id"],
arg_group="KeyEncryptionKey",
help="Kek vault resource id. It is required in case of Customer managed KekType.",
)
kek_identity = cls._args_schema.kek_identity
kek_identity.type = AAZStrArg(
options=["type"],
help="Managed service identity type.",
)
kek_identity.user_assigned = AAZObjectArg(
options=["user-assigned"],
help="User assigned identity properties.",
)
user_assigned = cls._args_schema.kek_identity.user_assigned
user_assigned.resource_id = AAZStrArg(
options=["resource-id"],
help="Arm resource id for user assigned identity to be used to fetch MSI token.",
)
# define Arg Group "Properties"
_args_schema = cls._args_schema
_args_schema.transfer_type = AAZStrArg(
options=["--transfer-type"],
arg_group="Properties",
help="Type of the data transfer.",
required=True,
enum={"ExportFromAzure": "ExportFromAzure", "ImportToAzure": "ImportToAzure"},
)
# define Arg Group "ShippingAddress"
_args_schema = cls._args_schema
_args_schema.city = AAZStrArg(
options=["--city"],
arg_group="ShippingAddress",
help="Name of the city.",
)
_args_schema.company_name = AAZStrArg(
options=["--company-name"],
arg_group="ShippingAddress",
help="Name of the company.",
)
_args_schema.country = AAZStrArg(
options=["--country"],
arg_group="ShippingAddress",
help="Name of the Country.",
)
_args_schema.postal_code = AAZStrArg(
options=["--postal-code"],
arg_group="ShippingAddress",
help="Postal code.",
)
_args_schema.state_or_province = AAZStrArg(
options=["--state-or-province"],
arg_group="ShippingAddress",
help="Name of the State or Province.",
)
_args_schema.street_address1 = AAZStrArg(
options=["--street-address1"],
arg_group="ShippingAddress",
help="Street Address line 1.",
)
_args_schema.street_address2 = AAZStrArg(
options=["--street-address2"],
arg_group="ShippingAddress",
help="Street Address line 2.",
)
_args_schema.street_address3 = AAZStrArg(
options=["--street-address3"],
arg_group="ShippingAddress",
help="Street Address line 3.",
)
# define Arg Group "Sku"
_args_schema = cls._args_schema
_args_schema.sku = AAZStrArg(
options=["--sku"],
arg_group="Sku",
help="The sku name.",
required=True,
enum={"DataBox": "DataBox", "DataBoxCustomerDisk": "DataBoxCustomerDisk", "DataBoxDisk": "DataBoxDisk", "DataBoxHeavy": "DataBoxHeavy"},
)
return cls._args_schema
_args_shipping_address_create = None
@classmethod
def _build_args_shipping_address_create(cls, _schema):
if cls._args_shipping_address_create is not None:
_schema.address_type = cls._args_shipping_address_create.address_type
_schema.city = cls._args_shipping_address_create.city
_schema.company_name = cls._args_shipping_address_create.company_name
_schema.country = cls._args_shipping_address_create.country
_schema.postal_code = cls._args_shipping_address_create.postal_code
_schema.skip_address_validation = cls._args_shipping_address_create.skip_address_validation
_schema.state_or_province = cls._args_shipping_address_create.state_or_province
_schema.street_address1 = cls._args_shipping_address_create.street_address1
_schema.street_address2 = cls._args_shipping_address_create.street_address2
_schema.street_address3 = cls._args_shipping_address_create.street_address3
_schema.tax_identification_number = cls._args_shipping_address_create.tax_identification_number
_schema.zip_extended_code = cls._args_shipping_address_create.zip_extended_code
return
cls._args_shipping_address_create = AAZObjectArg()
shipping_address_create = cls._args_shipping_address_create
shipping_address_create.address_type = AAZStrArg(
options=["address-type"],
help="Type of address.",
default="None",
enum={"Commercial": "Commercial", "None": "None", "Residential": "Residential"},
)
shipping_address_create.city = AAZStrArg(
options=["city"],
help="Name of the City.",
)
shipping_address_create.company_name = AAZStrArg(
options=["company-name"],
help="Name of the company.",
)
shipping_address_create.country = AAZStrArg(
options=["country"],
help="Name of the Country.",
required=True,
)
shipping_address_create.postal_code = AAZStrArg(
options=["postal-code"],
help="Postal code.",
)
shipping_address_create.skip_address_validation = AAZBoolArg(
options=["skip-address-validation"],
help="Flag to indicate if customer has chosen to skip default address validation",
)
shipping_address_create.state_or_province = AAZStrArg(
options=["state-or-province"],
help="Name of the State or Province.",
)
shipping_address_create.street_address1 = AAZStrArg(
options=["street-address1"],
help="Street Address line 1.",
required=True,
)
shipping_address_create.street_address2 = AAZStrArg(
options=["street-address2"],
help="Street Address line 2.",
)
shipping_address_create.street_address3 = AAZStrArg(
options=["street-address3"],
help="Street Address line 3.",
)
shipping_address_create.tax_identification_number = AAZStrArg(
options=["tax-identification-number"],
help="Tax Identification Number",
)
shipping_address_create.zip_extended_code = AAZStrArg(
options=["zip-extended-code"],
help="Extended Zip Code.",
)
_schema.address_type = cls._args_shipping_address_create.address_type
_schema.city = cls._args_shipping_address_create.city
_schema.company_name = cls._args_shipping_address_create.company_name
_schema.country = cls._args_shipping_address_create.country
_schema.postal_code = cls._args_shipping_address_create.postal_code
_schema.skip_address_validation = cls._args_shipping_address_create.skip_address_validation
_schema.state_or_province = cls._args_shipping_address_create.state_or_province
_schema.street_address1 = cls._args_shipping_address_create.street_address1
_schema.street_address2 = cls._args_shipping_address_create.street_address2
_schema.street_address3 = cls._args_shipping_address_create.street_address3
_schema.tax_identification_number = cls._args_shipping_address_create.tax_identification_number
_schema.zip_extended_code = cls._args_shipping_address_create.zip_extended_code
_args_transport_preferences_create = None
@classmethod
def _build_args_transport_preferences_create(cls, _schema):
if cls._args_transport_preferences_create is not None:
_schema.preferred_shipment_type = cls._args_transport_preferences_create.preferred_shipment_type
return
cls._args_transport_preferences_create = AAZObjectArg()
transport_preferences_create = cls._args_transport_preferences_create
transport_preferences_create.preferred_shipment_type = AAZStrArg(
options=["preferred-shipment-type"],
help="Indicates Shipment Logistics type that the customer preferred.",
required=True,
enum={"CustomerManaged": "CustomerManaged", "MicrosoftManaged": "MicrosoftManaged"},
)
_schema.preferred_shipment_type = cls._args_transport_preferences_create.preferred_shipment_type
def _execute_operations(self):
self.pre_operations()
yield self.JobsCreate(ctx=self.ctx)()
self.post_operations()
@register_callback
def pre_operations(self):
pass
@register_callback
def post_operations(self):
pass
def _output(self, *args, **kwargs):
result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True)
return result
class JobsCreate(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(request=request, stream=False, **kwargs)
if session.http_response.status_code in [202]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "ODataV4Format"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"jobName", self.ctx.args.job_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-12-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("identity", AAZObjectType, ".identity")
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}})
_builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}})
_builder.set_prop("sku", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
_builder.set_prop("tags", AAZDictType, ".tags")
identity = _builder.get(".identity")
if identity is not None:
identity.set_prop("type", AAZStrType, ".type")
identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities")
user_assigned_identities = _builder.get(".identity.userAssignedIdentities")
if user_assigned_identities is not None:
user_assigned_identities.set_elements(AAZObjectType, ".")
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("details", AAZObjectType)
properties.set_prop("transferType", AAZStrType, ".transfer_type", typ_kwargs={"flags": {"required": True}})
details = _builder.get(".properties.details")
if details is not None:
details.set_prop("contactDetails", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
details.set_prop("dataExportDetails", AAZListType, ".data_export_details")
details.set_prop("dataImportDetails", AAZListType, ".data_import_details")
details.set_prop("expectedDataSizeInTeraBytes", AAZIntType, ".expected_data_size")
details.set_const("jobDetailsType", "DataBox", AAZStrType, ".data_box", typ_kwargs={"flags": {"required": True}})
details.set_const("jobDetailsType", "DataBoxCustomerDisk", AAZStrType, ".data_box_customer_disk", typ_kwargs={"flags": {"required": True}})
details.set_const("jobDetailsType", "DataBoxDisk", AAZStrType, ".data_box_disk", typ_kwargs={"flags": {"required": True}})
details.set_const("jobDetailsType", "DataBoxHeavy", AAZStrType, ".data_box_heavy", typ_kwargs={"flags": {"required": True}})
details.set_prop("keyEncryptionKey", AAZObjectType)
details.set_prop("shippingAddress", AAZObjectType)
details.discriminate_by("jobDetailsType", "DataBox")
details.discriminate_by("jobDetailsType", "DataBoxCustomerDisk")
details.discriminate_by("jobDetailsType", "DataBoxDisk")
details.discriminate_by("jobDetailsType", "DataBoxHeavy")
contact_details = _builder.get(".properties.details.contactDetails")
if contact_details is not None:
contact_details.set_prop("contactName", AAZStrType, ".contact_name", typ_kwargs={"flags": {"required": True}})
contact_details.set_prop("emailList", AAZListType, ".email_list", typ_kwargs={"flags": {"required": True}})
contact_details.set_prop("mobile", AAZStrType, ".mobile")
contact_details.set_prop("phone", AAZStrType, ".phone", typ_kwargs={"flags": {"required": True}})
email_list = _builder.get(".properties.details.contactDetails.emailList")
if email_list is not None:
email_list.set_elements(AAZStrType, ".")
data_export_details = _builder.get(".properties.details.dataExportDetails")
if data_export_details is not None:
data_export_details.set_elements(AAZObjectType, ".")
_elements = _builder.get(".properties.details.dataExportDetails[]")
if _elements is not None:
_elements.set_prop("accountDetails", AAZObjectType, ".account_details", typ_kwargs={"flags": {"required": True}})
_elements.set_prop("logCollectionLevel", AAZStrType, ".log_collection_level")
_elements.set_prop("transferConfiguration", AAZObjectType, ".transfer_configuration", typ_kwargs={"flags": {"required": True}})
account_details = _builder.get(".properties.details.dataExportDetails[].accountDetails")
if account_details is not None:
account_details.set_const("dataAccountType", "ManagedDisk", AAZStrType, ".managed_disk", typ_kwargs={"flags": {"required": True}})
account_details.set_const("dataAccountType", "StorageAccount", AAZStrType, ".storage_account", typ_kwargs={"flags": {"required": True}})
account_details.set_prop("sharePassword", AAZStrType, ".share_password", typ_kwargs={"flags": {"secret": True}})
account_details.discriminate_by("dataAccountType", "ManagedDisk")
account_details.discriminate_by("dataAccountType", "StorageAccount")
disc_managed_disk = _builder.get(".properties.details.dataExportDetails[].accountDetails{dataAccountType:ManagedDisk}")
if disc_managed_disk is not None:
disc_managed_disk.set_prop("resourceGroupId", AAZStrType, ".managed_disk.resource_group_id", typ_kwargs={"flags": {"required": True}})
disc_managed_disk.set_prop("stagingStorageAccountId", AAZStrType, ".managed_disk.staging_storage_account_id", typ_kwargs={"flags": {"required": True}})
disc_storage_account = _builder.get(".properties.details.dataExportDetails[].accountDetails{dataAccountType:StorageAccount}")
if disc_storage_account is not None:
disc_storage_account.set_prop("storageAccountId", AAZStrType, ".storage_account.storage_account_id", typ_kwargs={"flags": {"required": True}})
transfer_configuration = _builder.get(".properties.details.dataExportDetails[].transferConfiguration")
if transfer_configuration is not None:
transfer_configuration.set_prop("transferAllDetails", AAZObjectType, ".transfer_all_details")
transfer_configuration.set_prop("transferConfigurationType", AAZStrType, ".transfer_configuration_type", typ_kwargs={"flags": {"required": True}})
transfer_configuration.set_prop("transferFilterDetails", AAZObjectType, ".transfer_filter_details")
transfer_all_details = _builder.get(".properties.details.dataExportDetails[].transferConfiguration.transferAllDetails")
if transfer_all_details is not None:
transfer_all_details.set_prop("include", AAZObjectType, ".include")
include = _builder.get(".properties.details.dataExportDetails[].transferConfiguration.transferAllDetails.include")
if include is not None:
include.set_prop("dataAccountType", AAZStrType, ".data_account_type", typ_kwargs={"flags": {"required": True}})
include.set_prop("transferAllBlobs", AAZBoolType, ".transfer_all_blobs")
include.set_prop("transferAllFiles", AAZBoolType, ".transfer_all_files")
transfer_filter_details = _builder.get(".properties.details.dataExportDetails[].transferConfiguration.transferFilterDetails")
if transfer_filter_details is not None:
transfer_filter_details.set_prop("include", AAZObjectType)
include = _builder.get(".properties.details.dataExportDetails[].transferConfiguration.transferFilterDetails.include")
if include is not None:
include.set_prop("azureFileFilterDetails", AAZObjectType, ".azure_file_filter_details")
include.set_prop("blobFilterDetails", AAZObjectType, ".blob_filter_details")
include.set_prop("dataAccountType", AAZStrType, ".data_account_type", typ_kwargs={"flags": {"required": True}})
include.set_prop("filterFileDetails", AAZListType, ".filter_file_details")
azure_file_filter_details = _builder.get(".properties.details.dataExportDetails[].transferConfiguration.transferFilterDetails.include.azureFileFilterDetails")
if azure_file_filter_details is not None:
azure_file_filter_details.set_prop("filePathList", AAZListType, ".file_path_list")
azure_file_filter_details.set_prop("filePrefixList", AAZListType, ".file_prefix_list")
azure_file_filter_details.set_prop("fileShareList", AAZListType, ".file_share_list")
file_path_list = _builder.get(".properties.details.dataExportDetails[].transferConfiguration.transferFilterDetails.include.azureFileFilterDetails.filePathList")
if file_path_list is not None:
file_path_list.set_elements(AAZStrType, ".")
file_prefix_list = _builder.get(".properties.details.dataExportDetails[].transferConfiguration.transferFilterDetails.include.azureFileFilterDetails.filePrefixList")
if file_prefix_list is not None:
file_prefix_list.set_elements(AAZStrType, ".")
file_share_list = _builder.get(".properties.details.dataExportDetails[].transferConfiguration.transferFilterDetails.include.azureFileFilterDetails.fileShareList")
if file_share_list is not None:
file_share_list.set_elements(AAZStrType, ".")
blob_filter_details = _builder.get(".properties.details.dataExportDetails[].transferConfiguration.transferFilterDetails.include.blobFilterDetails")
if blob_filter_details is not None:
blob_filter_details.set_prop("blobPathList", AAZListType, ".blob_path_list")
blob_filter_details.set_prop("blobPrefixList", AAZListType, ".blob_prefix_list")
blob_filter_details.set_prop("containerList", AAZListType, ".container_list")
blob_path_list = _builder.get(".properties.details.dataExportDetails[].transferConfiguration.transferFilterDetails.include.blobFilterDetails.blobPathList")
if blob_path_list is not None:
blob_path_list.set_elements(AAZStrType, ".")
blob_prefix_list = _builder.get(".properties.details.dataExportDetails[].transferConfiguration.transferFilterDetails.include.blobFilterDetails.blobPrefixList")
if blob_prefix_list is not None:
blob_prefix_list.set_elements(AAZStrType, ".")
container_list = _builder.get(".properties.details.dataExportDetails[].transferConfiguration.transferFilterDetails.include.blobFilterDetails.containerList")
if container_list is not None:
container_list.set_elements(AAZStrType, ".")
filter_file_details = _builder.get(".properties.details.dataExportDetails[].transferConfiguration.transferFilterDetails.include.filterFileDetails")
if filter_file_details is not None:
filter_file_details.set_elements(AAZObjectType, ".")
_elements = _builder.get(".properties.details.dataExportDetails[].transferConfiguration.transferFilterDetails.include.filterFileDetails[]")
if _elements is not None:
_elements.set_prop("filterFilePath", AAZStrType, ".filter_file_path", typ_kwargs={"flags": {"required": True}})
_elements.set_prop("filterFileType", AAZStrType, ".filter_file_type", typ_kwargs={"flags": {"required": True}})
data_import_details = _builder.get(".properties.details.dataImportDetails")
if data_import_details is not None:
data_import_details.set_elements(AAZObjectType, ".")
_elements = _builder.get(".properties.details.dataImportDetails[]")
if _elements is not None:
_elements.set_prop("accountDetails", AAZObjectType, ".account_details", typ_kwargs={"flags": {"required": True}})
_elements.set_prop("logCollectionLevel", AAZStrType, ".log_collection_level")
account_details = _builder.get(".properties.details.dataImportDetails[].accountDetails")
if account_details is not None:
account_details.set_const("dataAccountType", "ManagedDisk", AAZStrType, ".managed_disk", typ_kwargs={"flags": {"required": True}})
account_details.set_const("dataAccountType", "StorageAccount", AAZStrType, ".storage_account", typ_kwargs={"flags": {"required": True}})
account_details.set_prop("sharePassword", AAZStrType, ".share_password", typ_kwargs={"flags": {"secret": True}})
account_details.discriminate_by("dataAccountType", "ManagedDisk")
account_details.discriminate_by("dataAccountType", "StorageAccount")
disc_managed_disk = _builder.get(".properties.details.dataImportDetails[].accountDetails{dataAccountType:ManagedDisk}")
if disc_managed_disk is not None:
disc_managed_disk.set_prop("resourceGroupId", AAZStrType, ".managed_disk.resource_group_id", typ_kwargs={"flags": {"required": True}})
disc_managed_disk.set_prop("stagingStorageAccountId", AAZStrType, ".managed_disk.staging_storage_account_id", typ_kwargs={"flags": {"required": True}})
disc_storage_account = _builder.get(".properties.details.dataImportDetails[].accountDetails{dataAccountType:StorageAccount}")
if disc_storage_account is not None:
disc_storage_account.set_prop("storageAccountId", AAZStrType, ".storage_account.storage_account_id", typ_kwargs={"flags": {"required": True}})
key_encryption_key = _builder.get(".properties.details.keyEncryptionKey")
if key_encryption_key is not None:
key_encryption_key.set_prop("identityProperties", AAZObjectType, ".kek_identity")
key_encryption_key.set_prop("kekType", AAZStrType, ".kek_type", typ_kwargs={"flags": {"required": True}})
key_encryption_key.set_prop("kekUrl", AAZStrType, ".kek_url")
key_encryption_key.set_prop("kekVaultResourceID", AAZStrType, ".kek_vault_resource_id")
identity_properties = _builder.get(".properties.details.keyEncryptionKey.identityProperties")
if identity_properties is not None:
identity_properties.set_prop("type", AAZStrType, ".type")
identity_properties.set_prop("userAssigned", AAZObjectType, ".user_assigned")
user_assigned = _builder.get(".properties.details.keyEncryptionKey.identityProperties.userAssigned")
if user_assigned is not None:
user_assigned.set_prop("resourceId", AAZStrType, ".resource_id")
shipping_address = _builder.get(".properties.details.shippingAddress")
if shipping_address is not None:
shipping_address.set_prop("city", AAZStrType, ".city")
shipping_address.set_prop("companyName", AAZStrType, ".company_name")
shipping_address.set_prop("country", AAZStrType, ".country", typ_kwargs={"flags": {"required": True}})
shipping_address.set_prop("postalCode", AAZStrType, ".postal_code")
shipping_address.set_prop("stateOrProvince", AAZStrType, ".state_or_province")
shipping_address.set_prop("streetAddress1", AAZStrType, ".street_address1", typ_kwargs={"flags": {"required": True}})
shipping_address.set_prop("streetAddress2", AAZStrType, ".street_address2")
shipping_address.set_prop("streetAddress3", AAZStrType, ".street_address3")
disc_data_box = _builder.get(".properties.details{jobDetailsType:DataBox}")
if disc_data_box is not None:
disc_data_box.set_prop("devicePassword", AAZStrType, ".data_box.device_password")
disc_data_box_customer_disk = _builder.get(".properties.details{jobDetailsType:DataBoxCustomerDisk}")
if disc_data_box_customer_disk is not None:
disc_data_box_customer_disk.set_prop("enableManifestBackup", AAZBoolType, ".data_box_customer_disk.enable_manifest_backup")
disc_data_box_customer_disk.set_prop("importDiskDetailsCollection", AAZDictType, ".data_box_customer_disk.import_disk_details_collection")
disc_data_box_customer_disk.set_prop("returnToCustomerPackageDetails", AAZObjectType, ".data_box_customer_disk.return_to_customer_package_details", typ_kwargs={"flags": {"required": True}})
import_disk_details_collection = _builder.get(".properties.details{jobDetailsType:DataBoxCustomerDisk}.importDiskDetailsCollection")
if import_disk_details_collection is not None:
import_disk_details_collection.set_elements(AAZObjectType, ".")
_elements = _builder.get(".properties.details{jobDetailsType:DataBoxCustomerDisk}.importDiskDetailsCollection{}")
if _elements is not None:
_elements.set_prop("bitLockerKey", AAZStrType, ".bit_locker_key", typ_kwargs={"flags": {"required": True, "secret": True}})
_elements.set_prop("manifestFile", AAZStrType, ".manifest_file", typ_kwargs={"flags": {"required": True}})
_elements.set_prop("manifestHash", AAZStrType, ".manifest_hash", typ_kwargs={"flags": {"required": True}})
return_to_customer_package_details = _builder.get(".properties.details{jobDetailsType:DataBoxCustomerDisk}.returnToCustomerPackageDetails")
if return_to_customer_package_details is not None:
return_to_customer_package_details.set_prop("carrierAccountNumber", AAZStrType, ".carrier_account_number", typ_kwargs={"flags": {"secret": True}})
return_to_customer_package_details.set_prop("carrierName", AAZStrType, ".carrier_name")
return_to_customer_package_details.set_prop("trackingId", AAZStrType, ".tracking_id")
disc_data_box_disk = _builder.get(".properties.details{jobDetailsType:DataBoxDisk}")
if disc_data_box_disk is not None:
disc_data_box_disk.set_prop("passkey", AAZStrType, ".data_box_disk.passkey")
disc_data_box_disk.set_prop("preferredDisks", AAZDictType, ".data_box_disk.preferred_disks")
preferred_disks = _builder.get(".properties.details{jobDetailsType:DataBoxDisk}.preferredDisks")
if preferred_disks is not None:
preferred_disks.set_elements(AAZIntType, ".")
disc_data_box_heavy = _builder.get(".properties.details{jobDetailsType:DataBoxHeavy}")
if disc_data_box_heavy is not None:
disc_data_box_heavy.set_prop("devicePassword", AAZStrType, ".data_box_heavy.device_password")
sku = _builder.get(".sku")
if sku is not None:
sku.set_prop("name", AAZStrType, ".sku", typ_kwargs={"flags": {"required": True}})
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return self.serialize_content(_content_value)
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.identity = AAZObjectType()
_schema_on_200.location = AAZStrType(
flags={"required": True},
)
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"required": True, "client_flatten": True},
)
_schema_on_200.sku = AAZObjectType(
flags={"required": True},
)
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
)
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
identity = cls._schema_on_200.identity
identity.principal_id = AAZStrType(
serialized_name="principalId",
flags={"read_only": True},
)
identity.tenant_id = AAZStrType(
serialized_name="tenantId",
flags={"read_only": True},
)
identity.type = AAZStrType()
identity.user_assigned_identities = AAZDictType(
serialized_name="userAssignedIdentities",
)
user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities
user_assigned_identities.Element = AAZObjectType()
_element = cls._schema_on_200.identity.user_assigned_identities.Element
_element.client_id = AAZStrType(
serialized_name="clientId",
flags={"read_only": True},
)
_element.principal_id = AAZStrType(
serialized_name="principalId",
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.cancellation_reason = AAZStrType(
serialized_name="cancellationReason",
flags={"read_only": True},
)
properties.delivery_info = AAZObjectType(
serialized_name="deliveryInfo",
)
properties.delivery_type = AAZStrType(
serialized_name="deliveryType",
)
properties.details = AAZObjectType()
properties.error = AAZObjectType()
_CreateHelper._build_schema_cloud_error_read(properties.error)
properties.is_cancellable = AAZBoolType(
serialized_name="isCancellable",
flags={"read_only": True},
)
properties.is_cancellable_without_fee = AAZBoolType(
serialized_name="isCancellableWithoutFee",
flags={"read_only": True},
)
properties.is_deletable = AAZBoolType(
serialized_name="isDeletable",
flags={"read_only": True},
)
properties.is_prepare_to_ship_enabled = AAZBoolType(
serialized_name="isPrepareToShipEnabled",
flags={"read_only": True},
)
properties.is_shipping_address_editable = AAZBoolType(
serialized_name="isShippingAddressEditable",
flags={"read_only": True},
)
properties.reverse_shipping_details_update = AAZStrType(
serialized_name="reverseShippingDetailsUpdate",
flags={"read_only": True},
)
properties.reverse_transport_preference_update = AAZStrType(
serialized_name="reverseTransportPreferenceUpdate",
flags={"read_only": True},
)
properties.start_time = AAZStrType(
serialized_name="startTime",
flags={"read_only": True},
)
properties.status = AAZStrType(
flags={"read_only": True},
)
properties.transfer_type = AAZStrType(
serialized_name="transferType",
flags={"required": True},
)
delivery_info = cls._schema_on_200.properties.delivery_info
delivery_info.scheduled_date_time = AAZStrType(
serialized_name="scheduledDateTime",
)
details = cls._schema_on_200.properties.details
details.actions = AAZListType(
flags={"read_only": True},
)
details.chain_of_custody_sas_key = AAZStrType(
serialized_name="chainOfCustodySasKey",
flags={"read_only": True},
)
details.contact_details = AAZObjectType(
serialized_name="contactDetails",
flags={"required": True},
)
details.copy_log_details = AAZListType(
serialized_name="copyLogDetails",
flags={"read_only": True},
)
details.data_center_code = AAZStrType(
serialized_name="dataCenterCode",
flags={"read_only": True},
)
details.data_export_details = AAZListType(
serialized_name="dataExportDetails",
)
details.data_import_details = AAZListType(
serialized_name="dataImportDetails",
)
details.datacenter_address = AAZObjectType(
serialized_name="datacenterAddress",
)
details.delivery_package = AAZObjectType(
serialized_name="deliveryPackage",
)
_CreateHelper._build_schema_package_shipping_details_read(details.delivery_package)
details.device_erasure_details = AAZObjectType(
serialized_name="deviceErasureDetails",
)
details.expected_data_size_in_tera_bytes = AAZIntType(
serialized_name="expectedDataSizeInTeraBytes",
)
details.job_details_type = AAZStrType(
serialized_name="jobDetailsType",
flags={"required": True},
)
details.job_stages = AAZListType(
serialized_name="jobStages",
flags={"read_only": True},
)
details.key_encryption_key = AAZObjectType(
serialized_name="keyEncryptionKey",
)
details.last_mitigation_action_on_job = AAZObjectType(
serialized_name="lastMitigationActionOnJob",
)
details.preferences = AAZObjectType()
details.return_package = AAZObjectType(
serialized_name="returnPackage",
)
_CreateHelper._build_schema_package_shipping_details_read(details.return_package)
details.reverse_shipment_label_sas_key = AAZStrType(
serialized_name="reverseShipmentLabelSasKey",
flags={"read_only": True},
)
details.reverse_shipping_details = AAZObjectType(
serialized_name="reverseShippingDetails",
)
details.shipping_address = AAZObjectType(
serialized_name="shippingAddress",
)
_CreateHelper._build_schema_shipping_address_read(details.shipping_address)
actions = cls._schema_on_200.properties.details.actions
actions.Element = AAZStrType()
contact_details = cls._schema_on_200.properties.details.contact_details
contact_details.contact_name = AAZStrType(
serialized_name="contactName",
flags={"required": True},
)
contact_details.email_list = AAZListType(
serialized_name="emailList",
flags={"required": True},
)
contact_details.mobile = AAZStrType()
contact_details.notification_preference = AAZListType(
serialized_name="notificationPreference",
)
contact_details.phone = AAZStrType(
flags={"required": True},
)
contact_details.phone_extension = AAZStrType(
serialized_name="phoneExtension",
)
email_list = cls._schema_on_200.properties.details.contact_details.email_list
email_list.Element = AAZStrType()
notification_preference = cls._schema_on_200.properties.details.contact_details.notification_preference
notification_preference.Element = AAZObjectType()
_element = cls._schema_on_200.properties.details.contact_details.notification_preference.Element
_element.send_notification = AAZBoolType(
serialized_name="sendNotification",
flags={"required": True},
)
_element.stage_name = AAZStrType(
serialized_name="stageName",
flags={"required": True},
)
copy_log_details = cls._schema_on_200.properties.details.copy_log_details
copy_log_details.Element = AAZObjectType()
_element = cls._schema_on_200.properties.details.copy_log_details.Element
_element.copy_log_details_type = AAZStrType(
serialized_name="copyLogDetailsType",
flags={"required": True},
)
disc_data_box = cls._schema_on_200.properties.details.copy_log_details.Element.discriminate_by("copy_log_details_type", "DataBox")
disc_data_box.account_name = AAZStrType(
serialized_name="accountName",
flags={"read_only": True},
)
disc_data_box.copy_log_link = AAZStrType(
serialized_name="copyLogLink",
flags={"read_only": True},
)
disc_data_box.copy_verbose_log_link = AAZStrType(
serialized_name="copyVerboseLogLink",
flags={"read_only": True},
)
disc_data_box_customer_disk = cls._schema_on_200.properties.details.copy_log_details.Element.discriminate_by("copy_log_details_type", "DataBoxCustomerDisk")
disc_data_box_customer_disk.error_log_link = AAZStrType(
serialized_name="errorLogLink",
flags={"read_only": True},
)
disc_data_box_customer_disk.serial_number = AAZStrType(
serialized_name="serialNumber",
flags={"read_only": True},
)
disc_data_box_customer_disk.verbose_log_link = AAZStrType(
serialized_name="verboseLogLink",
flags={"read_only": True},
)
disc_data_box_disk = cls._schema_on_200.properties.details.copy_log_details.Element.discriminate_by("copy_log_details_type", "DataBoxDisk")
disc_data_box_disk.disk_serial_number = AAZStrType(
serialized_name="diskSerialNumber",
flags={"read_only": True},
)
disc_data_box_disk.error_log_link = AAZStrType(
serialized_name="errorLogLink",
flags={"read_only": True},
)
disc_data_box_disk.verbose_log_link = AAZStrType(
serialized_name="verboseLogLink",
flags={"read_only": True},
)
disc_data_box_heavy = cls._schema_on_200.properties.details.copy_log_details.Element.discriminate_by("copy_log_details_type", "DataBoxHeavy")
disc_data_box_heavy.account_name = AAZStrType(
serialized_name="accountName",
flags={"read_only": True},
)
disc_data_box_heavy.copy_log_link = AAZListType(
serialized_name="copyLogLink",
flags={"read_only": True},
)
disc_data_box_heavy.copy_verbose_log_link = AAZListType(
serialized_name="copyVerboseLogLink",
flags={"read_only": True},
)
copy_log_link = cls._schema_on_200.properties.details.copy_log_details.Element.discriminate_by("copy_log_details_type", "DataBoxHeavy").copy_log_link
copy_log_link.Element = AAZStrType()
copy_verbose_log_link = cls._schema_on_200.properties.details.copy_log_details.Element.discriminate_by("copy_log_details_type", "DataBoxHeavy").copy_verbose_log_link
copy_verbose_log_link.Element = AAZStrType()
data_export_details = cls._schema_on_200.properties.details.data_export_details
data_export_details.Element = AAZObjectType()
_element = cls._schema_on_200.properties.details.data_export_details.Element
_element.account_details = AAZObjectType(
serialized_name="accountDetails",
flags={"required": True},
)
_CreateHelper._build_schema_data_account_details_read(_element.account_details)
_element.log_collection_level = AAZStrType(
serialized_name="logCollectionLevel",
)
_element.transfer_configuration = AAZObjectType(
serialized_name="transferConfiguration",
flags={"required": True},
)
transfer_configuration = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration
transfer_configuration.transfer_all_details = AAZObjectType(
serialized_name="transferAllDetails",
)
transfer_configuration.transfer_configuration_type = AAZStrType(
serialized_name="transferConfigurationType",
flags={"required": True},
)
transfer_configuration.transfer_filter_details = AAZObjectType(
serialized_name="transferFilterDetails",
)
transfer_all_details = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_all_details
transfer_all_details.include = AAZObjectType()
include = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_all_details.include
include.data_account_type = AAZStrType(
serialized_name="dataAccountType",
flags={"required": True},
)
include.transfer_all_blobs = AAZBoolType(
serialized_name="transferAllBlobs",
)
include.transfer_all_files = AAZBoolType(
serialized_name="transferAllFiles",
)
transfer_filter_details = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details
transfer_filter_details.include = AAZObjectType()
include = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include
include.azure_file_filter_details = AAZObjectType(
serialized_name="azureFileFilterDetails",
)
include.blob_filter_details = AAZObjectType(
serialized_name="blobFilterDetails",
)
include.data_account_type = AAZStrType(
serialized_name="dataAccountType",
flags={"required": True},
)
include.filter_file_details = AAZListType(
serialized_name="filterFileDetails",
)
azure_file_filter_details = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.azure_file_filter_details
azure_file_filter_details.file_path_list = AAZListType(
serialized_name="filePathList",
)
azure_file_filter_details.file_prefix_list = AAZListType(
serialized_name="filePrefixList",
)
azure_file_filter_details.file_share_list = AAZListType(
serialized_name="fileShareList",
)
file_path_list = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.azure_file_filter_details.file_path_list
file_path_list.Element = AAZStrType()
file_prefix_list = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.azure_file_filter_details.file_prefix_list
file_prefix_list.Element = AAZStrType()
file_share_list = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.azure_file_filter_details.file_share_list
file_share_list.Element = AAZStrType()
blob_filter_details = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.blob_filter_details
blob_filter_details.blob_path_list = AAZListType(
serialized_name="blobPathList",
)
blob_filter_details.blob_prefix_list = AAZListType(
serialized_name="blobPrefixList",
)
blob_filter_details.container_list = AAZListType(
serialized_name="containerList",
)
blob_path_list = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.blob_filter_details.blob_path_list
blob_path_list.Element = AAZStrType()
blob_prefix_list = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.blob_filter_details.blob_prefix_list
blob_prefix_list.Element = AAZStrType()
container_list = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.blob_filter_details.container_list
container_list.Element = AAZStrType()
filter_file_details = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.filter_file_details
filter_file_details.Element = AAZObjectType()
_element = cls._schema_on_200.properties.details.data_export_details.Element.transfer_configuration.transfer_filter_details.include.filter_file_details.Element
_element.filter_file_path = AAZStrType(
serialized_name="filterFilePath",
flags={"required": True},
)
_element.filter_file_type = AAZStrType(
serialized_name="filterFileType",
flags={"required": True},
)
data_import_details = cls._schema_on_200.properties.details.data_import_details
data_import_details.Element = AAZObjectType()
_element = cls._schema_on_200.properties.details.data_import_details.Element
_element.account_details = AAZObjectType(
serialized_name="accountDetails",
flags={"required": True},
)
_CreateHelper._build_schema_data_account_details_read(_element.account_details)
_element.log_collection_level = AAZStrType(
serialized_name="logCollectionLevel",
)
datacenter_address = cls._schema_on_200.properties.details.datacenter_address
datacenter_address.data_center_azure_location = AAZStrType(
serialized_name="dataCenterAzureLocation",
flags={"read_only": True},
)
datacenter_address.datacenter_address_type = AAZStrType(
serialized_name="datacenterAddressType",
flags={"required": True},
)
datacenter_address.supported_carriers_for_return_shipment = AAZListType(
serialized_name="supportedCarriersForReturnShipment",
flags={"read_only": True},
)
supported_carriers_for_return_shipment = cls._schema_on_200.properties.details.datacenter_address.supported_carriers_for_return_shipment
supported_carriers_for_return_shipment.Element = AAZStrType()
disc_datacenter_address_instruction = cls._schema_on_200.properties.details.datacenter_address.discriminate_by("datacenter_address_type", "DatacenterAddressInstruction")
disc_datacenter_address_instruction.communication_instruction = AAZStrType(
serialized_name="communicationInstruction",
flags={"read_only": True},
)
disc_datacenter_address_location = cls._schema_on_200.properties.details.datacenter_address.discriminate_by("datacenter_address_type", "DatacenterAddressLocation")
disc_datacenter_address_location.additional_shipping_information = AAZStrType(
serialized_name="additionalShippingInformation",
flags={"read_only": True},
)
disc_datacenter_address_location.address_type = AAZStrType(
serialized_name="addressType",
flags={"read_only": True},
)
disc_datacenter_address_location.city = AAZStrType(
flags={"read_only": True},
)
disc_datacenter_address_location.company = AAZStrType(
flags={"read_only": True},
)
disc_datacenter_address_location.contact_person_name = AAZStrType(
serialized_name="contactPersonName",
flags={"read_only": True},
)
disc_datacenter_address_location.country = AAZStrType(
flags={"read_only": True},
)
disc_datacenter_address_location.phone = AAZStrType(
flags={"read_only": True},
)
disc_datacenter_address_location.phone_extension = AAZStrType(
serialized_name="phoneExtension",
flags={"read_only": True},
)
disc_datacenter_address_location.state = AAZStrType(
flags={"read_only": True},
)
disc_datacenter_address_location.street1 = AAZStrType(
flags={"read_only": True},
)
disc_datacenter_address_location.street2 = AAZStrType(
flags={"read_only": True},
)
disc_datacenter_address_location.street3 = AAZStrType(
flags={"read_only": True},
)
disc_datacenter_address_location.zip = AAZStrType(
flags={"read_only": True},
)
device_erasure_details = cls._schema_on_200.properties.details.device_erasure_details
device_erasure_details.device_erasure_status = AAZStrType(
serialized_name="deviceErasureStatus",
flags={"read_only": True},
)
device_erasure_details.erasure_or_destruction_certificate_sas_key = AAZStrType(
serialized_name="erasureOrDestructionCertificateSasKey",
flags={"read_only": True},
)
job_stages = cls._schema_on_200.properties.details.job_stages
job_stages.Element = AAZObjectType()
_element = cls._schema_on_200.properties.details.job_stages.Element
_element.display_name = AAZStrType(
serialized_name="displayName",
flags={"read_only": True},
)
_element.stage_name = AAZStrType(
serialized_name="stageName",
flags={"read_only": True},
)
_element.stage_status = AAZStrType(
serialized_name="stageStatus",
flags={"read_only": True},
)
_element.stage_time = AAZStrType(
serialized_name="stageTime",
flags={"read_only": True},
)
key_encryption_key = cls._schema_on_200.properties.details.key_encryption_key
key_encryption_key.identity_properties = AAZObjectType(
serialized_name="identityProperties",
)
key_encryption_key.kek_type = AAZStrType(
serialized_name="kekType",
flags={"required": True},
)
key_encryption_key.kek_url = AAZStrType(
serialized_name="kekUrl",
)
key_encryption_key.kek_vault_resource_id = AAZStrType(
serialized_name="kekVaultResourceID",
)
identity_properties = cls._schema_on_200.properties.details.key_encryption_key.identity_properties
identity_properties.type = AAZStrType()
identity_properties.user_assigned = AAZObjectType(
serialized_name="userAssigned",
)
user_assigned = cls._schema_on_200.properties.details.key_encryption_key.identity_properties.user_assigned
user_assigned.resource_id = AAZStrType(
serialized_name="resourceId",
)
last_mitigation_action_on_job = cls._schema_on_200.properties.details.last_mitigation_action_on_job
last_mitigation_action_on_job.action_date_time_in_utc = AAZStrType(
serialized_name="actionDateTimeInUtc",
)
last_mitigation_action_on_job.customer_resolution = AAZStrType(
serialized_name="customerResolution",
)
last_mitigation_action_on_job.is_performed_by_customer = AAZBoolType(
serialized_name="isPerformedByCustomer",
)
preferences = cls._schema_on_200.properties.details.preferences
preferences.encryption_preferences = AAZObjectType(
serialized_name="encryptionPreferences",
)
preferences.preferred_data_center_region = AAZListType(
serialized_name="preferredDataCenterRegion",
)
preferences.reverse_transport_preferences = AAZObjectType(
serialized_name="reverseTransportPreferences",
)
_CreateHelper._build_schema_transport_preferences_read(preferences.reverse_transport_preferences)
preferences.storage_account_access_tier_preferences = AAZListType(
serialized_name="storageAccountAccessTierPreferences",
)
preferences.transport_preferences = AAZObjectType(
serialized_name="transportPreferences",
)
_CreateHelper._build_schema_transport_preferences_read(preferences.transport_preferences)
encryption_preferences = cls._schema_on_200.properties.details.preferences.encryption_preferences
encryption_preferences.double_encryption = AAZStrType(
serialized_name="doubleEncryption",
)
encryption_preferences.hardware_encryption = AAZStrType(
serialized_name="hardwareEncryption",
)
preferred_data_center_region = cls._schema_on_200.properties.details.preferences.preferred_data_center_region
preferred_data_center_region.Element = AAZStrType()
storage_account_access_tier_preferences = cls._schema_on_200.properties.details.preferences.storage_account_access_tier_preferences
storage_account_access_tier_preferences.Element = AAZStrType()
reverse_shipping_details = cls._schema_on_200.properties.details.reverse_shipping_details
reverse_shipping_details.contact_details = AAZObjectType(
serialized_name="contactDetails",
)
reverse_shipping_details.is_updated = AAZBoolType(
serialized_name="isUpdated",
flags={"read_only": True},
)
reverse_shipping_details.shipping_address = AAZObjectType(
serialized_name="shippingAddress",
)
_CreateHelper._build_schema_shipping_address_read(reverse_shipping_details.shipping_address)
contact_details = cls._schema_on_200.properties.details.reverse_shipping_details.contact_details
contact_details.contact_name = AAZStrType(
serialized_name="contactName",
flags={"required": True},
)
contact_details.mobile = AAZStrType()
contact_details.phone = AAZStrType(
flags={"required": True},
)
contact_details.phone_extension = AAZStrType(
serialized_name="phoneExtension",
)
disc_data_box = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBox")
disc_data_box.copy_progress = AAZListType(
serialized_name="copyProgress",
flags={"read_only": True},
)
disc_data_box.device_password = AAZStrType(
serialized_name="devicePassword",
)
copy_progress = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBox").copy_progress
copy_progress.Element = AAZObjectType()
_CreateHelper._build_schema_copy_progress_read(copy_progress.Element)
disc_data_box_customer_disk = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk")
disc_data_box_customer_disk.copy_progress = AAZListType(
serialized_name="copyProgress",
flags={"read_only": True},
)
disc_data_box_customer_disk.deliver_to_dc_package_details = AAZObjectType(
serialized_name="deliverToDcPackageDetails",
)
disc_data_box_customer_disk.enable_manifest_backup = AAZBoolType(
serialized_name="enableManifestBackup",
)
disc_data_box_customer_disk.export_disk_details_collection = AAZDictType(
serialized_name="exportDiskDetailsCollection",
flags={"read_only": True},
)
disc_data_box_customer_disk.import_disk_details_collection = AAZDictType(
serialized_name="importDiskDetailsCollection",
)
disc_data_box_customer_disk.return_to_customer_package_details = AAZObjectType(
serialized_name="returnToCustomerPackageDetails",
flags={"required": True},
)
copy_progress = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").copy_progress
copy_progress.Element = AAZObjectType()
_element = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").copy_progress.Element
_element.account_id = AAZStrType(
serialized_name="accountId",
flags={"read_only": True},
)
_element.actions = AAZListType(
flags={"read_only": True},
)
_element.bytes_processed = AAZIntType(
serialized_name="bytesProcessed",
flags={"read_only": True},
)
_element.copy_status = AAZStrType(
serialized_name="copyStatus",
flags={"read_only": True},
)
_element.data_account_type = AAZStrType(
serialized_name="dataAccountType",
flags={"read_only": True},
)
_element.directories_errored_out = AAZIntType(
serialized_name="directoriesErroredOut",
flags={"read_only": True},
)
_element.error = AAZObjectType()
_CreateHelper._build_schema_cloud_error_read(_element.error)
_element.files_errored_out = AAZIntType(
serialized_name="filesErroredOut",
flags={"read_only": True},
)
_element.files_processed = AAZIntType(
serialized_name="filesProcessed",
flags={"read_only": True},
)
_element.invalid_directories_processed = AAZIntType(
serialized_name="invalidDirectoriesProcessed",
flags={"read_only": True},
)
_element.invalid_file_bytes_uploaded = AAZIntType(
serialized_name="invalidFileBytesUploaded",
flags={"read_only": True},
)
_element.invalid_files_processed = AAZIntType(
serialized_name="invalidFilesProcessed",
flags={"read_only": True},
)
_element.is_enumeration_in_progress = AAZBoolType(
serialized_name="isEnumerationInProgress",
flags={"read_only": True},
)
_element.renamed_container_count = AAZIntType(
serialized_name="renamedContainerCount",
flags={"read_only": True},
)
_element.serial_number = AAZStrType(
serialized_name="serialNumber",
flags={"read_only": True},
)
_element.storage_account_name = AAZStrType(
serialized_name="storageAccountName",
flags={"read_only": True},
)
_element.total_bytes_to_process = AAZIntType(
serialized_name="totalBytesToProcess",
flags={"read_only": True},
)
_element.total_files_to_process = AAZIntType(
serialized_name="totalFilesToProcess",
flags={"read_only": True},
)
_element.transfer_type = AAZStrType(
serialized_name="transferType",
flags={"read_only": True},
)
actions = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").copy_progress.Element.actions
actions.Element = AAZStrType()
deliver_to_dc_package_details = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").deliver_to_dc_package_details
deliver_to_dc_package_details.carrier_name = AAZStrType(
serialized_name="carrierName",
)
deliver_to_dc_package_details.tracking_id = AAZStrType(
serialized_name="trackingId",
)
export_disk_details_collection = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").export_disk_details_collection
export_disk_details_collection.Element = AAZObjectType()
_element = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").export_disk_details_collection.Element
_element.backup_manifest_cloud_path = AAZStrType(
serialized_name="backupManifestCloudPath",
flags={"read_only": True},
)
_element.manifest_file = AAZStrType(
serialized_name="manifestFile",
flags={"read_only": True},
)
_element.manifest_hash = AAZStrType(
serialized_name="manifestHash",
flags={"read_only": True},
)
import_disk_details_collection = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").import_disk_details_collection
import_disk_details_collection.Element = AAZObjectType()
_element = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").import_disk_details_collection.Element
_element.backup_manifest_cloud_path = AAZStrType(
serialized_name="backupManifestCloudPath",
flags={"read_only": True},
)
_element.bit_locker_key = AAZStrType(
serialized_name="bitLockerKey",
flags={"required": True, "secret": True},
)
_element.manifest_file = AAZStrType(
serialized_name="manifestFile",
flags={"required": True},
)
_element.manifest_hash = AAZStrType(
serialized_name="manifestHash",
flags={"required": True},
)
return_to_customer_package_details = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxCustomerDisk").return_to_customer_package_details
return_to_customer_package_details.carrier_account_number = AAZStrType(
serialized_name="carrierAccountNumber",
flags={"secret": True},
)
return_to_customer_package_details.carrier_name = AAZStrType(
serialized_name="carrierName",
)
return_to_customer_package_details.tracking_id = AAZStrType(
serialized_name="trackingId",
)
disc_data_box_disk = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk")
disc_data_box_disk.copy_progress = AAZListType(
serialized_name="copyProgress",
flags={"read_only": True},
)
disc_data_box_disk.disks_and_size_details = AAZDictType(
serialized_name="disksAndSizeDetails",
flags={"read_only": True},
)
disc_data_box_disk.granular_copy_log_details = AAZListType(
serialized_name="granularCopyLogDetails",
flags={"read_only": True},
)
disc_data_box_disk.granular_copy_progress = AAZListType(
serialized_name="granularCopyProgress",
flags={"read_only": True},
)
disc_data_box_disk.passkey = AAZStrType()
disc_data_box_disk.preferred_disks = AAZDictType(
serialized_name="preferredDisks",
)
copy_progress = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").copy_progress
copy_progress.Element = AAZObjectType()
_element = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").copy_progress.Element
_element.actions = AAZListType(
flags={"read_only": True},
)
_element.bytes_copied = AAZIntType(
serialized_name="bytesCopied",
flags={"read_only": True},
)
_element.error = AAZObjectType()
_CreateHelper._build_schema_cloud_error_read(_element.error)
_element.percent_complete = AAZIntType(
serialized_name="percentComplete",
flags={"read_only": True},
)
_element.serial_number = AAZStrType(
serialized_name="serialNumber",
flags={"read_only": True},
)
_element.status = AAZStrType(
flags={"read_only": True},
)
actions = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").copy_progress.Element.actions
actions.Element = AAZStrType()
disks_and_size_details = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").disks_and_size_details
disks_and_size_details.Element = AAZIntType()
granular_copy_log_details = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").granular_copy_log_details
granular_copy_log_details.Element = AAZObjectType()
_element = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").granular_copy_log_details.Element
_element.account_id = AAZStrType(
serialized_name="accountId",
flags={"read_only": True},
)
_element.copy_log_details_type = AAZStrType(
serialized_name="copyLogDetailsType",
flags={"required": True},
)
_element.error_log_link = AAZStrType(
serialized_name="errorLogLink",
flags={"read_only": True},
)
_element.serial_number = AAZStrType(
serialized_name="serialNumber",
flags={"read_only": True},
)
_element.verbose_log_link = AAZStrType(
serialized_name="verboseLogLink",
flags={"read_only": True},
)
granular_copy_progress = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").granular_copy_progress
granular_copy_progress.Element = AAZObjectType()
_element = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").granular_copy_progress.Element
_element.account_id = AAZStrType(
serialized_name="accountId",
flags={"read_only": True},
)
_element.actions = AAZListType(
flags={"read_only": True},
)
_element.bytes_processed = AAZIntType(
serialized_name="bytesProcessed",
flags={"read_only": True},
)
_element.copy_status = AAZStrType(
serialized_name="copyStatus",
flags={"read_only": True},
)
_element.data_account_type = AAZStrType(
serialized_name="dataAccountType",
flags={"read_only": True},
)
_element.directories_errored_out = AAZIntType(
serialized_name="directoriesErroredOut",
flags={"read_only": True},
)
_element.error = AAZObjectType()
_CreateHelper._build_schema_cloud_error_read(_element.error)
_element.files_errored_out = AAZIntType(
serialized_name="filesErroredOut",
flags={"read_only": True},
)
_element.files_processed = AAZIntType(
serialized_name="filesProcessed",
flags={"read_only": True},
)
_element.invalid_directories_processed = AAZIntType(
serialized_name="invalidDirectoriesProcessed",
flags={"read_only": True},
)
_element.invalid_file_bytes_uploaded = AAZIntType(
serialized_name="invalidFileBytesUploaded",
flags={"read_only": True},
)
_element.invalid_files_processed = AAZIntType(
serialized_name="invalidFilesProcessed",
flags={"read_only": True},
)
_element.is_enumeration_in_progress = AAZBoolType(
serialized_name="isEnumerationInProgress",
flags={"read_only": True},
)
_element.renamed_container_count = AAZIntType(
serialized_name="renamedContainerCount",
flags={"read_only": True},
)
_element.serial_number = AAZStrType(
serialized_name="serialNumber",
flags={"read_only": True},
)
_element.storage_account_name = AAZStrType(
serialized_name="storageAccountName",
flags={"read_only": True},
)
_element.total_bytes_to_process = AAZIntType(
serialized_name="totalBytesToProcess",
flags={"read_only": True},
)
_element.total_files_to_process = AAZIntType(
serialized_name="totalFilesToProcess",
flags={"read_only": True},
)
_element.transfer_type = AAZStrType(
serialized_name="transferType",
flags={"read_only": True},
)
actions = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").granular_copy_progress.Element.actions
actions.Element = AAZStrType()
preferred_disks = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxDisk").preferred_disks
preferred_disks.Element = AAZIntType()
disc_data_box_heavy = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxHeavy")
disc_data_box_heavy.copy_progress = AAZListType(
serialized_name="copyProgress",
flags={"read_only": True},
)
disc_data_box_heavy.device_password = AAZStrType(
serialized_name="devicePassword",
)
copy_progress = cls._schema_on_200.properties.details.discriminate_by("job_details_type", "DataBoxHeavy").copy_progress
copy_progress.Element = AAZObjectType()
_CreateHelper._build_schema_copy_progress_read(copy_progress.Element)
sku = cls._schema_on_200.sku
sku.display_name = AAZStrType(
serialized_name="displayName",
)
sku.family = AAZStrType()
sku.name = AAZStrType(
flags={"required": True},
)
system_data = cls._schema_on_200.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
flags={"read_only": True},
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
flags={"read_only": True},
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
flags={"read_only": True},
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
flags={"read_only": True},
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
flags={"read_only": True},
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
flags={"read_only": True},
)
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class Create(AAZCommand):
'''Create a new job with the specified parameters.
:example: Create job
az databox job create -g rg -n job-name --sku databox --contact-name 'test' --phone 14258828080 --email-list testing@microsoft.com --street-address1 "1 MICROSOFT WAY" --city Redmond --state-or-province WA --country US --postal-code 98052 --company-name Microsoft --storage-account account-id --staging-storage-account account-id --resource-group-for-managed-disk rg --transfer-type ImportToAzure --kek-type MicrosoftManaged
'''
def _handler(self, command_args):
pass
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
pass
@classmethod
def _build_args_shipping_address_create(cls, _schema):
pass
@classmethod
def _build_args_transport_preferences_create(cls, _schema):
pass
def _execute_operations(self):
pass
@register_callback
def pre_operations(self):
pass
@register_callback
def post_operations(self):
pass
def _output(self, *args, **kwargs):
pass
class JobsCreate(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
@property
def content(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 33 | 1 | 110 | 11 | 99 | 1 | 4 | 0.01 | 1 | 2 | 1 | 1 | 5 | 0 | 8 | 8 | 2,039 | 219 | 1,808 | 182 | 1,775 | 16 | 818 | 168 | 798 | 46 | 1 | 1 | 69 |
8,405 |
Azure/azure-cli-extensions
|
src/databox/azext_databox/aaz/latest/databox/job/_create.py
|
azext_databox.aaz.latest.databox.job._create._CreateHelper
|
class _CreateHelper:
"""Helper class for Create"""
@classmethod
def _build_schema_shipping_address_create(cls, _builder):
if _builder is None:
return
_builder.set_prop("addressType", AAZStrType, ".address_type")
_builder.set_prop("city", AAZStrType, ".city")
_builder.set_prop("companyName", AAZStrType, ".company_name")
_builder.set_prop("country", AAZStrType, ".country", typ_kwargs={"flags": {"required": True}})
_builder.set_prop("postalCode", AAZStrType, ".postal_code")
_builder.set_prop("skipAddressValidation", AAZBoolType, ".skip_address_validation")
_builder.set_prop("stateOrProvince", AAZStrType, ".state_or_province")
_builder.set_prop("streetAddress1", AAZStrType, ".street_address1", typ_kwargs={"flags": {"required": True}})
_builder.set_prop("streetAddress2", AAZStrType, ".street_address2")
_builder.set_prop("streetAddress3", AAZStrType, ".street_address3")
_builder.set_prop("taxIdentificationNumber", AAZStrType, ".tax_identification_number")
_builder.set_prop("zipExtendedCode", AAZStrType, ".zip_extended_code")
@classmethod
def _build_schema_transport_preferences_create(cls, _builder):
if _builder is None:
return
_builder.set_prop("preferredShipmentType", AAZStrType, ".preferred_shipment_type", typ_kwargs={"flags": {"required": True}})
_schema_cloud_error_read = None
@classmethod
def _build_schema_cloud_error_read(cls, _schema):
if cls._schema_cloud_error_read is not None:
_schema.additional_info = cls._schema_cloud_error_read.additional_info
_schema.code = cls._schema_cloud_error_read.code
_schema.details = cls._schema_cloud_error_read.details
_schema.message = cls._schema_cloud_error_read.message
_schema.target = cls._schema_cloud_error_read.target
return
cls._schema_cloud_error_read = _schema_cloud_error_read = AAZObjectType()
cloud_error_read = _schema_cloud_error_read
cloud_error_read.additional_info = AAZListType(
serialized_name="additionalInfo",
flags={"read_only": True},
)
cloud_error_read.code = AAZStrType()
cloud_error_read.details = AAZListType(
flags={"read_only": True},
)
cloud_error_read.message = AAZStrType()
cloud_error_read.target = AAZStrType()
additional_info = _schema_cloud_error_read.additional_info
additional_info.Element = AAZObjectType()
_element = _schema_cloud_error_read.additional_info.Element
_element.type = AAZStrType()
details = _schema_cloud_error_read.details
details.Element = AAZObjectType()
cls._build_schema_cloud_error_read(details.Element)
_schema.additional_info = cls._schema_cloud_error_read.additional_info
_schema.code = cls._schema_cloud_error_read.code
_schema.details = cls._schema_cloud_error_read.details
_schema.message = cls._schema_cloud_error_read.message
_schema.target = cls._schema_cloud_error_read.target
_schema_copy_progress_read = None
@classmethod
def _build_schema_copy_progress_read(cls, _schema):
if cls._schema_copy_progress_read is not None:
_schema.account_id = cls._schema_copy_progress_read.account_id
_schema.actions = cls._schema_copy_progress_read.actions
_schema.bytes_processed = cls._schema_copy_progress_read.bytes_processed
_schema.data_account_type = cls._schema_copy_progress_read.data_account_type
_schema.directories_errored_out = cls._schema_copy_progress_read.directories_errored_out
_schema.error = cls._schema_copy_progress_read.error
_schema.files_errored_out = cls._schema_copy_progress_read.files_errored_out
_schema.files_processed = cls._schema_copy_progress_read.files_processed
_schema.invalid_directories_processed = cls._schema_copy_progress_read.invalid_directories_processed
_schema.invalid_file_bytes_uploaded = cls._schema_copy_progress_read.invalid_file_bytes_uploaded
_schema.invalid_files_processed = cls._schema_copy_progress_read.invalid_files_processed
_schema.is_enumeration_in_progress = cls._schema_copy_progress_read.is_enumeration_in_progress
_schema.renamed_container_count = cls._schema_copy_progress_read.renamed_container_count
_schema.storage_account_name = cls._schema_copy_progress_read.storage_account_name
_schema.total_bytes_to_process = cls._schema_copy_progress_read.total_bytes_to_process
_schema.total_files_to_process = cls._schema_copy_progress_read.total_files_to_process
_schema.transfer_type = cls._schema_copy_progress_read.transfer_type
return
cls._schema_copy_progress_read = _schema_copy_progress_read = AAZObjectType()
copy_progress_read = _schema_copy_progress_read
copy_progress_read.account_id = AAZStrType(
serialized_name="accountId",
flags={"read_only": True},
)
copy_progress_read.actions = AAZListType(
flags={"read_only": True},
)
copy_progress_read.bytes_processed = AAZIntType(
serialized_name="bytesProcessed",
flags={"read_only": True},
)
copy_progress_read.data_account_type = AAZStrType(
serialized_name="dataAccountType",
flags={"read_only": True},
)
copy_progress_read.directories_errored_out = AAZIntType(
serialized_name="directoriesErroredOut",
flags={"read_only": True},
)
copy_progress_read.error = AAZObjectType()
cls._build_schema_cloud_error_read(copy_progress_read.error)
copy_progress_read.files_errored_out = AAZIntType(
serialized_name="filesErroredOut",
flags={"read_only": True},
)
copy_progress_read.files_processed = AAZIntType(
serialized_name="filesProcessed",
flags={"read_only": True},
)
copy_progress_read.invalid_directories_processed = AAZIntType(
serialized_name="invalidDirectoriesProcessed",
flags={"read_only": True},
)
copy_progress_read.invalid_file_bytes_uploaded = AAZIntType(
serialized_name="invalidFileBytesUploaded",
flags={"read_only": True},
)
copy_progress_read.invalid_files_processed = AAZIntType(
serialized_name="invalidFilesProcessed",
flags={"read_only": True},
)
copy_progress_read.is_enumeration_in_progress = AAZBoolType(
serialized_name="isEnumerationInProgress",
flags={"read_only": True},
)
copy_progress_read.renamed_container_count = AAZIntType(
serialized_name="renamedContainerCount",
flags={"read_only": True},
)
copy_progress_read.storage_account_name = AAZStrType(
serialized_name="storageAccountName",
flags={"read_only": True},
)
copy_progress_read.total_bytes_to_process = AAZIntType(
serialized_name="totalBytesToProcess",
flags={"read_only": True},
)
copy_progress_read.total_files_to_process = AAZIntType(
serialized_name="totalFilesToProcess",
flags={"read_only": True},
)
copy_progress_read.transfer_type = AAZStrType(
serialized_name="transferType",
flags={"read_only": True},
)
actions = _schema_copy_progress_read.actions
actions.Element = AAZStrType()
_schema.account_id = cls._schema_copy_progress_read.account_id
_schema.actions = cls._schema_copy_progress_read.actions
_schema.bytes_processed = cls._schema_copy_progress_read.bytes_processed
_schema.data_account_type = cls._schema_copy_progress_read.data_account_type
_schema.directories_errored_out = cls._schema_copy_progress_read.directories_errored_out
_schema.error = cls._schema_copy_progress_read.error
_schema.files_errored_out = cls._schema_copy_progress_read.files_errored_out
_schema.files_processed = cls._schema_copy_progress_read.files_processed
_schema.invalid_directories_processed = cls._schema_copy_progress_read.invalid_directories_processed
_schema.invalid_file_bytes_uploaded = cls._schema_copy_progress_read.invalid_file_bytes_uploaded
_schema.invalid_files_processed = cls._schema_copy_progress_read.invalid_files_processed
_schema.is_enumeration_in_progress = cls._schema_copy_progress_read.is_enumeration_in_progress
_schema.renamed_container_count = cls._schema_copy_progress_read.renamed_container_count
_schema.storage_account_name = cls._schema_copy_progress_read.storage_account_name
_schema.total_bytes_to_process = cls._schema_copy_progress_read.total_bytes_to_process
_schema.total_files_to_process = cls._schema_copy_progress_read.total_files_to_process
_schema.transfer_type = cls._schema_copy_progress_read.transfer_type
_schema_data_account_details_read = None
@classmethod
def _build_schema_data_account_details_read(cls, _schema):
if cls._schema_data_account_details_read is not None:
_schema.data_account_type = cls._schema_data_account_details_read.data_account_type
_schema.discriminate_by(
"data_account_type",
"ManagedDisk",
cls._schema_data_account_details_read.discriminate_by(
"data_account_type",
"ManagedDisk",
)
)
_schema.discriminate_by(
"data_account_type",
"StorageAccount",
cls._schema_data_account_details_read.discriminate_by(
"data_account_type",
"StorageAccount",
)
)
return
cls._schema_data_account_details_read = _schema_data_account_details_read = AAZObjectType()
data_account_details_read = _schema_data_account_details_read
data_account_details_read.data_account_type = AAZStrType(
serialized_name="dataAccountType",
flags={"required": True},
)
disc_managed_disk = _schema_data_account_details_read.discriminate_by("data_account_type", "ManagedDisk")
disc_managed_disk.resource_group_id = AAZStrType(
serialized_name="resourceGroupId",
flags={"required": True},
)
disc_managed_disk.staging_storage_account_id = AAZStrType(
serialized_name="stagingStorageAccountId",
flags={"required": True},
)
disc_storage_account = _schema_data_account_details_read.discriminate_by("data_account_type", "StorageAccount")
disc_storage_account.storage_account_id = AAZStrType(
serialized_name="storageAccountId",
flags={"required": True},
)
_schema.data_account_type = cls._schema_data_account_details_read.data_account_type
_schema.discriminate_by(
"data_account_type",
"ManagedDisk",
cls._schema_data_account_details_read.discriminate_by(
"data_account_type",
"ManagedDisk",
)
)
_schema.discriminate_by(
"data_account_type",
"StorageAccount",
cls._schema_data_account_details_read.discriminate_by(
"data_account_type",
"StorageAccount",
)
)
_schema_package_shipping_details_read = None
@classmethod
def _build_schema_package_shipping_details_read(cls, _schema):
if cls._schema_package_shipping_details_read is not None:
_schema.carrier_name = cls._schema_package_shipping_details_read.carrier_name
_schema.tracking_id = cls._schema_package_shipping_details_read.tracking_id
_schema.tracking_url = cls._schema_package_shipping_details_read.tracking_url
return
cls._schema_package_shipping_details_read = _schema_package_shipping_details_read = AAZObjectType()
package_shipping_details_read = _schema_package_shipping_details_read
package_shipping_details_read.carrier_name = AAZStrType(
serialized_name="carrierName",
flags={"read_only": True},
)
package_shipping_details_read.tracking_id = AAZStrType(
serialized_name="trackingId",
flags={"read_only": True},
)
package_shipping_details_read.tracking_url = AAZStrType(
serialized_name="trackingUrl",
flags={"read_only": True},
)
_schema.carrier_name = cls._schema_package_shipping_details_read.carrier_name
_schema.tracking_id = cls._schema_package_shipping_details_read.tracking_id
_schema.tracking_url = cls._schema_package_shipping_details_read.tracking_url
_schema_shipping_address_read = None
@classmethod
def _build_schema_shipping_address_read(cls, _schema):
if cls._schema_shipping_address_read is not None:
_schema.address_type = cls._schema_shipping_address_read.address_type
_schema.city = cls._schema_shipping_address_read.city
_schema.company_name = cls._schema_shipping_address_read.company_name
_schema.country = cls._schema_shipping_address_read.country
_schema.postal_code = cls._schema_shipping_address_read.postal_code
_schema.skip_address_validation = cls._schema_shipping_address_read.skip_address_validation
_schema.state_or_province = cls._schema_shipping_address_read.state_or_province
_schema.street_address1 = cls._schema_shipping_address_read.street_address1
_schema.street_address2 = cls._schema_shipping_address_read.street_address2
_schema.street_address3 = cls._schema_shipping_address_read.street_address3
_schema.tax_identification_number = cls._schema_shipping_address_read.tax_identification_number
_schema.zip_extended_code = cls._schema_shipping_address_read.zip_extended_code
return
cls._schema_shipping_address_read = _schema_shipping_address_read = AAZObjectType()
shipping_address_read = _schema_shipping_address_read
shipping_address_read.address_type = AAZStrType(
serialized_name="addressType",
)
shipping_address_read.city = AAZStrType()
shipping_address_read.company_name = AAZStrType(
serialized_name="companyName",
)
shipping_address_read.country = AAZStrType(
flags={"required": True},
)
shipping_address_read.postal_code = AAZStrType(
serialized_name="postalCode",
)
shipping_address_read.skip_address_validation = AAZBoolType(
serialized_name="skipAddressValidation",
)
shipping_address_read.state_or_province = AAZStrType(
serialized_name="stateOrProvince",
)
shipping_address_read.street_address1 = AAZStrType(
serialized_name="streetAddress1",
flags={"required": True},
)
shipping_address_read.street_address2 = AAZStrType(
serialized_name="streetAddress2",
)
shipping_address_read.street_address3 = AAZStrType(
serialized_name="streetAddress3",
)
shipping_address_read.tax_identification_number = AAZStrType(
serialized_name="taxIdentificationNumber",
)
shipping_address_read.zip_extended_code = AAZStrType(
serialized_name="zipExtendedCode",
)
_schema.address_type = cls._schema_shipping_address_read.address_type
_schema.city = cls._schema_shipping_address_read.city
_schema.company_name = cls._schema_shipping_address_read.company_name
_schema.country = cls._schema_shipping_address_read.country
_schema.postal_code = cls._schema_shipping_address_read.postal_code
_schema.skip_address_validation = cls._schema_shipping_address_read.skip_address_validation
_schema.state_or_province = cls._schema_shipping_address_read.state_or_province
_schema.street_address1 = cls._schema_shipping_address_read.street_address1
_schema.street_address2 = cls._schema_shipping_address_read.street_address2
_schema.street_address3 = cls._schema_shipping_address_read.street_address3
_schema.tax_identification_number = cls._schema_shipping_address_read.tax_identification_number
_schema.zip_extended_code = cls._schema_shipping_address_read.zip_extended_code
_schema_transport_preferences_read = None
@classmethod
def _build_schema_transport_preferences_read(cls, _schema):
if cls._schema_transport_preferences_read is not None:
_schema.is_updated = cls._schema_transport_preferences_read.is_updated
_schema.preferred_shipment_type = cls._schema_transport_preferences_read.preferred_shipment_type
return
cls._schema_transport_preferences_read = _schema_transport_preferences_read = AAZObjectType()
transport_preferences_read = _schema_transport_preferences_read
transport_preferences_read.is_updated = AAZBoolType(
serialized_name="isUpdated",
flags={"read_only": True},
)
transport_preferences_read.preferred_shipment_type = AAZStrType(
serialized_name="preferredShipmentType",
flags={"required": True},
)
_schema.is_updated = cls._schema_transport_preferences_read.is_updated
_schema.preferred_shipment_type = cls._schema_transport_preferences_read.preferred_shipment_type
|
class _CreateHelper:
'''Helper class for Create'''
@classmethod
def _build_schema_shipping_address_create(cls, _builder):
pass
@classmethod
def _build_schema_transport_preferences_create(cls, _builder):
pass
@classmethod
def _build_schema_cloud_error_read(cls, _schema):
pass
@classmethod
def _build_schema_copy_progress_read(cls, _schema):
pass
@classmethod
def _build_schema_data_account_details_read(cls, _schema):
pass
@classmethod
def _build_schema_package_shipping_details_read(cls, _schema):
pass
@classmethod
def _build_schema_shipping_address_read(cls, _schema):
pass
@classmethod
def _build_schema_transport_preferences_read(cls, _schema):
pass
| 17 | 1 | 43 | 3 | 40 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 8 | 372 | 38 | 333 | 41 | 316 | 1 | 195 | 27 | 186 | 2 | 0 | 1 | 16 |
8,406 |
Azure/azure-cli-extensions
|
src/databox/azext_databox/aaz/latest/databox/job/_delete.py
|
azext_databox.aaz.latest.databox.job._delete.Delete
|
class Delete(AAZCommand):
"""Delete a job.
:example: Delete job
az databox job delete -n job-name -g rg
"""
_aaz_info = {
"version": "2022-12-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databox/jobs/{}", "2022-12-01"],
]
}
AZ_SUPPORT_NO_WAIT = True
def _handler(self, command_args):
super()._handler(command_args)
return self.build_lro_poller(self._execute_operations, None)
_args_schema = None
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
if cls._args_schema is not None:
return cls._args_schema
cls._args_schema = super()._build_arguments_schema(*args, **kwargs)
# define Arg Group ""
_args_schema = cls._args_schema
_args_schema.job_name = AAZStrArg(
options=["-n", "--name", "--job-name"],
help="The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[-\w\.]+$",
max_length=24,
min_length=3,
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
return cls._args_schema
def _execute_operations(self):
self.pre_operations()
yield self.JobsDelete(ctx=self.ctx)()
self.post_operations()
@register_callback
def pre_operations(self):
pass
@register_callback
def post_operations(self):
pass
class JobsDelete(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(request=request, stream=False, **kwargs)
if session.http_response.status_code in [202]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [204]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_204,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}",
**self.url_parameters
)
@property
def method(self):
return "DELETE"
@property
def error_format(self):
return "ODataV4Format"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"jobName", self.ctx.args.job_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-12-01",
required=True,
),
}
return parameters
def on_200(self, session):
pass
def on_204(self, session):
pass
|
class Delete(AAZCommand):
'''Delete a job.
:example: Delete job
az databox job delete -n job-name -g rg
'''
def _handler(self, command_args):
pass
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
pass
def _execute_operations(self):
pass
@register_callback
def pre_operations(self):
pass
@register_callback
def post_operations(self):
pass
class JobsDelete(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
def on_200(self, session):
pass
def on_204(self, session):
pass
| 23 | 1 | 8 | 0 | 8 | 0 | 1 | 0.04 | 1 | 2 | 1 | 0 | 4 | 0 | 5 | 5 | 144 | 21 | 118 | 33 | 95 | 5 | 51 | 24 | 36 | 4 | 1 | 1 | 17 |
8,407 |
Azure/azure-cli-extensions
|
src/databox/azext_databox/aaz/latest/databox/job/_list.py
|
azext_databox.aaz.latest.databox.job._list._ListHelper
|
class _ListHelper:
"""Helper class for List"""
_schema_cloud_error_read = None
@classmethod
def _build_schema_cloud_error_read(cls, _schema):
if cls._schema_cloud_error_read is not None:
_schema.additional_info = cls._schema_cloud_error_read.additional_info
_schema.code = cls._schema_cloud_error_read.code
_schema.details = cls._schema_cloud_error_read.details
_schema.message = cls._schema_cloud_error_read.message
_schema.target = cls._schema_cloud_error_read.target
return
cls._schema_cloud_error_read = _schema_cloud_error_read = AAZObjectType()
cloud_error_read = _schema_cloud_error_read
cloud_error_read.additional_info = AAZListType(
serialized_name="additionalInfo",
flags={"read_only": True},
)
cloud_error_read.code = AAZStrType()
cloud_error_read.details = AAZListType(
flags={"read_only": True},
)
cloud_error_read.message = AAZStrType()
cloud_error_read.target = AAZStrType()
additional_info = _schema_cloud_error_read.additional_info
additional_info.Element = AAZObjectType()
_element = _schema_cloud_error_read.additional_info.Element
_element.type = AAZStrType()
details = _schema_cloud_error_read.details
details.Element = AAZObjectType()
cls._build_schema_cloud_error_read(details.Element)
_schema.additional_info = cls._schema_cloud_error_read.additional_info
_schema.code = cls._schema_cloud_error_read.code
_schema.details = cls._schema_cloud_error_read.details
_schema.message = cls._schema_cloud_error_read.message
_schema.target = cls._schema_cloud_error_read.target
_schema_copy_progress_read = None
@classmethod
def _build_schema_copy_progress_read(cls, _schema):
if cls._schema_copy_progress_read is not None:
_schema.account_id = cls._schema_copy_progress_read.account_id
_schema.actions = cls._schema_copy_progress_read.actions
_schema.bytes_processed = cls._schema_copy_progress_read.bytes_processed
_schema.data_account_type = cls._schema_copy_progress_read.data_account_type
_schema.directories_errored_out = cls._schema_copy_progress_read.directories_errored_out
_schema.error = cls._schema_copy_progress_read.error
_schema.files_errored_out = cls._schema_copy_progress_read.files_errored_out
_schema.files_processed = cls._schema_copy_progress_read.files_processed
_schema.invalid_directories_processed = cls._schema_copy_progress_read.invalid_directories_processed
_schema.invalid_file_bytes_uploaded = cls._schema_copy_progress_read.invalid_file_bytes_uploaded
_schema.invalid_files_processed = cls._schema_copy_progress_read.invalid_files_processed
_schema.is_enumeration_in_progress = cls._schema_copy_progress_read.is_enumeration_in_progress
_schema.renamed_container_count = cls._schema_copy_progress_read.renamed_container_count
_schema.storage_account_name = cls._schema_copy_progress_read.storage_account_name
_schema.total_bytes_to_process = cls._schema_copy_progress_read.total_bytes_to_process
_schema.total_files_to_process = cls._schema_copy_progress_read.total_files_to_process
_schema.transfer_type = cls._schema_copy_progress_read.transfer_type
return
cls._schema_copy_progress_read = _schema_copy_progress_read = AAZObjectType()
copy_progress_read = _schema_copy_progress_read
copy_progress_read.account_id = AAZStrType(
serialized_name="accountId",
flags={"read_only": True},
)
copy_progress_read.actions = AAZListType(
flags={"read_only": True},
)
copy_progress_read.bytes_processed = AAZIntType(
serialized_name="bytesProcessed",
flags={"read_only": True},
)
copy_progress_read.data_account_type = AAZStrType(
serialized_name="dataAccountType",
flags={"read_only": True},
)
copy_progress_read.directories_errored_out = AAZIntType(
serialized_name="directoriesErroredOut",
flags={"read_only": True},
)
copy_progress_read.error = AAZObjectType()
cls._build_schema_cloud_error_read(copy_progress_read.error)
copy_progress_read.files_errored_out = AAZIntType(
serialized_name="filesErroredOut",
flags={"read_only": True},
)
copy_progress_read.files_processed = AAZIntType(
serialized_name="filesProcessed",
flags={"read_only": True},
)
copy_progress_read.invalid_directories_processed = AAZIntType(
serialized_name="invalidDirectoriesProcessed",
flags={"read_only": True},
)
copy_progress_read.invalid_file_bytes_uploaded = AAZIntType(
serialized_name="invalidFileBytesUploaded",
flags={"read_only": True},
)
copy_progress_read.invalid_files_processed = AAZIntType(
serialized_name="invalidFilesProcessed",
flags={"read_only": True},
)
copy_progress_read.is_enumeration_in_progress = AAZBoolType(
serialized_name="isEnumerationInProgress",
flags={"read_only": True},
)
copy_progress_read.renamed_container_count = AAZIntType(
serialized_name="renamedContainerCount",
flags={"read_only": True},
)
copy_progress_read.storage_account_name = AAZStrType(
serialized_name="storageAccountName",
flags={"read_only": True},
)
copy_progress_read.total_bytes_to_process = AAZIntType(
serialized_name="totalBytesToProcess",
flags={"read_only": True},
)
copy_progress_read.total_files_to_process = AAZIntType(
serialized_name="totalFilesToProcess",
flags={"read_only": True},
)
copy_progress_read.transfer_type = AAZStrType(
serialized_name="transferType",
flags={"read_only": True},
)
actions = _schema_copy_progress_read.actions
actions.Element = AAZStrType()
_schema.account_id = cls._schema_copy_progress_read.account_id
_schema.actions = cls._schema_copy_progress_read.actions
_schema.bytes_processed = cls._schema_copy_progress_read.bytes_processed
_schema.data_account_type = cls._schema_copy_progress_read.data_account_type
_schema.directories_errored_out = cls._schema_copy_progress_read.directories_errored_out
_schema.error = cls._schema_copy_progress_read.error
_schema.files_errored_out = cls._schema_copy_progress_read.files_errored_out
_schema.files_processed = cls._schema_copy_progress_read.files_processed
_schema.invalid_directories_processed = cls._schema_copy_progress_read.invalid_directories_processed
_schema.invalid_file_bytes_uploaded = cls._schema_copy_progress_read.invalid_file_bytes_uploaded
_schema.invalid_files_processed = cls._schema_copy_progress_read.invalid_files_processed
_schema.is_enumeration_in_progress = cls._schema_copy_progress_read.is_enumeration_in_progress
_schema.renamed_container_count = cls._schema_copy_progress_read.renamed_container_count
_schema.storage_account_name = cls._schema_copy_progress_read.storage_account_name
_schema.total_bytes_to_process = cls._schema_copy_progress_read.total_bytes_to_process
_schema.total_files_to_process = cls._schema_copy_progress_read.total_files_to_process
_schema.transfer_type = cls._schema_copy_progress_read.transfer_type
_schema_data_account_details_read = None
@classmethod
def _build_schema_data_account_details_read(cls, _schema):
if cls._schema_data_account_details_read is not None:
_schema.data_account_type = cls._schema_data_account_details_read.data_account_type
_schema.discriminate_by(
"data_account_type",
"ManagedDisk",
cls._schema_data_account_details_read.discriminate_by(
"data_account_type",
"ManagedDisk",
)
)
_schema.discriminate_by(
"data_account_type",
"StorageAccount",
cls._schema_data_account_details_read.discriminate_by(
"data_account_type",
"StorageAccount",
)
)
return
cls._schema_data_account_details_read = _schema_data_account_details_read = AAZObjectType()
data_account_details_read = _schema_data_account_details_read
data_account_details_read.data_account_type = AAZStrType(
serialized_name="dataAccountType",
flags={"required": True},
)
disc_managed_disk = _schema_data_account_details_read.discriminate_by("data_account_type", "ManagedDisk")
disc_managed_disk.resource_group_id = AAZStrType(
serialized_name="resourceGroupId",
flags={"required": True},
)
disc_managed_disk.staging_storage_account_id = AAZStrType(
serialized_name="stagingStorageAccountId",
flags={"required": True},
)
disc_storage_account = _schema_data_account_details_read.discriminate_by("data_account_type", "StorageAccount")
disc_storage_account.storage_account_id = AAZStrType(
serialized_name="storageAccountId",
flags={"required": True},
)
_schema.data_account_type = cls._schema_data_account_details_read.data_account_type
_schema.discriminate_by(
"data_account_type",
"ManagedDisk",
cls._schema_data_account_details_read.discriminate_by(
"data_account_type",
"ManagedDisk",
)
)
_schema.discriminate_by(
"data_account_type",
"StorageAccount",
cls._schema_data_account_details_read.discriminate_by(
"data_account_type",
"StorageAccount",
)
)
_schema_package_shipping_details_read = None
@classmethod
def _build_schema_package_shipping_details_read(cls, _schema):
if cls._schema_package_shipping_details_read is not None:
_schema.carrier_name = cls._schema_package_shipping_details_read.carrier_name
_schema.tracking_id = cls._schema_package_shipping_details_read.tracking_id
_schema.tracking_url = cls._schema_package_shipping_details_read.tracking_url
return
cls._schema_package_shipping_details_read = _schema_package_shipping_details_read = AAZObjectType()
package_shipping_details_read = _schema_package_shipping_details_read
package_shipping_details_read.carrier_name = AAZStrType(
serialized_name="carrierName",
flags={"read_only": True},
)
package_shipping_details_read.tracking_id = AAZStrType(
serialized_name="trackingId",
flags={"read_only": True},
)
package_shipping_details_read.tracking_url = AAZStrType(
serialized_name="trackingUrl",
flags={"read_only": True},
)
_schema.carrier_name = cls._schema_package_shipping_details_read.carrier_name
_schema.tracking_id = cls._schema_package_shipping_details_read.tracking_id
_schema.tracking_url = cls._schema_package_shipping_details_read.tracking_url
_schema_shipping_address_read = None
@classmethod
def _build_schema_shipping_address_read(cls, _schema):
if cls._schema_shipping_address_read is not None:
_schema.address_type = cls._schema_shipping_address_read.address_type
_schema.city = cls._schema_shipping_address_read.city
_schema.company_name = cls._schema_shipping_address_read.company_name
_schema.country = cls._schema_shipping_address_read.country
_schema.postal_code = cls._schema_shipping_address_read.postal_code
_schema.skip_address_validation = cls._schema_shipping_address_read.skip_address_validation
_schema.state_or_province = cls._schema_shipping_address_read.state_or_province
_schema.street_address1 = cls._schema_shipping_address_read.street_address1
_schema.street_address2 = cls._schema_shipping_address_read.street_address2
_schema.street_address3 = cls._schema_shipping_address_read.street_address3
_schema.tax_identification_number = cls._schema_shipping_address_read.tax_identification_number
_schema.zip_extended_code = cls._schema_shipping_address_read.zip_extended_code
return
cls._schema_shipping_address_read = _schema_shipping_address_read = AAZObjectType()
shipping_address_read = _schema_shipping_address_read
shipping_address_read.address_type = AAZStrType(
serialized_name="addressType",
)
shipping_address_read.city = AAZStrType()
shipping_address_read.company_name = AAZStrType(
serialized_name="companyName",
)
shipping_address_read.country = AAZStrType(
flags={"required": True},
)
shipping_address_read.postal_code = AAZStrType(
serialized_name="postalCode",
)
shipping_address_read.skip_address_validation = AAZBoolType(
serialized_name="skipAddressValidation",
)
shipping_address_read.state_or_province = AAZStrType(
serialized_name="stateOrProvince",
)
shipping_address_read.street_address1 = AAZStrType(
serialized_name="streetAddress1",
flags={"required": True},
)
shipping_address_read.street_address2 = AAZStrType(
serialized_name="streetAddress2",
)
shipping_address_read.street_address3 = AAZStrType(
serialized_name="streetAddress3",
)
shipping_address_read.tax_identification_number = AAZStrType(
serialized_name="taxIdentificationNumber",
)
shipping_address_read.zip_extended_code = AAZStrType(
serialized_name="zipExtendedCode",
)
_schema.address_type = cls._schema_shipping_address_read.address_type
_schema.city = cls._schema_shipping_address_read.city
_schema.company_name = cls._schema_shipping_address_read.company_name
_schema.country = cls._schema_shipping_address_read.country
_schema.postal_code = cls._schema_shipping_address_read.postal_code
_schema.skip_address_validation = cls._schema_shipping_address_read.skip_address_validation
_schema.state_or_province = cls._schema_shipping_address_read.state_or_province
_schema.street_address1 = cls._schema_shipping_address_read.street_address1
_schema.street_address2 = cls._schema_shipping_address_read.street_address2
_schema.street_address3 = cls._schema_shipping_address_read.street_address3
_schema.tax_identification_number = cls._schema_shipping_address_read.tax_identification_number
_schema.zip_extended_code = cls._schema_shipping_address_read.zip_extended_code
_schema_transport_preferences_read = None
@classmethod
def _build_schema_transport_preferences_read(cls, _schema):
if cls._schema_transport_preferences_read is not None:
_schema.is_updated = cls._schema_transport_preferences_read.is_updated
_schema.preferred_shipment_type = cls._schema_transport_preferences_read.preferred_shipment_type
return
cls._schema_transport_preferences_read = _schema_transport_preferences_read = AAZObjectType()
transport_preferences_read = _schema_transport_preferences_read
transport_preferences_read.is_updated = AAZBoolType(
serialized_name="isUpdated",
flags={"read_only": True},
)
transport_preferences_read.preferred_shipment_type = AAZStrType(
serialized_name="preferredShipmentType",
flags={"required": True},
)
_schema.is_updated = cls._schema_transport_preferences_read.is_updated
_schema.preferred_shipment_type = cls._schema_transport_preferences_read.preferred_shipment_type
|
class _ListHelper:
'''Helper class for List'''
@classmethod
def _build_schema_cloud_error_read(cls, _schema):
pass
@classmethod
def _build_schema_copy_progress_read(cls, _schema):
pass
@classmethod
def _build_schema_data_account_details_read(cls, _schema):
pass
@classmethod
def _build_schema_package_shipping_details_read(cls, _schema):
pass
@classmethod
def _build_schema_shipping_address_read(cls, _schema):
pass
@classmethod
def _build_schema_transport_preferences_read(cls, _schema):
pass
| 13 | 1 | 54 | 4 | 50 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 6 | 349 | 36 | 312 | 37 | 299 | 1 | 176 | 25 | 169 | 2 | 0 | 1 | 12 |
8,408 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.AvailableOperations
|
class AvailableOperations(_serialization.Model):
"""Available operations of the service.
:ivar value: Collection of available operation details.
:vartype value: list[~azure.mgmt.appplatform.v2023_12_01.models.OperationDetail]
:ivar next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:vartype next_link: str
"""
_attribute_map = {
"value": {"key": "value", "type": "[OperationDetail]"},
"next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
self, *, value: Optional[List["_models.OperationDetail"]] = None, next_link: Optional[str] = None, **kwargs: Any
) -> None:
"""
:keyword value: Collection of available operation details.
:paramtype value: list[~azure.mgmt.appplatform.v2023_12_01.models.OperationDetail]
:keyword next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:paramtype next_link: str
"""
super().__init__(**kwargs)
self.value = value
self.next_link = next_link
|
class AvailableOperations(_serialization.Model):
'''Available operations of the service.
:ivar value: Collection of available operation details.
:vartype value: list[~azure.mgmt.appplatform.v2023_12_01.models.OperationDetail]
:ivar next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:vartype next_link: str
'''
def __init__(
self, *, value: Optional[List["_models.OperationDetail"]] = None, next_link: Optional[str] = None, **kwargs: Any
) -> None:
'''
:keyword value: Collection of available operation details.
:paramtype value: list[~azure.mgmt.appplatform.v2023_12_01.models.OperationDetail]
:keyword next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:paramtype next_link: str
'''
pass
| 2 | 2 | 13 | 0 | 6 | 7 | 1 | 1.27 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 16 | 28 | 3 | 11 | 7 | 7 | 14 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
8,409 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApplicationLiveViewResourceCollection
|
class ApplicationLiveViewResourceCollection(_serialization.Model):
"""Object that includes an array of Application Live View resources and a possible link for next
set.
:ivar value: Collection of Application Live View resources.
:vartype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewResource]
:ivar next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:vartype next_link: str
"""
_attribute_map = {
"value": {"key": "value", "type": "[ApplicationLiveViewResource]"},
"next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
self,
*,
value: Optional[List["_models.ApplicationLiveViewResource"]] = None,
next_link: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword value: Collection of Application Live View resources.
:paramtype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewResource]
:keyword next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:paramtype next_link: str
"""
super().__init__(**kwargs)
self.value = value
self.next_link = next_link
|
class ApplicationLiveViewResourceCollection(_serialization.Model):
'''Object that includes an array of Application Live View resources and a possible link for next
set.
:ivar value: Collection of Application Live View resources.
:vartype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewResource]
:ivar next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:vartype next_link: str
'''
def __init__(
self,
*,
value: Optional[List["_models.ApplicationLiveViewResource"]] = None,
next_link: Optional[str] = None,
**kwargs: Any
) -> None:
'''
:keyword value: Collection of Application Live View resources.
:paramtype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewResource]
:keyword next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:paramtype next_link: str
'''
pass
| 2 | 2 | 17 | 0 | 10 | 7 | 1 | 1 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 16 | 33 | 3 | 15 | 11 | 7 | 15 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
8,410 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApplicationLiveViewResource
|
class ApplicationLiveViewResource(ProxyResource):
"""Application Live View resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource Id for the resource.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource.
:vartype type: str
:ivar system_data: Metadata pertaining to creation and last modification of the resource.
:vartype system_data: ~azure.mgmt.appplatform.v2023_12_01.models.SystemData
:ivar properties: Application Live View properties payload.
:vartype properties: ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewProperties
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"properties": {"key": "properties", "type": "ApplicationLiveViewProperties"},
}
def __init__(self, *, properties: Optional["_models.ApplicationLiveViewProperties"] = None, **kwargs: Any) -> None:
"""
:keyword properties: Application Live View properties payload.
:paramtype properties: ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewProperties
"""
super().__init__(**kwargs)
self.properties = properties
|
class ApplicationLiveViewResource(ProxyResource):
'''Application Live View resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource Id for the resource.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource.
:vartype type: str
:ivar system_data: Metadata pertaining to creation and last modification of the resource.
:vartype system_data: ~azure.mgmt.appplatform.v2023_12_01.models.SystemData
:ivar properties: Application Live View properties payload.
:vartype properties: ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewProperties
'''
def __init__(self, *, properties: Optional["_models.ApplicationLiveViewProperties"] = None, **kwargs: Any) -> None:
'''
:keyword properties: Application Live View properties payload.
:paramtype properties: ~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewProperties
'''
pass
| 2 | 2 | 7 | 0 | 3 | 4 | 1 | 1 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 17 | 39 | 5 | 17 | 5 | 15 | 17 | 6 | 5 | 4 | 1 | 4 | 0 | 1 |
8,411 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_app_platform_management_client_enums.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._app_platform_management_client_enums.BindingType
|
class BindingType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Buildpack Binding Type."""
APPLICATION_INSIGHTS = "ApplicationInsights"
APACHE_SKY_WALKING = "ApacheSkyWalking"
APP_DYNAMICS = "AppDynamics"
DYNATRACE = "Dynatrace"
NEW_RELIC = "NewRelic"
ELASTIC_APM = "ElasticAPM"
|
class BindingType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
'''Buildpack Binding Type.'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.14 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 9 | 1 | 7 | 7 | 6 | 1 | 7 | 7 | 6 | 0 | 4 | 0 | 0 |
8,412 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_storages_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._storages_operations.StoragesOperations
|
class StoragesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`storages` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any
) -> _models.StorageResource:
"""Get the storage resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param storage_name: The name of the storage resource. Required.
:type storage_name: str
:return: StorageResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.StorageResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
storage_name=storage_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("StorageResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
storage_name: str,
storage_resource: Union[_models.StorageResource, IO[bytes]],
**kwargs: Any
) -> _models.StorageResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(storage_resource, (IOBase, bytes)):
_content = storage_resource
else:
_json = self._serialize.body(storage_resource, "StorageResource")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
storage_name=storage_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("StorageResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("StorageResource", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("StorageResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
storage_name: str,
storage_resource: _models.StorageResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.StorageResource]:
"""Create or update storage resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param storage_name: The name of the storage resource. Required.
:type storage_name: str
:param storage_resource: Parameters for the create or update operation. Required.
:type storage_resource: ~azure.mgmt.appplatform.v2023_12_01.models.StorageResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either StorageResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.StorageResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
storage_name: str,
storage_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.StorageResource]:
"""Create or update storage resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param storage_name: The name of the storage resource. Required.
:type storage_name: str
:param storage_resource: Parameters for the create or update operation. Required.
:type storage_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either StorageResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.StorageResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
storage_name: str,
storage_resource: Union[_models.StorageResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.StorageResource]:
"""Create or update storage resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param storage_name: The name of the storage resource. Required.
:type storage_name: str
:param storage_resource: Parameters for the create or update operation. Is either a
StorageResource type or a IO[bytes] type. Required.
:type storage_resource: ~azure.mgmt.appplatform.v2023_12_01.models.StorageResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either StorageResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.StorageResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.StorageResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
storage_name=storage_name,
storage_resource=storage_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("StorageResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.StorageResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.StorageResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
storage_name=storage_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Delete the storage resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param storage_name: The name of the storage resource. Required.
:type storage_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
storage_name=storage_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.StorageResource"]:
"""List all the storages of one Azure Spring Apps resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either StorageResource or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.StorageResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.StorageResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("StorageResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
|
class StoragesOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`storages` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any
) -> _models.StorageResource:
'''Get the storage resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param storage_name: The name of the storage resource. Required.
:type storage_name: str
:return: StorageResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.StorageResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
storage_name: str,
storage_resource: Union[_models.StorageResource, IO[bytes]],
**kwargs: Any
) -> _models.StorageResource:
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
storage_name: str,
storage_resource: _models.StorageResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.StorageResource]:
'''Create or update storage resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param storage_name: The name of the storage resource. Required.
:type storage_name: str
:param storage_resource: Parameters for the create or update operation. Required.
:type storage_resource: ~azure.mgmt.appplatform.v2023_12_01.models.StorageResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either StorageResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.StorageResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
storage_name: str,
storage_resource: _models.StorageResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.StorageResource]:
'''Create or update storage resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param storage_name: The name of the storage resource. Required.
:type storage_name: str
:param storage_resource: Parameters for the create or update operation. Required.
:type storage_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either StorageResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.StorageResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
storage_name: str,
storage_resource: _models.StorageResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.StorageResource]:
'''Create or update storage resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param storage_name: The name of the storage resource. Required.
:type storage_name: str
:param storage_resource: Parameters for the create or update operation. Is either a
StorageResource type or a IO[bytes] type. Required.
:type storage_resource: ~azure.mgmt.appplatform.v2023_12_01.models.StorageResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either StorageResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.StorageResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Delete the storage resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param storage_name: The name of the storage resource. Required.
:type storage_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.StorageResource"]:
'''List all the storages of one Azure Spring Apps resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either StorageResource or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.StorageResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
| 21 | 7 | 36 | 4 | 26 | 8 | 3 | 0.37 | 0 | 7 | 0 | 0 | 9 | 5 | 9 | 9 | 475 | 62 | 315 | 134 | 254 | 115 | 162 | 88 | 147 | 7 | 0 | 1 | 42 |
8,413 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_skus_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._skus_operations.SkusOperations
|
class SkusOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`skus` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]:
"""Lists all of the available skus of the Microsoft.AppPlatform provider.
:return: An iterator like instance of either ResourceSku or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ResourceSku]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ResourceSkuCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("ResourceSkuCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
|
class SkusOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`skus` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]:
'''Lists all of the available skus of the Microsoft.AppPlatform provider.
:return: An iterator like instance of either ResourceSku or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ResourceSku]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
| 7 | 2 | 26 | 3 | 21 | 2 | 3 | 0.24 | 0 | 3 | 0 | 0 | 2 | 5 | 2 | 2 | 96 | 16 | 66 | 28 | 59 | 16 | 45 | 27 | 39 | 6 | 0 | 1 | 13 |
8,414 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_services_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._services_operations.ServicesOperations
|
class ServicesOperations: # pylint: disable=too-many-public-methods
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`services` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.ServiceResource:
"""Get a Service and its properties.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: ServiceResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("ServiceResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
resource: Union[_models.ServiceResource, IO[bytes]],
**kwargs: Any
) -> _models.ServiceResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(resource, (IOBase, bytes)):
_content = resource
else:
_json = self._serialize.body(resource, "ServiceResource")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("ServiceResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("ServiceResource", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("ServiceResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ServiceResource]:
"""Create a new Service or update an exiting Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the create or update operation. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ServiceResource]:
"""Create a new Service or update an exiting Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the create or update operation. Required.
:type resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
resource: Union[_models.ServiceResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.ServiceResource]:
"""Create a new Service or update an exiting Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the create or update operation. Is either a ServiceResource
type or a IO[bytes] type. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
resource=resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ServiceResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.ServiceResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.ServiceResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
"""Operation to delete a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _update_initial(
self,
resource_group_name: str,
service_name: str,
resource: Union[_models.ServiceResource, IO[bytes]],
**kwargs: Any
) -> _models.ServiceResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(resource, (IOBase, bytes)):
_content = resource
else:
_json = self._serialize.body(resource, "ServiceResource")
_request = build_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("ServiceResource", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("ServiceResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ServiceResource]:
"""Operation to update an exiting Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the update operation. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_update(
self,
resource_group_name: str,
service_name: str,
resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ServiceResource]:
"""Operation to update an exiting Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the update operation. Required.
:type resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_update(
self,
resource_group_name: str,
service_name: str,
resource: Union[_models.ServiceResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.ServiceResource]:
"""Operation to update an exiting Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the update operation. Is either a ServiceResource type or a
IO[bytes] type. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
resource=resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ServiceResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.ServiceResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.ServiceResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
@distributed_trace_async
async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys:
"""List test keys for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None)
_request = build_list_test_keys_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("TestKeys", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def regenerate_test_key(
self,
resource_group_name: str,
service_name: str,
regenerate_test_key_request: _models.RegenerateTestKeyRequestPayload,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.TestKeys:
"""Regenerate a test key for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param regenerate_test_key_request: Parameters for the operation. Required.
:type regenerate_test_key_request:
~azure.mgmt.appplatform.v2023_12_01.models.RegenerateTestKeyRequestPayload
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def regenerate_test_key(
self,
resource_group_name: str,
service_name: str,
regenerate_test_key_request: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.TestKeys:
"""Regenerate a test key for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param regenerate_test_key_request: Parameters for the operation. Required.
:type regenerate_test_key_request: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def regenerate_test_key(
self,
resource_group_name: str,
service_name: str,
regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]],
**kwargs: Any
) -> _models.TestKeys:
"""Regenerate a test key for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param regenerate_test_key_request: Parameters for the operation. Is either a
RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required.
:type regenerate_test_key_request:
~azure.mgmt.appplatform.v2023_12_01.models.RegenerateTestKeyRequestPayload or IO[bytes]
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(regenerate_test_key_request, (IOBase, bytes)):
_content = regenerate_test_key_request
else:
_json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload")
_request = build_regenerate_test_key_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("TestKeys", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace_async
async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
"""Disable test endpoint functionality for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_disable_test_endpoint_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def enable_test_endpoint(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> _models.TestKeys:
"""Enable test endpoint functionality for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None)
_request = build_enable_test_endpoint_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("TestKeys", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _stop_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
304: ResourceNotModifiedError,
404: lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat),
409: lambda response: ResourceExistsError(response=response, error_format=ARMErrorFormat),
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_stop_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202]:
map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
"""Stop a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._stop_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _start_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
304: ResourceNotModifiedError,
404: lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat),
409: lambda response: ResourceExistsError(response=response, error_format=ARMErrorFormat),
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_start_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202]:
map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
"""Start a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._start_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_flush_vnet_dns_setting_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@distributed_trace_async
async def begin_flush_vnet_dns_setting(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Flush Virtual Network DNS settings for a VNET injected Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._flush_vnet_dns_setting_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
)
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
@distributed_trace
def list_supported_apm_types(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.SupportedApmType"]:
"""List supported APM types for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either SupportedApmType or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.SupportedApmType]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.SupportedApmTypes] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_supported_apm_types_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("SupportedApmTypes", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace_async
async def list_globally_enabled_apms(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> _models.GloballyEnabledApms:
"""List globally enabled APMs for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: GloballyEnabledApms or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GloballyEnabledApms
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None)
_request = build_list_globally_enabled_apms_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("GloballyEnabledApms", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(apm, (IOBase, bytes)):
_content = apm
else:
_json = self._serialize.body(apm, "ApmReference")
_request = build_enable_apm_globally_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@overload
async def begin_enable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Enable an APM globally.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the enable operation. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_enable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Enable an APM globally.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the enable operation. Required.
:type apm: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_enable_apm_globally(
self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[None]:
"""Enable an APM globally.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the enable operation. Is either a ApmReference type or a
IO[bytes] type. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO[bytes]
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._enable_apm_globally_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
apm=apm,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(
AsyncPollingMethod,
AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs),
)
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(apm, (IOBase, bytes)):
_content = apm
else:
_json = self._serialize.body(apm, "ApmReference")
_request = build_disable_apm_globally_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@overload
async def begin_disable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Disable an APM globally.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the disable operation. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_disable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Disable an APM globally.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the disable operation. Required.
:type apm: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_disable_apm_globally(
self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[None]:
"""Disable an APM globally.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the disable operation. Is either a ApmReference type or a
IO[bytes] type. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO[bytes]
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._disable_apm_globally_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
apm=apm,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(
AsyncPollingMethod,
AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs),
)
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
@overload
async def check_name_availability(
self,
location: str,
availability_parameters: _models.NameAvailabilityParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.NameAvailability:
"""Checks that the resource name is valid and is not already in use.
:param location: the region. Required.
:type location: str
:param availability_parameters: Parameters supplied to the operation. Required.
:type availability_parameters:
~azure.mgmt.appplatform.v2023_12_01.models.NameAvailabilityParameters
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: NameAvailability or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def check_name_availability(
self,
location: str,
availability_parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.NameAvailability:
"""Checks that the resource name is valid and is not already in use.
:param location: the region. Required.
:type location: str
:param availability_parameters: Parameters supplied to the operation. Required.
:type availability_parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: NameAvailability or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def check_name_availability(
self,
location: str,
availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]],
**kwargs: Any
) -> _models.NameAvailability:
"""Checks that the resource name is valid and is not already in use.
:param location: the region. Required.
:type location: str
:param availability_parameters: Parameters supplied to the operation. Is either a
NameAvailabilityParameters type or a IO[bytes] type. Required.
:type availability_parameters:
~azure.mgmt.appplatform.v2023_12_01.models.NameAvailabilityParameters or IO[bytes]
:return: NameAvailability or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.NameAvailability] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(availability_parameters, (IOBase, bytes)):
_content = availability_parameters
else:
_json = self._serialize.body(availability_parameters, "NameAvailabilityParameters")
_request = build_check_name_availability_request(
location=location,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("NameAvailability", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace
def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]:
"""Handles requests to list all resources in a subscription.
:return: An iterator like instance of either ServiceResource or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_by_subscription_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("ServiceResourceList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace
def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]:
"""Handles requests to list all resources in a resource group.
: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. Required.
:type resource_group_name: str
:return: An iterator like instance of either ServiceResource or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("ServiceResourceList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace
def list_supported_server_versions(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.SupportedServerVersion"]:
"""Lists all of the available server versions supported by Microsoft.AppPlatform provider.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either SupportedServerVersion or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.SupportedServerVersion]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.SupportedServerVersions] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_supported_server_versions_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("SupportedServerVersions", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
|
class ServicesOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`services` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace_async
async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.ServiceResource:
'''Get a Service and its properties.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: ServiceResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
resource: Union[_models.ServiceResource, IO[bytes]],
**kwargs: Any
) -> _models.ServiceResource:
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ServiceResource]:
'''Create a new Service or update an exiting Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the create or update operation. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ServiceResource]:
'''Create a new Service or update an exiting Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the create or update operation. Required.
:type resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ServiceResource]:
'''Create a new Service or update an exiting Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the create or update operation. Is either a ServiceResource
type or a IO[bytes] type. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
'''Operation to delete a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _update_initial(
self,
resource_group_name: str,
service_name: str,
resource: Union[_models.ServiceResource, IO[bytes]],
**kwargs: Any
) -> _models.ServiceResource:
pass
@overload
async def begin_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ServiceResource]:
'''Operation to update an exiting Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the update operation. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ServiceResource]:
'''Operation to update an exiting Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the update operation. Required.
:type resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ServiceResource]:
'''Operation to update an exiting Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the update operation. Is either a ServiceResource type or a
IO[bytes] type. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@distributed_trace_async
async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys:
'''List test keys for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def regenerate_test_key(
self,
resource_group_name: str,
service_name: str,
regenerate_test_key_request: _models.RegenerateTestKeyRequestPayload,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.TestKeys:
'''Regenerate a test key for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param regenerate_test_key_request: Parameters for the operation. Required.
:type regenerate_test_key_request:
~azure.mgmt.appplatform.v2023_12_01.models.RegenerateTestKeyRequestPayload
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def regenerate_test_key(
self,
resource_group_name: str,
service_name: str,
regenerate_test_key_request: _models.RegenerateTestKeyRequestPayload,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.TestKeys:
'''Regenerate a test key for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param regenerate_test_key_request: Parameters for the operation. Required.
:type regenerate_test_key_request: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def regenerate_test_key(
self,
resource_group_name: str,
service_name: str,
regenerate_test_key_request: _models.RegenerateTestKeyRequestPayload,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.TestKeys:
'''Regenerate a test key for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param regenerate_test_key_request: Parameters for the operation. Is either a
RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required.
:type regenerate_test_key_request:
~azure.mgmt.appplatform.v2023_12_01.models.RegenerateTestKeyRequestPayload or IO[bytes]
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
'''Disable test endpoint functionality for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def enable_test_endpoint(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> _models.TestKeys:
'''Enable test endpoint functionality for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _stop_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
'''Stop a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _start_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
'''Start a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_flush_vnet_dns_setting(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Flush Virtual Network DNS settings for a VNET injected Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@distributed_trace
def list_supported_apm_types(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.SupportedApmType"]:
'''List supported APM types for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either SupportedApmType or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.SupportedApmType]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
@distributed_trace_async
async def list_globally_enabled_apms(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> _models.GloballyEnabledApms:
'''List globally enabled APMs for a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: GloballyEnabledApms or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GloballyEnabledApms
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any
) -> None:
pass
@overload
async def begin_enable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Enable an APM globally.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the enable operation. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_enable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Enable an APM globally.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the enable operation. Required.
:type apm: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_enable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Enable an APM globally.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the enable operation. Is either a ApmReference type or a
IO[bytes] type. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO[bytes]
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any
) -> None:
pass
@overload
async def begin_disable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Disable an APM globally.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the disable operation. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_disable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Disable an APM globally.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the disable operation. Required.
:type apm: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_disable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Disable an APM globally.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the disable operation. Is either a ApmReference type or a
IO[bytes] type. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO[bytes]
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@overload
async def check_name_availability(
self,
location: str,
availability_parameters: _models.NameAvailabilityParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.NameAvailability:
'''Checks that the resource name is valid and is not already in use.
:param location: the region. Required.
:type location: str
:param availability_parameters: Parameters supplied to the operation. Required.
:type availability_parameters:
~azure.mgmt.appplatform.v2023_12_01.models.NameAvailabilityParameters
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: NameAvailability or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def check_name_availability(
self,
location: str,
availability_parameters: _models.NameAvailabilityParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.NameAvailability:
'''Checks that the resource name is valid and is not already in use.
:param location: the region. Required.
:type location: str
:param availability_parameters: Parameters supplied to the operation. Required.
:type availability_parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: NameAvailability or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def check_name_availability(
self,
location: str,
availability_parameters: _models.NameAvailabilityParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.NameAvailability:
'''Checks that the resource name is valid and is not already in use.
:param location: the region. Required.
:type location: str
:param availability_parameters: Parameters supplied to the operation. Is either a
NameAvailabilityParameters type or a IO[bytes] type. Required.
:type availability_parameters:
~azure.mgmt.appplatform.v2023_12_01.models.NameAvailabilityParameters or IO[bytes]
:return: NameAvailability or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace
def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceResource"]:
'''Handles requests to list all resources in a subscription.
:return: An iterator like instance of either ServiceResource or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
@distributed_trace
async def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys:
'''Handles requests to list all resources in a resource group.
: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. Required.
:type resource_group_name: str
:return: An iterator like instance of either ServiceResource or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
@distributed_trace
def list_supported_server_versions(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.SupportedServerVersion"]:
'''Lists all of the available server versions supported by Microsoft.AppPlatform provider.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either SupportedServerVersion or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.SupportedServerVersion]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
| 92 | 32 | 36 | 4 | 25 | 8 | 3 | 0.37 | 0 | 7 | 0 | 0 | 40 | 5 | 40 | 40 | 2,009 | 274 | 1,331 | 554 | 1,082 | 488 | 685 | 366 | 624 | 7 | 0 | 1 | 160 |
8,415 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_service_registries_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._service_registries_operations.ServiceRegistriesOperations
|
class ServiceRegistriesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`service_registries` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> _models.ServiceRegistryResource:
"""Get the Service Registry and its properties.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param service_registry_name: The name of Service Registry. Required.
:type service_registry_name: str
:return: ServiceRegistryResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceRegistryResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
service_registry_name=service_registry_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("ServiceRegistryResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> _models.ServiceRegistryResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None)
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
service_registry_name=service_registry_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("ServiceRegistryResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("ServiceRegistryResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace_async
async def begin_create_or_update(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> AsyncLROPoller[_models.ServiceRegistryResource]:
"""Create the default Service Registry or update the existing Service Registry.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param service_registry_name: The name of Service Registry. Required.
:type service_registry_name: str
:return: An instance of AsyncLROPoller that returns either ServiceRegistryResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
service_registry_name=service_registry_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ServiceRegistryResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.ServiceRegistryResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.ServiceRegistryResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
service_registry_name=service_registry_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Disable the default Service Registry.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param service_registry_name: The name of Service Registry. Required.
:type service_registry_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
service_registry_name=service_registry_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.ServiceRegistryResource"]:
"""Handles requests to list all resources in a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either ServiceRegistryResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ServiceRegistryResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
|
class ServiceRegistriesOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`service_registries` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> _models.ServiceRegistryResource:
'''Get the Service Registry and its properties.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param service_registry_name: The name of Service Registry. Required.
:type service_registry_name: str
:return: ServiceRegistryResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceRegistryResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _create_or_update_initial(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> _models.ServiceRegistryResource:
pass
@distributed_trace_async
async def begin_create_or_update(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> AsyncLROPoller[_models.ServiceRegistryResource]:
'''Create the default Service Registry or update the existing Service Registry.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param service_registry_name: The name of Service Registry. Required.
:type service_registry_name: str
:return: An instance of AsyncLROPoller that returns either ServiceRegistryResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Disable the default Service Registry.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param service_registry_name: The name of Service Registry. Required.
:type service_registry_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.ServiceRegistryResource"]:
'''Handles requests to list all resources in a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either ServiceRegistryResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
| 17 | 5 | 35 | 4 | 26 | 6 | 3 | 0.28 | 0 | 4 | 0 | 0 | 7 | 5 | 7 | 7 | 381 | 56 | 267 | 98 | 238 | 75 | 150 | 82 | 137 | 6 | 0 | 1 | 38 |
8,416 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_runtime_versions_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._runtime_versions_operations.RuntimeVersionsOperations
|
class RuntimeVersionsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`runtime_versions` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions:
"""Lists all of the available runtime versions supported by Microsoft.AppPlatform provider.
:return: AvailableRuntimeVersions or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.AvailableRuntimeVersions
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None)
_request = build_list_runtime_versions_request(
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
|
class RuntimeVersionsOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`runtime_versions` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace_async
async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions:
'''Lists all of the available runtime versions supported by Microsoft.AppPlatform provider.
:return: AvailableRuntimeVersions or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.AvailableRuntimeVersions
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
| 4 | 2 | 27 | 5 | 19 | 4 | 5 | 0.37 | 0 | 3 | 0 | 0 | 2 | 5 | 2 | 2 | 67 | 14 | 41 | 21 | 37 | 15 | 29 | 20 | 26 | 6 | 0 | 1 | 9 |
8,417 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_predefined_accelerators_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._predefined_accelerators_operations.PredefinedAcceleratorsOperations
|
class PredefinedAcceleratorsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`predefined_accelerators` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any
) -> AsyncIterable["_models.PredefinedAcceleratorResource"]:
"""Handle requests to list all predefined accelerators.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:return: An iterator like instance of either PredefinedAcceleratorResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.PredefinedAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.PredefinedAcceleratorResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace_async
async def get(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> _models.PredefinedAcceleratorResource:
"""Get the predefined accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param predefined_accelerator_name: The name of the predefined accelerator. Required.
:type predefined_accelerator_name: str
:return: PredefinedAcceleratorResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.PredefinedAcceleratorResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
predefined_accelerator_name=predefined_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _disable_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_disable_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
predefined_accelerator_name=predefined_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@distributed_trace_async
async def begin_disable(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Disable predefined accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param predefined_accelerator_name: The name of the predefined accelerator. Required.
:type predefined_accelerator_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._disable_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
predefined_accelerator_name=predefined_accelerator_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _enable_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_enable_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
predefined_accelerator_name=predefined_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@distributed_trace_async
async def begin_enable(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Enable predefined accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param predefined_accelerator_name: The name of the predefined accelerator. Required.
:type predefined_accelerator_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._enable_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
predefined_accelerator_name=predefined_accelerator_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method)
|
class PredefinedAcceleratorsOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`predefined_accelerators` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any
) -> AsyncIterable["_models.PredefinedAcceleratorResource"]:
'''Handle requests to list all predefined accelerators.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:return: An iterator like instance of either PredefinedAcceleratorResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.PredefinedAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
@distributed_trace_async
async def get_next(next_link=None):
'''Get the predefined accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param predefined_accelerator_name: The name of the predefined accelerator. Required.
:type predefined_accelerator_name: str
:return: PredefinedAcceleratorResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.PredefinedAcceleratorResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _disable_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_disable(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Disable predefined accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param predefined_accelerator_name: The name of the predefined accelerator. Required.
:type predefined_accelerator_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _enable_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_enable(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Enable predefined accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param predefined_accelerator_name: The name of the predefined accelerator. Required.
:type predefined_accelerator_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
| 17 | 5 | 38 | 4 | 28 | 7 | 3 | 0.28 | 0 | 4 | 0 | 0 | 7 | 5 | 7 | 7 | 414 | 55 | 295 | 123 | 241 | 83 | 149 | 82 | 136 | 6 | 0 | 1 | 38 |
8,418 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._operations.Operations
|
class Operations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`operations` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]:
"""Lists all of the available REST API operations of the Microsoft.AppPlatform provider.
:return: An iterator like instance of either OperationDetail or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.OperationDetail]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.AvailableOperations] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("AvailableOperations", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
|
class Operations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`operations` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]:
'''Lists all of the available REST API operations of the Microsoft.AppPlatform provider.
:return: An iterator like instance of either OperationDetail or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.OperationDetail]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
| 7 | 2 | 26 | 3 | 21 | 2 | 3 | 0.25 | 0 | 3 | 0 | 0 | 2 | 5 | 2 | 2 | 95 | 16 | 65 | 28 | 58 | 16 | 45 | 27 | 39 | 6 | 0 | 1 | 13 |
8,419 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_monitoring_settings_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._monitoring_settings_operations.MonitoringSettingsOperations
|
class MonitoringSettingsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`monitoring_settings` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> _models.MonitoringSettingResource:
"""Get the Monitoring Setting and its properties.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: MonitoringSettingResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("MonitoringSettingResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _update_put_initial(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]],
**kwargs: Any
) -> _models.MonitoringSettingResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(monitoring_setting_resource, (IOBase, bytes)):
_content = monitoring_setting_resource
else:
_json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource")
_request = build_update_put_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("MonitoringSettingResource", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("MonitoringSettingResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_update_put(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: _models.MonitoringSettingResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.MonitoringSettingResource]:
"""Update the Monitoring Setting.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param monitoring_setting_resource: Parameters for the update operation. Required.
:type monitoring_setting_resource:
~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_update_put(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.MonitoringSettingResource]:
"""Update the Monitoring Setting.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param monitoring_setting_resource: Parameters for the update operation. Required.
:type monitoring_setting_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_update_put(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.MonitoringSettingResource]:
"""Update the Monitoring Setting.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param monitoring_setting_resource: Parameters for the update operation. Is either a
MonitoringSettingResource type or a IO[bytes] type. Required.
:type monitoring_setting_resource:
~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._update_put_initial(
resource_group_name=resource_group_name,
service_name=service_name,
monitoring_setting_resource=monitoring_setting_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("MonitoringSettingResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.MonitoringSettingResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _update_patch_initial(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]],
**kwargs: Any
) -> _models.MonitoringSettingResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(monitoring_setting_resource, (IOBase, bytes)):
_content = monitoring_setting_resource
else:
_json = self._serialize.body(monitoring_setting_resource, "MonitoringSettingResource")
_request = build_update_patch_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("MonitoringSettingResource", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("MonitoringSettingResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_update_patch(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: _models.MonitoringSettingResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.MonitoringSettingResource]:
"""Update the Monitoring Setting.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param monitoring_setting_resource: Parameters for the update operation. Required.
:type monitoring_setting_resource:
~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_update_patch(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.MonitoringSettingResource]:
"""Update the Monitoring Setting.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param monitoring_setting_resource: Parameters for the update operation. Required.
:type monitoring_setting_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_update_patch(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.MonitoringSettingResource]:
"""Update the Monitoring Setting.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param monitoring_setting_resource: Parameters for the update operation. Is either a
MonitoringSettingResource type or a IO[bytes] type. Required.
:type monitoring_setting_resource:
~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.MonitoringSettingResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._update_patch_initial(
resource_group_name=resource_group_name,
service_name=service_name,
monitoring_setting_resource=monitoring_setting_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("MonitoringSettingResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.MonitoringSettingResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.MonitoringSettingResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
|
class MonitoringSettingsOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`monitoring_settings` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> _models.MonitoringSettingResource:
'''Get the Monitoring Setting and its properties.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: MonitoringSettingResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _update_put_initial(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]],
**kwargs: Any
) -> _models.MonitoringSettingResource:
pass
@overload
async def begin_update_put(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: _models.MonitoringSettingResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.MonitoringSettingResource]:
'''Update the Monitoring Setting.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param monitoring_setting_resource: Parameters for the update operation. Required.
:type monitoring_setting_resource:
~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_update_put(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: _models.MonitoringSettingResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.MonitoringSettingResource]:
'''Update the Monitoring Setting.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param monitoring_setting_resource: Parameters for the update operation. Required.
:type monitoring_setting_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_update_put(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: _models.MonitoringSettingResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.MonitoringSettingResource]:
'''Update the Monitoring Setting.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param monitoring_setting_resource: Parameters for the update operation. Is either a
MonitoringSettingResource type or a IO[bytes] type. Required.
:type monitoring_setting_resource:
~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _update_patch_initial(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]],
**kwargs: Any
) -> _models.MonitoringSettingResource:
pass
@overload
async def begin_update_patch(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: _models.MonitoringSettingResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.MonitoringSettingResource]:
'''Update the Monitoring Setting.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param monitoring_setting_resource: Parameters for the update operation. Required.
:type monitoring_setting_resource:
~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_update_patch(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: _models.MonitoringSettingResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.MonitoringSettingResource]:
'''Update the Monitoring Setting.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param monitoring_setting_resource: Parameters for the update operation. Required.
:type monitoring_setting_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_update_patch(
self,
resource_group_name: str,
service_name: str,
monitoring_setting_resource: _models.MonitoringSettingResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.MonitoringSettingResource]:
'''Update the Monitoring Setting.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param monitoring_setting_resource: Parameters for the update operation. Is either a
MonitoringSettingResource type or a IO[bytes] type. Required.
:type monitoring_setting_resource:
~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either MonitoringSettingResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.MonitoringSettingResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
| 20 | 8 | 38 | 4 | 25 | 11 | 3 | 0.45 | 0 | 7 | 0 | 0 | 10 | 5 | 10 | 10 | 469 | 56 | 294 | 143 | 216 | 132 | 141 | 78 | 128 | 6 | 0 | 1 | 39 |
8,420 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_gateways_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._gateways_operations.GatewaysOperations
|
class GatewaysOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`gateways` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> _models.GatewayResource:
"""Get the Spring Cloud Gateway and its properties.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:return: GatewayResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("GatewayResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
gateway_resource: Union[_models.GatewayResource, IO[bytes]],
**kwargs: Any
) -> _models.GatewayResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(gateway_resource, (IOBase, bytes)):
_content = gateway_resource
else:
_json = self._serialize.body(gateway_resource, "GatewayResource")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("GatewayResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("GatewayResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
gateway_resource: _models.GatewayResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayResource]:
"""Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param gateway_resource: The gateway for the create or update operation. Required.
:type gateway_resource: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either GatewayResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
gateway_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayResource]:
"""Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param gateway_resource: The gateway for the create or update operation. Required.
:type gateway_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either GatewayResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
gateway_resource: Union[_models.GatewayResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayResource]:
"""Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param gateway_resource: The gateway for the create or update operation. Is either a
GatewayResource type or a IO[bytes] type. Required.
:type gateway_resource: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either GatewayResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.GatewayResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
gateway_resource=gateway_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("GatewayResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.GatewayResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.GatewayResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Disable the default Spring Cloud Gateway.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
@distributed_trace_async
async def list_env_secrets(
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> Dict[str, str]:
"""List sensitive environment variables of Spring Cloud Gateway.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:return: dict mapping str to str or the result of cls(response)
:rtype: dict[str, str]
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[Dict[str, str]] = kwargs.pop("cls", None)
_request = build_list_env_secrets_request(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("{str}", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _restart_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_restart_request(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@distributed_trace_async
async def begin_restart(
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Restart the Spring Cloud Gateway.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._restart_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
)
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.GatewayResource"]:
"""Handles requests to list all resources in a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either GatewayResource or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.GatewayResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("GatewayResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@overload
async def validate_domain(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
validate_payload: _models.CustomDomainValidatePayload,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.CustomDomainValidateResult:
"""Check the domains are valid as well as not in use.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param validate_payload: Custom domain payload to be validated. Required.
:type validate_payload: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidatePayload
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: CustomDomainValidateResult or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def validate_domain(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
validate_payload: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.CustomDomainValidateResult:
"""Check the domains are valid as well as not in use.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param validate_payload: Custom domain payload to be validated. Required.
:type validate_payload: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: CustomDomainValidateResult or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def validate_domain(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
validate_payload: Union[_models.CustomDomainValidatePayload, IO[bytes]],
**kwargs: Any
) -> _models.CustomDomainValidateResult:
"""Check the domains are valid as well as not in use.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param validate_payload: Custom domain payload to be validated. Is either a
CustomDomainValidatePayload type or a IO[bytes] type. Required.
:type validate_payload: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidatePayload
or IO[bytes]
:return: CustomDomainValidateResult or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.CustomDomainValidateResult] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(validate_payload, (IOBase, bytes)):
_content = validate_payload
else:
_json = self._serialize.body(validate_payload, "CustomDomainValidatePayload")
_request = build_validate_domain_request(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("CustomDomainValidateResult", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
|
class GatewaysOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`gateways` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> _models.GatewayResource:
'''Get the Spring Cloud Gateway and its properties.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:return: GatewayResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
gateway_resource: Union[_models.GatewayResource, IO[bytes]],
**kwargs: Any
) -> _models.GatewayResource:
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
gateway_resource: _models.GatewayResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayResource]:
'''Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param gateway_resource: The gateway for the create or update operation. Required.
:type gateway_resource: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either GatewayResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
gateway_resource: _models.GatewayResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayResource]:
'''Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param gateway_resource: The gateway for the create or update operation. Required.
:type gateway_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either GatewayResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
gateway_resource: _models.GatewayResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayResource]:
'''Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param gateway_resource: The gateway for the create or update operation. Is either a
GatewayResource type or a IO[bytes] type. Required.
:type gateway_resource: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either GatewayResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Disable the default Spring Cloud Gateway.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@distributed_trace_async
async def list_env_secrets(
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> Dict[str, str]:
'''List sensitive environment variables of Spring Cloud Gateway.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:return: dict mapping str to str or the result of cls(response)
:rtype: dict[str, str]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _restart_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_restart(
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Restart the Spring Cloud Gateway.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@distributed_trace
async def list_env_secrets(
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> Dict[str, str]:
'''Handles requests to list all resources in a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either GatewayResource or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.GatewayResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
@overload
async def validate_domain(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
validate_payload: _models.CustomDomainValidatePayload,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.CustomDomainValidateResult:
'''Check the domains are valid as well as not in use.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param validate_payload: Custom domain payload to be validated. Required.
:type validate_payload: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidatePayload
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: CustomDomainValidateResult or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def validate_domain(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
validate_payload: _models.CustomDomainValidatePayload,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.CustomDomainValidateResult:
'''Check the domains are valid as well as not in use.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param validate_payload: Custom domain payload to be validated. Required.
:type validate_payload: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: CustomDomainValidateResult or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def validate_domain(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
validate_payload: _models.CustomDomainValidatePayload,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.CustomDomainValidateResult:
'''Check the domains are valid as well as not in use.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param validate_payload: Custom domain payload to be validated. Is either a
CustomDomainValidatePayload type or a IO[bytes] type. Required.
:type validate_payload: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidatePayload
or IO[bytes]
:return: CustomDomainValidateResult or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
| 33 | 12 | 38 | 4 | 26 | 10 | 3 | 0.4 | 0 | 7 | 0 | 0 | 15 | 5 | 15 | 15 | 781 | 102 | 507 | 219 | 403 | 202 | 251 | 137 | 229 | 6 | 0 | 1 | 61 |
8,421 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_gateway_route_configs_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._gateway_route_configs_operations.GatewayRouteConfigsOperations
|
class GatewayRouteConfigsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`gateway_route_configs` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any
) -> _models.GatewayRouteConfigResource:
"""Get the Spring Cloud Gateway route configs.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param route_config_name: The name of the Spring Cloud Gateway route config. Required.
:type route_config_name: str
:return: GatewayRouteConfigResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
route_config_name=route_config_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
route_config_name: str,
gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]],
**kwargs: Any
) -> _models.GatewayRouteConfigResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(gateway_route_config_resource, (IOBase, bytes)):
_content = gateway_route_config_resource
else:
_json = self._serialize.body(gateway_route_config_resource, "GatewayRouteConfigResource")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
route_config_name=route_config_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
route_config_name: str,
gateway_route_config_resource: _models.GatewayRouteConfigResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayRouteConfigResource]:
"""Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud
Gateway route configs.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param route_config_name: The name of the Spring Cloud Gateway route config. Required.
:type route_config_name: str
:param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or
update operation. Required.
:type gateway_route_config_resource:
~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
route_config_name: str,
gateway_route_config_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayRouteConfigResource]:
"""Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud
Gateway route configs.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param route_config_name: The name of the Spring Cloud Gateway route config. Required.
:type route_config_name: str
:param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or
update operation. Required.
:type gateway_route_config_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
route_config_name: str,
gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayRouteConfigResource]:
"""Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud
Gateway route configs.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param route_config_name: The name of the Spring Cloud Gateway route config. Required.
:type route_config_name: str
:param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or
update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required.
:type gateway_route_config_resource:
~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.GatewayRouteConfigResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
route_config_name=route_config_name,
gateway_route_config_resource=gateway_route_config_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("GatewayRouteConfigResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.GatewayRouteConfigResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.GatewayRouteConfigResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
route_config_name=route_config_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Delete the Spring Cloud Gateway route config.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param route_config_name: The name of the Spring Cloud Gateway route config. Required.
:type route_config_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
route_config_name=route_config_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> AsyncIterable["_models.GatewayRouteConfigResource"]:
"""Handle requests to list all Spring Cloud Gateway route configs.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:return: An iterator like instance of either GatewayRouteConfigResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.GatewayRouteConfigResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("GatewayRouteConfigResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
|
class GatewayRouteConfigsOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`gateway_route_configs` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any
) -> _models.GatewayRouteConfigResource:
'''Get the Spring Cloud Gateway route configs.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param route_config_name: The name of the Spring Cloud Gateway route config. Required.
:type route_config_name: str
:return: GatewayRouteConfigResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
route_config_name: str,
gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]],
**kwargs: Any
) -> _models.GatewayRouteConfigResource:
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
route_config_name: str,
gateway_route_config_resource: _models.GatewayRouteConfigResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayRouteConfigResource]:
'''Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud
Gateway route configs.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param route_config_name: The name of the Spring Cloud Gateway route config. Required.
:type route_config_name: str
:param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or
update operation. Required.
:type gateway_route_config_resource:
~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
route_config_name: str,
gateway_route_config_resource: _models.GatewayRouteConfigResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayRouteConfigResource]:
'''Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud
Gateway route configs.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param route_config_name: The name of the Spring Cloud Gateway route config. Required.
:type route_config_name: str
:param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or
update operation. Required.
:type gateway_route_config_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
route_config_name: str,
gateway_route_config_resource: _models.GatewayRouteConfigResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayRouteConfigResource]:
'''Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud
Gateway route configs.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param route_config_name: The name of the Spring Cloud Gateway route config. Required.
:type route_config_name: str
:param gateway_route_config_resource: The Spring Cloud Gateway route config for the create or
update operation. Is either a GatewayRouteConfigResource type or a IO[bytes] type. Required.
:type gateway_route_config_resource:
~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either GatewayRouteConfigResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Delete the Spring Cloud Gateway route config.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param route_config_name: The name of the Spring Cloud Gateway route config. Required.
:type route_config_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> AsyncIterable["_models.GatewayRouteConfigResource"]:
'''Handle requests to list all Spring Cloud Gateway route configs.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:return: An iterator like instance of either GatewayRouteConfigResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.GatewayRouteConfigResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
| 21 | 7 | 38 | 4 | 26 | 10 | 3 | 0.42 | 0 | 7 | 0 | 0 | 9 | 5 | 9 | 9 | 502 | 61 | 323 | 138 | 258 | 135 | 160 | 88 | 145 | 6 | 0 | 1 | 41 |
8,422 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_gateway_custom_domains_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._gateway_custom_domains_operations.GatewayCustomDomainsOperations
|
class GatewayCustomDomainsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`gateway_custom_domains` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any
) -> _models.GatewayCustomDomainResource:
"""Get the Spring Cloud Gateway custom domain.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param domain_name: The name of the Spring Cloud Gateway custom domain. Required.
:type domain_name: str
:return: GatewayCustomDomainResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
domain_name=domain_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
domain_name: str,
gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]],
**kwargs: Any
) -> _models.GatewayCustomDomainResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(gateway_custom_domain_resource, (IOBase, bytes)):
_content = gateway_custom_domain_resource
else:
_json = self._serialize.body(gateway_custom_domain_resource, "GatewayCustomDomainResource")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
domain_name=domain_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
domain_name: str,
gateway_custom_domain_resource: _models.GatewayCustomDomainResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayCustomDomainResource]:
"""Create or update the Spring Cloud Gateway custom domain.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param domain_name: The name of the Spring Cloud Gateway custom domain. Required.
:type domain_name: str
:param gateway_custom_domain_resource: The gateway custom domain resource for the create or
update operation. Required.
:type gateway_custom_domain_resource:
~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
domain_name: str,
gateway_custom_domain_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayCustomDomainResource]:
"""Create or update the Spring Cloud Gateway custom domain.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param domain_name: The name of the Spring Cloud Gateway custom domain. Required.
:type domain_name: str
:param gateway_custom_domain_resource: The gateway custom domain resource for the create or
update operation. Required.
:type gateway_custom_domain_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
domain_name: str,
gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayCustomDomainResource]:
"""Create or update the Spring Cloud Gateway custom domain.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param domain_name: The name of the Spring Cloud Gateway custom domain. Required.
:type domain_name: str
:param gateway_custom_domain_resource: The gateway custom domain resource for the create or
update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required.
:type gateway_custom_domain_resource:
~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.GatewayCustomDomainResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
domain_name=domain_name,
gateway_custom_domain_resource=gateway_custom_domain_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("GatewayCustomDomainResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.GatewayCustomDomainResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.GatewayCustomDomainResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
domain_name=domain_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Delete the Spring Cloud Gateway custom domain.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param domain_name: The name of the Spring Cloud Gateway custom domain. Required.
:type domain_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
domain_name=domain_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> AsyncIterable["_models.GatewayCustomDomainResource"]:
"""Handle requests to list all Spring Cloud Gateway custom domains.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:return: An iterator like instance of either GatewayCustomDomainResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.GatewayCustomDomainResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
gateway_name=gateway_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("GatewayCustomDomainResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
|
class GatewayCustomDomainsOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`gateway_custom_domains` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any
) -> _models.GatewayCustomDomainResource:
'''Get the Spring Cloud Gateway custom domain.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param domain_name: The name of the Spring Cloud Gateway custom domain. Required.
:type domain_name: str
:return: GatewayCustomDomainResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
domain_name: str,
gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]],
**kwargs: Any
) -> _models.GatewayCustomDomainResource:
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
domain_name: str,
gateway_custom_domain_resource: _models.GatewayCustomDomainResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayCustomDomainResource]:
'''Create or update the Spring Cloud Gateway custom domain.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param domain_name: The name of the Spring Cloud Gateway custom domain. Required.
:type domain_name: str
:param gateway_custom_domain_resource: The gateway custom domain resource for the create or
update operation. Required.
:type gateway_custom_domain_resource:
~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
domain_name: str,
gateway_custom_domain_resource: _models.GatewayCustomDomainResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayCustomDomainResource]:
'''Create or update the Spring Cloud Gateway custom domain.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param domain_name: The name of the Spring Cloud Gateway custom domain. Required.
:type domain_name: str
:param gateway_custom_domain_resource: The gateway custom domain resource for the create or
update operation. Required.
:type gateway_custom_domain_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
gateway_name: str,
domain_name: str,
gateway_custom_domain_resource: _models.GatewayCustomDomainResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GatewayCustomDomainResource]:
'''Create or update the Spring Cloud Gateway custom domain.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param domain_name: The name of the Spring Cloud Gateway custom domain. Required.
:type domain_name: str
:param gateway_custom_domain_resource: The gateway custom domain resource for the create or
update operation. Is either a GatewayCustomDomainResource type or a IO[bytes] type. Required.
:type gateway_custom_domain_resource:
~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either GatewayCustomDomainResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Delete the Spring Cloud Gateway custom domain.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:param domain_name: The name of the Spring Cloud Gateway custom domain. Required.
:type domain_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any
) -> AsyncIterable["_models.GatewayCustomDomainResource"]:
'''Handle requests to list all Spring Cloud Gateway custom domains.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param gateway_name: The name of Spring Cloud Gateway. Required.
:type gateway_name: str
:return: An iterator like instance of either GatewayCustomDomainResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.GatewayCustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
| 21 | 7 | 38 | 4 | 26 | 9 | 3 | 0.41 | 0 | 7 | 0 | 0 | 9 | 5 | 9 | 9 | 499 | 61 | 323 | 138 | 258 | 132 | 160 | 88 | 145 | 6 | 0 | 1 | 41 |
8,423 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_dev_tool_portals_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._dev_tool_portals_operations.DevToolPortalsOperations
|
class DevToolPortalsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`dev_tool_portals` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.DevToolPortalResource"]:
"""Handles requests to list all resources in a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either DevToolPortalResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.DevToolPortalResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("DevToolPortalResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any
) -> _models.DevToolPortalResource:
"""Get the Application Live and its properties.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param dev_tool_portal_name: The name of Dev Tool Portal. Required.
:type dev_tool_portal_name: str
:return: DevToolPortalResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
dev_tool_portal_name=dev_tool_portal_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("DevToolPortalResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
dev_tool_portal_name: str,
dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]],
**kwargs: Any
) -> _models.DevToolPortalResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(dev_tool_portal_resource, (IOBase, bytes)):
_content = dev_tool_portal_resource
else:
_json = self._serialize.body(dev_tool_portal_resource, "DevToolPortalResource")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
dev_tool_portal_name=dev_tool_portal_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("DevToolPortalResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("DevToolPortalResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
dev_tool_portal_name: str,
dev_tool_portal_resource: _models.DevToolPortalResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DevToolPortalResource]:
"""Create the default Dev Tool Portal or update the existing Dev Tool Portal.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param dev_tool_portal_name: The name of Dev Tool Portal. Required.
:type dev_tool_portal_name: str
:param dev_tool_portal_resource: Parameters for the create or update operation. Required.
:type dev_tool_portal_resource:
~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
dev_tool_portal_name: str,
dev_tool_portal_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DevToolPortalResource]:
"""Create the default Dev Tool Portal or update the existing Dev Tool Portal.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param dev_tool_portal_name: The name of Dev Tool Portal. Required.
:type dev_tool_portal_name: str
:param dev_tool_portal_resource: Parameters for the create or update operation. Required.
:type dev_tool_portal_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
dev_tool_portal_name: str,
dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.DevToolPortalResource]:
"""Create the default Dev Tool Portal or update the existing Dev Tool Portal.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param dev_tool_portal_name: The name of Dev Tool Portal. Required.
:type dev_tool_portal_name: str
:param dev_tool_portal_resource: Parameters for the create or update operation. Is either a
DevToolPortalResource type or a IO[bytes] type. Required.
:type dev_tool_portal_resource:
~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.DevToolPortalResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
dev_tool_portal_name=dev_tool_portal_name,
dev_tool_portal_resource=dev_tool_portal_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("DevToolPortalResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.DevToolPortalResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.DevToolPortalResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
dev_tool_portal_name=dev_tool_portal_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Disable the default Dev Tool Portal.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param dev_tool_portal_name: The name of Dev Tool Portal. Required.
:type dev_tool_portal_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
dev_tool_portal_name=dev_tool_portal_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method)
|
class DevToolPortalsOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`dev_tool_portals` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.DevToolPortalResource"]:
'''Handles requests to list all resources in a Service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either DevToolPortalResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
@distributed_trace_async
async def get_next(next_link=None):
'''Get the Application Live and its properties.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param dev_tool_portal_name: The name of Dev Tool Portal. Required.
:type dev_tool_portal_name: str
:return: DevToolPortalResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
dev_tool_portal_name: str,
dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]],
**kwargs: Any
) -> _models.DevToolPortalResource:
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
dev_tool_portal_name: str,
dev_tool_portal_resource: _models.DevToolPortalResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DevToolPortalResource]:
'''Create the default Dev Tool Portal or update the existing Dev Tool Portal.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param dev_tool_portal_name: The name of Dev Tool Portal. Required.
:type dev_tool_portal_name: str
:param dev_tool_portal_resource: Parameters for the create or update operation. Required.
:type dev_tool_portal_resource:
~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
dev_tool_portal_name: str,
dev_tool_portal_resource: _models.DevToolPortalResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DevToolPortalResource]:
'''Create the default Dev Tool Portal or update the existing Dev Tool Portal.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param dev_tool_portal_name: The name of Dev Tool Portal. Required.
:type dev_tool_portal_name: str
:param dev_tool_portal_resource: Parameters for the create or update operation. Required.
:type dev_tool_portal_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
dev_tool_portal_name: str,
dev_tool_portal_resource: _models.DevToolPortalResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DevToolPortalResource]:
'''Create the default Dev Tool Portal or update the existing Dev Tool Portal.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param dev_tool_portal_name: The name of Dev Tool Portal. Required.
:type dev_tool_portal_name: str
:param dev_tool_portal_resource: Parameters for the create or update operation. Is either a
DevToolPortalResource type or a IO[bytes] type. Required.
:type dev_tool_portal_resource:
~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either DevToolPortalResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DevToolPortalResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, dev_tool_portal_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Disable the default Dev Tool Portal.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param dev_tool_portal_name: The name of Dev Tool Portal. Required.
:type dev_tool_portal_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
| 21 | 7 | 37 | 4 | 26 | 8 | 3 | 0.37 | 0 | 7 | 0 | 0 | 9 | 5 | 9 | 9 | 479 | 62 | 316 | 135 | 255 | 118 | 163 | 89 | 148 | 6 | 0 | 1 | 42 |
8,424 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_deployments_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._deployments_operations.DeploymentsOperations
|
class DeploymentsOperations: # pylint: disable=too-many-public-methods
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`deployments` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> _models.DeploymentResource:
"""Get a Deployment and its properties.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: DeploymentResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("DeploymentResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: Union[_models.DeploymentResource, IO[bytes]],
**kwargs: Any
) -> _models.DeploymentResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(deployment_resource, (IOBase, bytes)):
_content = deployment_resource
else:
_json = self._serialize.body(deployment_resource, "DeploymentResource")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("DeploymentResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("DeploymentResource", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("DeploymentResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: _models.DeploymentResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentResource]:
"""Create a new Deployment or update an exiting Deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param deployment_resource: Parameters for the create or update operation. Required.
:type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentResource]:
"""Create a new Deployment or update an exiting Deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param deployment_resource: Parameters for the create or update operation. Required.
:type deployment_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: Union[_models.DeploymentResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentResource]:
"""Create a new Deployment or update an exiting Deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param deployment_resource: Parameters for the create or update operation. Is either a
DeploymentResource type or a IO[bytes] type. Required.
:type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
deployment_resource=deployment_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("DeploymentResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.DeploymentResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.DeploymentResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Operation to delete a Deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _update_initial(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: Union[_models.DeploymentResource, IO[bytes]],
**kwargs: Any
) -> _models.DeploymentResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(deployment_resource, (IOBase, bytes)):
_content = deployment_resource
else:
_json = self._serialize.body(deployment_resource, "DeploymentResource")
_request = build_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("DeploymentResource", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("DeploymentResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: _models.DeploymentResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentResource]:
"""Operation to update an exiting Deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param deployment_resource: Parameters for the update operation. Required.
:type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentResource]:
"""Operation to update an exiting Deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param deployment_resource: Parameters for the update operation. Required.
:type deployment_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: Union[_models.DeploymentResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentResource]:
"""Operation to update an exiting Deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param deployment_resource: Parameters for the update operation. Is either a DeploymentResource
type or a IO[bytes] type. Required.
:type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.DeploymentResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
deployment_resource=deployment_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("DeploymentResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.DeploymentResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.DeploymentResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
@distributed_trace
def list(
self,
resource_group_name: str,
service_name: str,
app_name: str,
version: Optional[List[str]] = None,
**kwargs: Any
) -> AsyncIterable["_models.DeploymentResource"]:
"""Handles requests to list all resources in an App.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param version: Version of the deployments to be listed. Default value is None.
:type version: list[str]
:return: An iterator like instance of either DeploymentResource or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.DeploymentResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
subscription_id=self._config.subscription_id,
version=version,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace
def list_for_cluster(
self,
resource_group_name: str,
service_name: str,
version: Optional[List[str]] = None,
expand: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.DeploymentResource"]:
"""List deployments for a certain service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param version: Version of the deployments to be listed. Default value is None.
:type version: list[str]
:param expand: The expand expression to apply on the operation. Default value is None.
:type expand: str
:return: An iterator like instance of either DeploymentResource or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.DeploymentResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_for_cluster_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
version=version,
expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("DeploymentResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
async def _start_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_start_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_start(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Start the deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._start_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _stop_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_stop_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_stop(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Stop the deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._stop_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _restart_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_restart_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_restart(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Restart the deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._restart_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _enable_remote_debugging_initial(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None,
**kwargs: Any
) -> _models.RemoteDebugging:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(remote_debugging_payload, (IOBase, bytes)):
_content = remote_debugging_payload
else:
if remote_debugging_payload is not None:
_json = self._serialize.body(remote_debugging_payload, "RemoteDebuggingPayload")
else:
_json = None
_request = build_enable_remote_debugging_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("RemoteDebugging", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("RemoteDebugging", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_enable_remote_debugging(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
remote_debugging_payload: Optional[_models.RemoteDebuggingPayload] = None,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.RemoteDebugging]:
"""Enable remote debugging.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param remote_debugging_payload: Parameters for enable remote debugging. Default value is None.
:type remote_debugging_payload:
~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebuggingPayload
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebugging]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_enable_remote_debugging(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
remote_debugging_payload: Optional[IO[bytes]] = None,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.RemoteDebugging]:
"""Enable remote debugging.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param remote_debugging_payload: Parameters for enable remote debugging. Default value is None.
:type remote_debugging_payload: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebugging]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_enable_remote_debugging(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None,
**kwargs: Any
) -> AsyncLROPoller[_models.RemoteDebugging]:
"""Enable remote debugging.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param remote_debugging_payload: Parameters for enable remote debugging. Is either a
RemoteDebuggingPayload type or a IO[bytes] type. Default value is None.
:type remote_debugging_payload:
~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebuggingPayload or IO[bytes]
:return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebugging]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._enable_remote_debugging_initial(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
remote_debugging_payload=remote_debugging_payload,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("RemoteDebugging", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.RemoteDebugging](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _disable_remote_debugging_initial(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> _models.RemoteDebugging:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None)
_request = build_disable_remote_debugging_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("RemoteDebugging", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("RemoteDebugging", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace_async
async def begin_disable_remote_debugging(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> AsyncLROPoller[_models.RemoteDebugging]:
"""Disable remote debugging.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebugging]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._disable_remote_debugging_initial(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("RemoteDebugging", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.RemoteDebugging].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.RemoteDebugging](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
@distributed_trace_async
async def get_remote_debugging_config(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> _models.RemoteDebugging:
"""Get remote debugging config.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: RemoteDebugging or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebugging
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.RemoteDebugging] = kwargs.pop("cls", None)
_request = build_get_remote_debugging_config_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("RemoteDebugging", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace_async
async def get_log_file_url(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> Optional[_models.LogFileUrlResponse]:
"""Get deployment log file URL.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: LogFileUrlResponse or None or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.LogFileUrlResponse or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[Optional[_models.LogFileUrlResponse]] = kwargs.pop("cls", None)
_request = build_get_log_file_url_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize("LogFileUrlResponse", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]],
**kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(diagnostic_parameters, (IOBase, bytes)):
_content = diagnostic_parameters
else:
_json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters")
_request = build_generate_heap_dump_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@overload
async def begin_generate_heap_dump(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: _models.DiagnosticParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Generate Heap Dump.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Required.
:type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_generate_heap_dump(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Generate Heap Dump.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Required.
:type diagnostic_parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_generate_heap_dump(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Generate Heap Dump.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Is either a
DiagnosticParameters type or a IO[bytes] type. Required.
:type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._generate_heap_dump_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
diagnostic_parameters=diagnostic_parameters,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]],
**kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(diagnostic_parameters, (IOBase, bytes)):
_content = diagnostic_parameters
else:
_json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters")
_request = build_generate_thread_dump_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@overload
async def begin_generate_thread_dump(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: _models.DiagnosticParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Generate Thread Dump.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Required.
:type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_generate_thread_dump(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Generate Thread Dump.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Required.
:type diagnostic_parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_generate_thread_dump(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Generate Thread Dump.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Is either a
DiagnosticParameters type or a IO[bytes] type. Required.
:type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._generate_thread_dump_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
diagnostic_parameters=diagnostic_parameters,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]],
**kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(diagnostic_parameters, (IOBase, bytes)):
_content = diagnostic_parameters
else:
_json = self._serialize.body(diagnostic_parameters, "DiagnosticParameters")
_request = build_start_jfr_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@overload
async def begin_start_jfr(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: _models.DiagnosticParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Start JFR.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Required.
:type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_start_jfr(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Start JFR.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Required.
:type diagnostic_parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_start_jfr(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Start JFR.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Is either a
DiagnosticParameters type or a IO[bytes] type. Required.
:type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._start_jfr_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
deployment_name=deployment_name,
diagnostic_parameters=diagnostic_parameters,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method)
|
class DeploymentsOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`deployments` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> _models.DeploymentResource:
'''Get a Deployment and its properties.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: DeploymentResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: Union[_models.DeploymentResource, IO[bytes]],
**kwargs: Any
) -> _models.DeploymentResource:
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: _models.DeploymentResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentResource]:
'''Create a new Deployment or update an exiting Deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param deployment_resource: Parameters for the create or update operation. Required.
:type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: _models.DeploymentResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentResource]:
'''Create a new Deployment or update an exiting Deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param deployment_resource: Parameters for the create or update operation. Required.
:type deployment_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: _models.DeploymentResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentResource]:
'''Create a new Deployment or update an exiting Deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param deployment_resource: Parameters for the create or update operation. Is either a
DeploymentResource type or a IO[bytes] type. Required.
:type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Operation to delete a Deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _update_initial(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: Union[_models.DeploymentResource, IO[bytes]],
**kwargs: Any
) -> _models.DeploymentResource:
pass
@overload
async def begin_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: _models.DeploymentResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentResource]:
'''Operation to update an exiting Deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param deployment_resource: Parameters for the update operation. Required.
:type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: _models.DeploymentResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentResource]:
'''Operation to update an exiting Deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param deployment_resource: Parameters for the update operation. Required.
:type deployment_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
deployment_resource: _models.DeploymentResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentResource]:
'''Operation to update an exiting Deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param deployment_resource: Parameters for the update operation. Is either a DeploymentResource
type or a IO[bytes] type. Required.
:type deployment_resource: ~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either DeploymentResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@distributed_trace
def list(
self,
resource_group_name: str,
service_name: str,
app_name: str,
version: Optional[List[str]] = None,
**kwargs: Any
) -> AsyncIterable["_models.DeploymentResource"]:
'''Handles requests to list all resources in an App.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param version: Version of the deployments to be listed. Default value is None.
:type version: list[str]
:return: An iterator like instance of either DeploymentResource or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
@distributed_trace
def list_for_cluster(
self,
resource_group_name: str,
service_name: str,
version: Optional[List[str]] = None,
expand: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.DeploymentResource"]:
'''List deployments for a certain service.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param version: Version of the deployments to be listed. Default value is None.
:type version: list[str]
:param expand: The expand expression to apply on the operation. Default value is None.
:type expand: str
:return: An iterator like instance of either DeploymentResource or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.DeploymentResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
async def _start_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_start(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Start the deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _stop_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_stop(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Stop the deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _restart_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_restart(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Restart the deployment.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _enable_remote_debugging_initial(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None,
**kwargs: Any
) -> _models.RemoteDebugging:
pass
@overload
async def begin_enable_remote_debugging(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
remote_debugging_payload: Optional[_models.RemoteDebuggingPayload] = None,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.RemoteDebugging]:
'''Enable remote debugging.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param remote_debugging_payload: Parameters for enable remote debugging. Default value is None.
:type remote_debugging_payload:
~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebuggingPayload
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebugging]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_enable_remote_debugging(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
remote_debugging_payload: Optional[_models.RemoteDebuggingPayload] = None,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.RemoteDebugging]:
'''Enable remote debugging.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param remote_debugging_payload: Parameters for enable remote debugging. Default value is None.
:type remote_debugging_payload: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebugging]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_enable_remote_debugging(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
remote_debugging_payload: Optional[_models.RemoteDebuggingPayload] = None,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.RemoteDebugging]:
'''Enable remote debugging.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param remote_debugging_payload: Parameters for enable remote debugging. Is either a
RemoteDebuggingPayload type or a IO[bytes] type. Default value is None.
:type remote_debugging_payload:
~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebuggingPayload or IO[bytes]
:return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebugging]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _disable_remote_debugging_initial(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> _models.RemoteDebugging:
pass
@distributed_trace_async
async def begin_disable_remote_debugging(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> AsyncLROPoller[_models.RemoteDebugging]:
'''Disable remote debugging.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: An instance of AsyncLROPoller that returns either RemoteDebugging or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebugging]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@distributed_trace_async
async def get_remote_debugging_config(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> _models.RemoteDebugging:
'''Get remote debugging config.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: RemoteDebugging or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.RemoteDebugging
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def get_log_file_url(
self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any
) -> Optional[_models.LogFileUrlResponse]:
'''Get deployment log file URL.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:return: LogFileUrlResponse or None or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.LogFileUrlResponse or None
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _generate_heap_dump_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]],
**kwargs: Any
) -> None:
pass
@overload
async def begin_generate_heap_dump(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: _models.DiagnosticParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Generate Heap Dump.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Required.
:type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_generate_heap_dump(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: _models.DiagnosticParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Generate Heap Dump.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Required.
:type diagnostic_parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_generate_heap_dump(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: _models.DiagnosticParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Generate Heap Dump.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Is either a
DiagnosticParameters type or a IO[bytes] type. Required.
:type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _generate_thread_dump_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]],
**kwargs: Any
) -> None:
pass
@overload
async def begin_generate_thread_dump(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: _models.DiagnosticParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Generate Thread Dump.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Required.
:type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_generate_thread_dump(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: _models.DiagnosticParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Generate Thread Dump.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Required.
:type diagnostic_parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_generate_thread_dump(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: _models.DiagnosticParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Generate Thread Dump.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Is either a
DiagnosticParameters type or a IO[bytes] type. Required.
:type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _start_jfr_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]],
**kwargs: Any
) -> None:
pass
@overload
async def begin_start_jfr(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: _models.DiagnosticParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Start JFR.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Required.
:type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_start_jfr(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: _models.DiagnosticParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Start JFR.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Required.
:type diagnostic_parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_start_jfr(
self,
resource_group_name: str,
service_name: str,
app_name: str,
deployment_name: str,
diagnostic_parameters: _models.DiagnosticParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Start JFR.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param deployment_name: The name of the Deployment resource. Required.
:type deployment_name: str
:param diagnostic_parameters: Parameters for the diagnostic operation. Is either a
DiagnosticParameters type or a IO[bytes] type. Required.
:type diagnostic_parameters: ~azure.mgmt.appplatform.v2023_12_01.models.DiagnosticParameters or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
| 86 | 29 | 40 | 4 | 27 | 11 | 3 | 0.41 | 0 | 7 | 0 | 0 | 40 | 5 | 40 | 40 | 2,208 | 248 | 1,452 | 637 | 1,110 | 591 | 664 | 353 | 606 | 7 | 0 | 2 | 168 |
8,425 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_customized_accelerators_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._customized_accelerators_operations.CustomizedAcceleratorsOperations
|
class CustomizedAcceleratorsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`customized_accelerators` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any
) -> AsyncIterable["_models.CustomizedAcceleratorResource"]:
"""Handle requests to list all customized accelerators.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:return: An iterator like instance of either CustomizedAcceleratorResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.CustomizedAcceleratorResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("CustomizedAcceleratorResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace_async
async def get(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
**kwargs: Any
) -> _models.CustomizedAcceleratorResource:
"""Get the customized accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:return: CustomizedAcceleratorResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
customized_accelerator_name=customized_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]],
**kwargs: Any
) -> _models.CustomizedAcceleratorResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(customized_accelerator_resource, (IOBase, bytes)):
_content = customized_accelerator_resource
else:
_json = self._serialize.body(customized_accelerator_resource, "CustomizedAcceleratorResource")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
customized_accelerator_name=customized_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
customized_accelerator_resource: _models.CustomizedAcceleratorResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]:
"""Create or update the customized accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:param customized_accelerator_resource: The customized accelerator for the create or update
operation. Required.
:type customized_accelerator_resource:
~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
customized_accelerator_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]:
"""Create or update the customized accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:param customized_accelerator_resource: The customized accelerator for the create or update
operation. Required.
:type customized_accelerator_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]:
"""Create or update the customized accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:param customized_accelerator_resource: The customized accelerator for the create or update
operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required.
:type customized_accelerator_resource:
~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.CustomizedAcceleratorResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
customized_accelerator_name=customized_accelerator_name,
customized_accelerator_resource=customized_accelerator_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("CustomizedAcceleratorResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.CustomizedAcceleratorResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.CustomizedAcceleratorResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
**kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
customized_accelerator_name=customized_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@distributed_trace_async
async def begin_delete(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Delete the customized accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
customized_accelerator_name=customized_accelerator_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _validate_initial(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]],
**kwargs: Any
) -> Optional[_models.CustomizedAcceleratorValidateResult]:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[Optional[_models.CustomizedAcceleratorValidateResult]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(properties, (IOBase, bytes)):
_content = properties
else:
_json = self._serialize.body(properties, "CustomizedAcceleratorProperties")
_request = build_validate_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
customized_accelerator_name=customized_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = None
response_headers = {}
if response.status_code == 200:
deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response)
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, deserialized, response_headers) # type: ignore
return deserialized # type: ignore
@overload
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
properties: _models.CustomizedAcceleratorProperties,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomizedAcceleratorValidateResult]:
"""Check the customized accelerator are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:param properties: Customized accelerator properties to be validated. Required.
:type properties: ~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorProperties
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorValidateResult
or the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
properties: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomizedAcceleratorValidateResult]:
"""Check the customized accelerator are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:param properties: Customized accelerator properties to be validated. Required.
:type properties: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorValidateResult
or the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.CustomizedAcceleratorValidateResult]:
"""Check the customized accelerator are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:param properties: Customized accelerator properties to be validated. Is either a
CustomizedAcceleratorProperties type or a IO[bytes] type. Required.
:type properties: ~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorProperties or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorValidateResult
or the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.CustomizedAcceleratorValidateResult] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._validate_initial(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
customized_accelerator_name=customized_accelerator_name,
properties=properties,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("CustomizedAcceleratorValidateResult", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.CustomizedAcceleratorValidateResult].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.CustomizedAcceleratorValidateResult](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
|
class CustomizedAcceleratorsOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`customized_accelerators` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any
) -> AsyncIterable["_models.CustomizedAcceleratorResource"]:
'''Handle requests to list all customized accelerators.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:return: An iterator like instance of either CustomizedAcceleratorResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
@distributed_trace_async
async def get_next(next_link=None):
'''Get the customized accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:return: CustomizedAcceleratorResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]],
**kwargs: Any
) -> _models.CustomizedAcceleratorResource:
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
customized_accelerator_resource: _models.CustomizedAcceleratorResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]:
'''Create or update the customized accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:param customized_accelerator_resource: The customized accelerator for the create or update
operation. Required.
:type customized_accelerator_resource:
~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
customized_accelerator_resource: _models.CustomizedAcceleratorResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]:
'''Create or update the customized accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:param customized_accelerator_resource: The customized accelerator for the create or update
operation. Required.
:type customized_accelerator_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
customized_accelerator_resource: _models.CustomizedAcceleratorResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomizedAcceleratorResource]:
'''Create or update the customized accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:param customized_accelerator_resource: The customized accelerator for the create or update
operation. Is either a CustomizedAcceleratorResource type or a IO[bytes] type. Required.
:type customized_accelerator_resource:
~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
**kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_delete(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
**kwargs: Any
) -> AsyncLROPoller[None]:
'''Delete the customized accelerator.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _validate_initial(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]],
**kwargs: Any
) -> Optional[_models.CustomizedAcceleratorValidateResult]:
pass
@overload
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
properties: _models.CustomizedAcceleratorProperties,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomizedAcceleratorValidateResult]:
'''Check the customized accelerator are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:param properties: Customized accelerator properties to be validated. Required.
:type properties: ~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorProperties
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorValidateResult
or the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
properties: _models.CustomizedAcceleratorProperties,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomizedAcceleratorValidateResult]:
'''Check the customized accelerator are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:param properties: Customized accelerator properties to be validated. Required.
:type properties: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorValidateResult
or the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
customized_accelerator_name: str,
properties: _models.CustomizedAcceleratorProperties,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomizedAcceleratorValidateResult]:
'''Check the customized accelerator are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param customized_accelerator_name: The name of the customized accelerator. Required.
:type customized_accelerator_name: str
:param properties: Customized accelerator properties to be validated. Is either a
CustomizedAcceleratorProperties type or a IO[bytes] type. Required.
:type properties: ~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorProperties or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either CustomizedAcceleratorValidateResult
or the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomizedAcceleratorValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
| 29 | 10 | 41 | 4 | 28 | 10 | 3 | 0.42 | 0 | 7 | 0 | 0 | 13 | 5 | 13 | 13 | 739 | 83 | 479 | 223 | 355 | 199 | 221 | 119 | 201 | 6 | 0 | 1 | 57 |
8,426 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_custom_domains_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._custom_domains_operations.CustomDomainsOperations
|
class CustomDomainsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`custom_domains` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any
) -> _models.CustomDomainResource:
"""Get the custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:return: CustomDomainResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
domain_name=domain_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("CustomDomainResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: Union[_models.CustomDomainResource, IO[bytes]],
**kwargs: Any
) -> _models.CustomDomainResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(domain_resource, (IOBase, bytes)):
_content = domain_resource
else:
_json = self._serialize.body(domain_resource, "CustomDomainResource")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
domain_name=domain_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("CustomDomainResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("CustomDomainResource", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("CustomDomainResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: _models.CustomDomainResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomDomainResource]:
"""Create or update custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:param domain_resource: Parameters for the create or update operation. Required.
:type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomDomainResource]:
"""Create or update custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:param domain_resource: Parameters for the create or update operation. Required.
:type domain_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: Union[_models.CustomDomainResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.CustomDomainResource]:
"""Create or update custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:param domain_resource: Parameters for the create or update operation. Is either a
CustomDomainResource type or a IO[bytes] type. Required.
:type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
domain_name=domain_name,
domain_resource=domain_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("CustomDomainResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.CustomDomainResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
domain_name=domain_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Delete the custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
domain_name=domain_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _update_initial(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: Union[_models.CustomDomainResource, IO[bytes]],
**kwargs: Any
) -> _models.CustomDomainResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(domain_resource, (IOBase, bytes)):
_content = domain_resource
else:
_json = self._serialize.body(domain_resource, "CustomDomainResource")
_request = build_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
domain_name=domain_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("CustomDomainResource", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("CustomDomainResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: _models.CustomDomainResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomDomainResource]:
"""Update custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:param domain_resource: Parameters for the create or update operation. Required.
:type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomDomainResource]:
"""Update custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:param domain_resource: Parameters for the create or update operation. Required.
:type domain_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: Union[_models.CustomDomainResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.CustomDomainResource]:
"""Update custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:param domain_resource: Parameters for the create or update operation. Is either a
CustomDomainResource type or a IO[bytes] type. Required.
:type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.CustomDomainResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
domain_name=domain_name,
domain_resource=domain_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("CustomDomainResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.CustomDomainResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.CustomDomainResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any
) -> AsyncIterable["_models.CustomDomainResource"]:
"""List the custom domains of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:return: An iterator like instance of either CustomDomainResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.CustomDomainResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
app_name=app_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("CustomDomainResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
|
class CustomDomainsOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`custom_domains` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any
) -> _models.CustomDomainResource:
'''Get the custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:return: CustomDomainResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: Union[_models.CustomDomainResource, IO[bytes]],
**kwargs: Any
) -> _models.CustomDomainResource:
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: _models.CustomDomainResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomDomainResource]:
'''Create or update custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:param domain_resource: Parameters for the create or update operation. Required.
:type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: _models.CustomDomainResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomDomainResource]:
'''Create or update custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:param domain_resource: Parameters for the create or update operation. Required.
:type domain_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: _models.CustomDomainResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomDomainResource]:
'''Create or update custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:param domain_resource: Parameters for the create or update operation. Is either a
CustomDomainResource type or a IO[bytes] type. Required.
:type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Delete the custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _update_initial(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: Union[_models.CustomDomainResource, IO[bytes]],
**kwargs: Any
) -> _models.CustomDomainResource:
pass
@overload
async def begin_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: _models.CustomDomainResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomDomainResource]:
'''Update custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:param domain_resource: Parameters for the create or update operation. Required.
:type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: _models.CustomDomainResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomDomainResource]:
'''Update custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:param domain_resource: Parameters for the create or update operation. Required.
:type domain_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_update(
self,
resource_group_name: str,
service_name: str,
app_name: str,
domain_name: str,
domain_resource: _models.CustomDomainResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.CustomDomainResource]:
'''Update custom domain of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:param domain_name: The name of the custom domain resource. Required.
:type domain_name: str
:param domain_resource: Parameters for the create or update operation. Is either a
CustomDomainResource type or a IO[bytes] type. Required.
:type domain_resource: ~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource or
IO[bytes]
:return: An instance of AsyncLROPoller that returns either CustomDomainResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any
) -> AsyncIterable["_models.CustomDomainResource"]:
'''List the custom domains of one lifecycle application.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param app_name: The name of the App resource. Required.
:type app_name: str
:return: An iterator like instance of either CustomDomainResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.CustomDomainResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
| 29 | 10 | 39 | 4 | 27 | 10 | 3 | 0.43 | 0 | 7 | 0 | 0 | 13 | 5 | 13 | 13 | 718 | 83 | 461 | 206 | 352 | 196 | 218 | 117 | 198 | 7 | 0 | 1 | 57 |
8,427 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_container_registries_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._container_registries_operations.ContainerRegistriesOperations
|
class ContainerRegistriesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`container_registries` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.ContainerRegistryResource"]:
"""List container registries resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either ContainerRegistryResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ContainerRegistryResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("ContainerRegistryResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any
) -> _models.ContainerRegistryResource:
"""Get the container registries resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:return: ContainerRegistryResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
container_registry_name=container_registry_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("ContainerRegistryResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]],
**kwargs: Any
) -> _models.ContainerRegistryResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(container_registry_resource, (IOBase, bytes)):
_content = container_registry_resource
else:
_json = self._serialize.body(container_registry_resource, "ContainerRegistryResource")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
container_registry_name=container_registry_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("ContainerRegistryResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("ContainerRegistryResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_resource: _models.ContainerRegistryResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ContainerRegistryResource]:
"""Create or update container registry resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:param container_registry_resource: Parameters for the create or update operation. Required.
:type container_registry_resource:
~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ContainerRegistryResource]:
"""Create or update container registry resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:param container_registry_resource: Parameters for the create or update operation. Required.
:type container_registry_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.ContainerRegistryResource]:
"""Create or update container registry resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:param container_registry_resource: Parameters for the create or update operation. Is either a
ContainerRegistryResource type or a IO[bytes] type. Required.
:type container_registry_resource:
~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ContainerRegistryResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
container_registry_name=container_registry_name,
container_registry_resource=container_registry_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ContainerRegistryResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
)
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.ContainerRegistryResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.ContainerRegistryResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
container_registry_name=container_registry_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Delete a container registry resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
container_registry_name=container_registry_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
)
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
async def _validate_initial(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]],
**kwargs: Any
) -> Optional[_models.ContainerRegistryValidateResult]:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[Optional[_models.ContainerRegistryValidateResult]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(container_registry_properties, (IOBase, bytes)):
_content = container_registry_properties
else:
_json = self._serialize.body(container_registry_properties, "ContainerRegistryProperties")
_request = build_validate_request(
resource_group_name=resource_group_name,
service_name=service_name,
container_registry_name=container_registry_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = None
response_headers = {}
if response.status_code == 200:
deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response)
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, deserialized, response_headers) # type: ignore
return deserialized # type: ignore
@overload
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_properties: _models.ContainerRegistryProperties,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ContainerRegistryValidateResult]:
"""Check if the container registry properties are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:param container_registry_properties: Parameters for the validate operation. Required.
:type container_registry_properties:
~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryProperties
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ContainerRegistryValidateResult or
the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_properties: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ContainerRegistryValidateResult]:
"""Check if the container registry properties are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:param container_registry_properties: Parameters for the validate operation. Required.
:type container_registry_properties: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ContainerRegistryValidateResult or
the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.ContainerRegistryValidateResult]:
"""Check if the container registry properties are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:param container_registry_properties: Parameters for the validate operation. Is either a
ContainerRegistryProperties type or a IO[bytes] type. Required.
:type container_registry_properties:
~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryProperties or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ContainerRegistryValidateResult or
the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ContainerRegistryValidateResult] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._validate_initial(
resource_group_name=resource_group_name,
service_name=service_name,
container_registry_name=container_registry_name,
container_registry_properties=container_registry_properties,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ContainerRegistryValidateResult", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
)
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.ContainerRegistryValidateResult].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.ContainerRegistryValidateResult](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
|
class ContainerRegistriesOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`container_registries` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.ContainerRegistryResource"]:
'''List container registries resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either ContainerRegistryResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
@distributed_trace_async
async def get_next(next_link=None):
'''Get the container registries resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:return: ContainerRegistryResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]],
**kwargs: Any
) -> _models.ContainerRegistryResource:
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_resource: _models.ContainerRegistryResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ContainerRegistryResource]:
'''Create or update container registry resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:param container_registry_resource: Parameters for the create or update operation. Required.
:type container_registry_resource:
~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_resource: _models.ContainerRegistryResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ContainerRegistryResource]:
'''Create or update container registry resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:param container_registry_resource: Parameters for the create or update operation. Required.
:type container_registry_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_resource: _models.ContainerRegistryResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ContainerRegistryResource]:
'''Create or update container registry resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:param container_registry_resource: Parameters for the create or update operation. Is either a
ContainerRegistryResource type or a IO[bytes] type. Required.
:type container_registry_resource:
~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ContainerRegistryResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Delete a container registry resource.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _validate_initial(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]],
**kwargs: Any
) -> Optional[_models.ContainerRegistryValidateResult]:
pass
@overload
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_properties: _models.ContainerRegistryProperties,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ContainerRegistryValidateResult]:
'''Check if the container registry properties are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:param container_registry_properties: Parameters for the validate operation. Required.
:type container_registry_properties:
~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryProperties
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ContainerRegistryValidateResult or
the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_properties: _models.ContainerRegistryProperties,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ContainerRegistryValidateResult]:
'''Check if the container registry properties are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:param container_registry_properties: Parameters for the validate operation. Required.
:type container_registry_properties: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ContainerRegistryValidateResult or
the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
container_registry_name: str,
container_registry_properties: _models.ContainerRegistryProperties,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ContainerRegistryValidateResult]:
'''Check if the container registry properties are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param container_registry_name: The name of the container registry. Required.
:type container_registry_name: str
:param container_registry_properties: Parameters for the validate operation. Is either a
ContainerRegistryProperties type or a IO[bytes] type. Required.
:type container_registry_properties:
~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryProperties or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ContainerRegistryValidateResult or
the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ContainerRegistryValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
| 29 | 10 | 38 | 4 | 26 | 9 | 3 | 0.4 | 0 | 7 | 0 | 0 | 13 | 5 | 13 | 13 | 695 | 83 | 454 | 200 | 353 | 180 | 221 | 119 | 201 | 6 | 0 | 1 | 57 |
8,428 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_app_platform_management_client_enums.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._app_platform_management_client_enums.ConfigServerState
|
class ConfigServerState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""State of the config server."""
NOT_AVAILABLE = "NotAvailable"
DELETED = "Deleted"
FAILED = "Failed"
SUCCEEDED = "Succeeded"
UPDATING = "Updating"
|
class ConfigServerState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
'''State of the config server.'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.17 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 8 | 1 | 6 | 6 | 5 | 1 | 6 | 6 | 5 | 0 | 4 | 0 | 0 |
8,429 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_app_platform_management_client_enums.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._app_platform_management_client_enums.SupportedRuntimeValue
|
class SupportedRuntimeValue(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The raw value which could be passed to deployment CRUD operations."""
JAVA8 = "Java_8"
JAVA11 = "Java_11"
JAVA17 = "Java_17"
NET_CORE31 = "NetCore_31"
|
class SupportedRuntimeValue(str, Enum, metaclass=CaseInsensitiveEnumMeta):
'''The raw value which could be passed to deployment CRUD operations.'''
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.2 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 7 | 1 | 5 | 5 | 4 | 1 | 5 | 5 | 4 | 0 | 4 | 0 | 0 |
8,430 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.AcceleratorGitRepository
|
class AcceleratorGitRepository(_serialization.Model):
"""AcceleratorGitRepository.
All required parameters must be populated in order to send to server.
:ivar url: Git repository URL for the accelerator. Required.
:vartype url: str
:ivar interval_in_seconds: Interval for checking for updates to Git or image repository.
:vartype interval_in_seconds: int
:ivar branch: Git repository branch to be used.
:vartype branch: str
:ivar commit: Git repository commit to be used.
:vartype commit: str
:ivar git_tag: Git repository tag to be used.
:vartype git_tag: str
:ivar auth_setting: Properties of the auth setting payload. Required.
:vartype auth_setting: ~azure.mgmt.appplatform.v2023_12_01.models.AcceleratorAuthSetting
:ivar sub_path: Folder path inside the git repository to consider as the root of the
accelerator or fragment.
:vartype sub_path: str
"""
_validation = {
"url": {"required": True},
"auth_setting": {"required": True},
}
_attribute_map = {
"url": {"key": "url", "type": "str"},
"interval_in_seconds": {"key": "intervalInSeconds", "type": "int"},
"branch": {"key": "branch", "type": "str"},
"commit": {"key": "commit", "type": "str"},
"git_tag": {"key": "gitTag", "type": "str"},
"auth_setting": {"key": "authSetting", "type": "AcceleratorAuthSetting"},
"sub_path": {"key": "subPath", "type": "str"},
}
def __init__(
self,
*,
url: str,
auth_setting: "_models.AcceleratorAuthSetting",
interval_in_seconds: Optional[int] = None,
branch: Optional[str] = None,
commit: Optional[str] = None,
git_tag: Optional[str] = None,
sub_path: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword url: Git repository URL for the accelerator. Required.
:paramtype url: str
:keyword interval_in_seconds: Interval for checking for updates to Git or image repository.
:paramtype interval_in_seconds: int
:keyword branch: Git repository branch to be used.
:paramtype branch: str
:keyword commit: Git repository commit to be used.
:paramtype commit: str
:keyword git_tag: Git repository tag to be used.
:paramtype git_tag: str
:keyword auth_setting: Properties of the auth setting payload. Required.
:paramtype auth_setting: ~azure.mgmt.appplatform.v2023_12_01.models.AcceleratorAuthSetting
:keyword sub_path: Folder path inside the git repository to consider as the root of the
accelerator or fragment.
:paramtype sub_path: str
"""
super().__init__(**kwargs)
self.url = url
self.interval_in_seconds = interval_in_seconds
self.branch = branch
self.commit = commit
self.git_tag = git_tag
self.auth_setting = auth_setting
self.sub_path = sub_path
|
class AcceleratorGitRepository(_serialization.Model):
'''AcceleratorGitRepository.
All required parameters must be populated in order to send to server.
:ivar url: Git repository URL for the accelerator. Required.
:vartype url: str
:ivar interval_in_seconds: Interval for checking for updates to Git or image repository.
:vartype interval_in_seconds: int
:ivar branch: Git repository branch to be used.
:vartype branch: str
:ivar commit: Git repository commit to be used.
:vartype commit: str
:ivar git_tag: Git repository tag to be used.
:vartype git_tag: str
:ivar auth_setting: Properties of the auth setting payload. Required.
:vartype auth_setting: ~azure.mgmt.appplatform.v2023_12_01.models.AcceleratorAuthSetting
:ivar sub_path: Folder path inside the git repository to consider as the root of the
accelerator or fragment.
:vartype sub_path: str
'''
def __init__(
self,
*,
url: str,
auth_setting: "_models.AcceleratorAuthSetting",
interval_in_seconds: Optional[int] = None,
branch: Optional[str] = None,
commit: Optional[str] = None,
git_tag: Optional[str] = None,
sub_path: Optional[str] = None,
**kwargs: Any
) -> None:
'''
:keyword url: Git repository URL for the accelerator. Required.
:paramtype url: str
:keyword interval_in_seconds: Interval for checking for updates to Git or image repository.
:paramtype interval_in_seconds: int
:keyword branch: Git repository branch to be used.
:paramtype branch: str
:keyword commit: Git repository commit to be used.
:paramtype commit: str
:keyword git_tag: Git repository tag to be used.
:paramtype git_tag: str
:keyword auth_setting: Properties of the auth setting payload. Required.
:paramtype auth_setting: ~azure.mgmt.appplatform.v2023_12_01.models.AcceleratorAuthSetting
:keyword sub_path: Folder path inside the git repository to consider as the root of the
accelerator or fragment.
:paramtype sub_path: str
'''
pass
| 2 | 2 | 37 | 0 | 20 | 17 | 1 | 1.03 | 1 | 4 | 0 | 0 | 1 | 7 | 1 | 16 | 74 | 5 | 34 | 22 | 21 | 35 | 12 | 11 | 10 | 1 | 2 | 0 | 1 |
8,431 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApiPortalCustomDomainResource
|
class ApiPortalCustomDomainResource(ProxyResource):
"""Custom domain of the API portal.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource Id for the resource.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource.
:vartype type: str
:ivar system_data: Metadata pertaining to creation and last modification of the resource.
:vartype system_data: ~azure.mgmt.appplatform.v2023_12_01.models.SystemData
:ivar properties: The properties of custom domain for API portal.
:vartype properties: ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalCustomDomainProperties
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"properties": {"key": "properties", "type": "ApiPortalCustomDomainProperties"},
}
def __init__(
self, *, properties: Optional["_models.ApiPortalCustomDomainProperties"] = None, **kwargs: Any
) -> None:
"""
:keyword properties: The properties of custom domain for API portal.
:paramtype properties:
~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalCustomDomainProperties
"""
super().__init__(**kwargs)
self.properties = properties
|
class ApiPortalCustomDomainResource(ProxyResource):
'''Custom domain of the API portal.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource Id for the resource.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource.
:vartype type: str
:ivar system_data: Metadata pertaining to creation and last modification of the resource.
:vartype system_data: ~azure.mgmt.appplatform.v2023_12_01.models.SystemData
:ivar properties: The properties of custom domain for API portal.
:vartype properties: ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalCustomDomainProperties
'''
def __init__(
self, *, properties: Optional["_models.ApiPortalCustomDomainProperties"] = None, **kwargs: Any
) -> None:
'''
:keyword properties: The properties of custom domain for API portal.
:paramtype properties:
~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalCustomDomainProperties
'''
pass
| 2 | 2 | 10 | 0 | 5 | 5 | 1 | 0.95 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 17 | 42 | 5 | 19 | 7 | 15 | 18 | 6 | 5 | 4 | 1 | 4 | 0 | 1 |
8,432 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApplicationLiveViewProperties
|
class ApplicationLiveViewProperties(_serialization.Model):
"""Application Live View properties payload.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar provisioning_state: State of the Application Live View. Known values are: "Creating",
"Updating", "Succeeded", "Failed", "Deleting", and "Canceled".
:vartype provisioning_state: str or
~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewProvisioningState
:ivar components: Component details of Application Live View.
:vartype components:
list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewComponent]
"""
_validation = {
"provisioning_state": {"readonly": True},
"components": {"readonly": True},
}
_attribute_map = {
"provisioning_state": {"key": "provisioningState", "type": "str"},
"components": {"key": "components", "type": "[ApplicationLiveViewComponent]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.provisioning_state = None
self.components = None
|
class ApplicationLiveViewProperties(_serialization.Model):
'''Application Live View properties payload.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar provisioning_state: State of the Application Live View. Known values are: "Creating",
"Updating", "Succeeded", "Failed", "Deleting", and "Canceled".
:vartype provisioning_state: str or
~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewProvisioningState
:ivar components: Component details of Application Live View.
:vartype components:
list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewComponent]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 5 | 0 | 4 | 1 | 1 | 0.85 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 16 | 29 | 5 | 13 | 6 | 11 | 11 | 7 | 6 | 5 | 1 | 2 | 0 | 1 |
8,433 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApplicationLiveViewComponent
|
class ApplicationLiveViewComponent(_serialization.Model):
"""Application Live View properties payload.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar name: Name of the component.
:vartype name: any
:ivar resource_requests: The requested resource quantity for required CPU and Memory.
:vartype resource_requests:
~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewResourceRequests
:ivar instances: Collection of instances belong to Application Live View.
:vartype instances:
list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewInstance]
"""
_validation = {
"name": {"readonly": True},
"resource_requests": {"readonly": True},
"instances": {"readonly": True},
}
_attribute_map = {
"name": {"key": "name", "type": "object"},
"resource_requests": {"key": "resourceRequests", "type": "ApplicationLiveViewResourceRequests"},
"instances": {"key": "instances", "type": "[ApplicationLiveViewInstance]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.name = None
self.resource_requests = None
self.instances = None
|
class ApplicationLiveViewComponent(_serialization.Model):
'''Application Live View properties payload.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar name: Name of the component.
:vartype name: any
:ivar resource_requests: The requested resource quantity for required CPU and Memory.
:vartype resource_requests:
~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewResourceRequests
:ivar instances: Collection of instances belong to Application Live View.
:vartype instances:
list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationLiveViewInstance]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 6 | 0 | 5 | 1 | 1 | 0.75 | 1 | 2 | 0 | 0 | 1 | 3 | 1 | 16 | 33 | 5 | 16 | 7 | 14 | 12 | 8 | 7 | 6 | 1 | 2 | 0 | 1 |
8,434 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApplicationAcceleratorResourceRequests
|
class ApplicationAcceleratorResourceRequests(_serialization.Model):
"""ApplicationAcceleratorResourceRequests.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar cpu: Cpu allocated to each application accelerator component. 1 core can be represented
by 1 or 1000m.
:vartype cpu: str
:ivar memory: Memory allocated to each application accelerator component. 1 GB can be
represented by 1Gi or 1024Mi.
:vartype memory: str
:ivar instance_count: Instance count of the application accelerator component.
:vartype instance_count: int
"""
_validation = {
"cpu": {"readonly": True},
"memory": {"readonly": True},
"instance_count": {"readonly": True},
}
_attribute_map = {
"cpu": {"key": "cpu", "type": "str"},
"memory": {"key": "memory", "type": "str"},
"instance_count": {"key": "instanceCount", "type": "int"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.cpu = None
self.memory = None
self.instance_count = None
|
class ApplicationAcceleratorResourceRequests(_serialization.Model):
'''ApplicationAcceleratorResourceRequests.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar cpu: Cpu allocated to each application accelerator component. 1 core can be represented
by 1 or 1000m.
:vartype cpu: str
:ivar memory: Memory allocated to each application accelerator component. 1 GB can be
represented by 1Gi or 1024Mi.
:vartype memory: str
:ivar instance_count: Instance count of the application accelerator component.
:vartype instance_count: int
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 6 | 0 | 5 | 1 | 1 | 0.75 | 1 | 2 | 0 | 0 | 1 | 3 | 1 | 16 | 33 | 5 | 16 | 7 | 14 | 12 | 8 | 7 | 6 | 1 | 2 | 0 | 1 |
8,435 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApplicationAcceleratorResourceCollection
|
class ApplicationAcceleratorResourceCollection(_serialization.Model):
"""Object that includes an array of application accelerator resources and a possible link for next
set.
:ivar value: Collection of application accelerator resources.
:vartype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorResource]
:ivar next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:vartype next_link: str
"""
_attribute_map = {
"value": {"key": "value", "type": "[ApplicationAcceleratorResource]"},
"next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
self,
*,
value: Optional[List["_models.ApplicationAcceleratorResource"]] = None,
next_link: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword value: Collection of application accelerator resources.
:paramtype value:
list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorResource]
:keyword next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:paramtype next_link: str
"""
super().__init__(**kwargs)
self.value = value
self.next_link = next_link
|
class ApplicationAcceleratorResourceCollection(_serialization.Model):
'''Object that includes an array of application accelerator resources and a possible link for next
set.
:ivar value: Collection of application accelerator resources.
:vartype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorResource]
:ivar next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:vartype next_link: str
'''
def __init__(
self,
*,
value: Optional[List["_models.ApplicationAcceleratorResource"]] = None,
next_link: Optional[str] = None,
**kwargs: Any
) -> None:
'''
:keyword value: Collection of application accelerator resources.
:paramtype value:
list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorResource]
:keyword next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:paramtype next_link: str
'''
pass
| 2 | 2 | 18 | 0 | 10 | 8 | 1 | 1.07 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 16 | 34 | 3 | 15 | 11 | 7 | 16 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
8,436 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApplicationAcceleratorResource
|
class ApplicationAcceleratorResource(ProxyResource):
"""Application accelerator resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource Id for the resource.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource.
:vartype type: str
:ivar system_data: Metadata pertaining to creation and last modification of the resource.
:vartype system_data: ~azure.mgmt.appplatform.v2023_12_01.models.SystemData
:ivar properties: Application accelerator properties payload.
:vartype properties:
~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorProperties
:ivar sku: Sku of the application accelerator resource.
:vartype sku: ~azure.mgmt.appplatform.v2023_12_01.models.Sku
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"properties": {"key": "properties", "type": "ApplicationAcceleratorProperties"},
"sku": {"key": "sku", "type": "Sku"},
}
def __init__(
self,
*,
properties: Optional["_models.ApplicationAcceleratorProperties"] = None,
sku: Optional["_models.Sku"] = None,
**kwargs: Any
) -> None:
"""
:keyword properties: Application accelerator properties payload.
:paramtype properties:
~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorProperties
:keyword sku: Sku of the application accelerator resource.
:paramtype sku: ~azure.mgmt.appplatform.v2023_12_01.models.Sku
"""
super().__init__(**kwargs)
self.properties = properties
self.sku = sku
|
class ApplicationAcceleratorResource(ProxyResource):
'''Application accelerator resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource Id for the resource.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource.
:vartype type: str
:ivar system_data: Metadata pertaining to creation and last modification of the resource.
:vartype system_data: ~azure.mgmt.appplatform.v2023_12_01.models.SystemData
:ivar properties: Application accelerator properties payload.
:vartype properties:
~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorProperties
:ivar sku: Sku of the application accelerator resource.
:vartype sku: ~azure.mgmt.appplatform.v2023_12_01.models.Sku
'''
def __init__(
self,
*,
properties: Optional["_models.ApplicationAcceleratorProperties"] = None,
sku: Optional["_models.Sku"] = None,
**kwargs: Any
) -> None:
'''
:keyword properties: Application accelerator properties payload.
:paramtype properties:
~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorProperties
:keyword sku: Sku of the application accelerator resource.
:paramtype sku: ~azure.mgmt.appplatform.v2023_12_01.models.Sku
'''
pass
| 2 | 2 | 17 | 0 | 10 | 7 | 1 | 0.92 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 17 | 53 | 5 | 25 | 12 | 17 | 23 | 7 | 6 | 5 | 1 | 4 | 0 | 1 |
8,437 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApplicationAcceleratorProperties
|
class ApplicationAcceleratorProperties(_serialization.Model):
"""Application accelerator properties payload.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar provisioning_state: State of the application accelerator. Known values are: "Creating",
"Updating", "Succeeded", "Failed", "Deleting", and "Canceled".
:vartype provisioning_state: str or
~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorProvisioningState
:ivar components: Collection of components belong to application accelerator.
:vartype components:
list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorComponent]
"""
_validation = {
"provisioning_state": {"readonly": True},
"components": {"readonly": True},
}
_attribute_map = {
"provisioning_state": {"key": "provisioningState", "type": "str"},
"components": {"key": "components", "type": "[ApplicationAcceleratorComponent]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.provisioning_state = None
self.components = None
|
class ApplicationAcceleratorProperties(_serialization.Model):
'''Application accelerator properties payload.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar provisioning_state: State of the application accelerator. Known values are: "Creating",
"Updating", "Succeeded", "Failed", "Deleting", and "Canceled".
:vartype provisioning_state: str or
~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorProvisioningState
:ivar components: Collection of components belong to application accelerator.
:vartype components:
list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorComponent]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 5 | 0 | 4 | 1 | 1 | 0.85 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 16 | 29 | 5 | 13 | 6 | 11 | 11 | 7 | 6 | 5 | 1 | 2 | 0 | 1 |
8,438 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApplicationAcceleratorComponent
|
class ApplicationAcceleratorComponent(_serialization.Model):
"""ApplicationAcceleratorComponent.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar name:
:vartype name: str
:ivar resource_requests:
:vartype resource_requests:
~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorResourceRequests
:ivar instances:
:vartype instances:
list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorInstance]
"""
_validation = {
"name": {"readonly": True},
"instances": {"readonly": True},
}
_attribute_map = {
"name": {"key": "name", "type": "str"},
"resource_requests": {"key": "resourceRequests", "type": "ApplicationAcceleratorResourceRequests"},
"instances": {"key": "instances", "type": "[ApplicationAcceleratorInstance]"},
}
def __init__(
self, *, resource_requests: Optional["_models.ApplicationAcceleratorResourceRequests"] = None, **kwargs: Any
) -> None:
"""
:keyword resource_requests:
:paramtype resource_requests:
~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorResourceRequests
"""
super().__init__(**kwargs)
self.name = None
self.resource_requests = resource_requests
self.instances = None
|
class ApplicationAcceleratorComponent(_serialization.Model):
'''ApplicationAcceleratorComponent.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar name:
:vartype name: str
:ivar resource_requests:
:vartype resource_requests:
~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorResourceRequests
:ivar instances:
:vartype instances:
list[~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorInstance]
'''
def __init__(
self, *, resource_requests: Optional["_models.ApplicationAcceleratorResourceRequests"] = None, **kwargs: Any
) -> None:
'''
:keyword resource_requests:
:paramtype resource_requests:
~azure.mgmt.appplatform.v2023_12_01.models.ApplicationAcceleratorResourceRequests
'''
pass
| 2 | 2 | 12 | 0 | 7 | 5 | 1 | 0.94 | 1 | 2 | 0 | 0 | 1 | 3 | 1 | 16 | 38 | 5 | 17 | 9 | 13 | 16 | 8 | 7 | 6 | 1 | 2 | 0 | 1 |
8,439 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.AppResourceProperties
|
class AppResourceProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes
"""App resource properties payload.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar public: Indicates whether the App exposes public endpoint.
:vartype public: bool
:ivar url: URL of the App.
:vartype url: str
:ivar addon_configs: Collection of addons.
:vartype addon_configs: dict[str, JSON]
:ivar provisioning_state: Provisioning state of the App. Known values are: "Succeeded",
"Failed", "Creating", "Updating", and "Deleting".
:vartype provisioning_state: str or
~azure.mgmt.appplatform.v2023_12_01.models.AppResourceProvisioningState
:ivar fqdn: Fully qualified dns Name.
:vartype fqdn: str
:ivar https_only: Indicate if only https is allowed.
:vartype https_only: bool
:ivar temporary_disk: Temporary disk settings.
:vartype temporary_disk: ~azure.mgmt.appplatform.v2023_12_01.models.TemporaryDisk
:ivar persistent_disk: Persistent disk settings.
:vartype persistent_disk: ~azure.mgmt.appplatform.v2023_12_01.models.PersistentDisk
:ivar custom_persistent_disks: List of custom persistent disks.
:vartype custom_persistent_disks:
list[~azure.mgmt.appplatform.v2023_12_01.models.CustomPersistentDiskResource]
:ivar enable_end_to_end_tls: Indicate if end to end TLS is enabled.
:vartype enable_end_to_end_tls: bool
:ivar loaded_certificates: Collection of loaded certificates.
:vartype loaded_certificates:
list[~azure.mgmt.appplatform.v2023_12_01.models.LoadedCertificate]
:ivar vnet_addons: Additional App settings in vnet injection instance.
:vartype vnet_addons: ~azure.mgmt.appplatform.v2023_12_01.models.AppVNetAddons
:ivar ingress_settings: App ingress settings payload.
:vartype ingress_settings: ~azure.mgmt.appplatform.v2023_12_01.models.IngressSettings
"""
_validation = {
"url": {"readonly": True},
"provisioning_state": {"readonly": True},
"fqdn": {"readonly": True},
}
_attribute_map = {
"public": {"key": "public", "type": "bool"},
"url": {"key": "url", "type": "str"},
"addon_configs": {"key": "addonConfigs", "type": "{object}"},
"provisioning_state": {"key": "provisioningState", "type": "str"},
"fqdn": {"key": "fqdn", "type": "str"},
"https_only": {"key": "httpsOnly", "type": "bool"},
"temporary_disk": {"key": "temporaryDisk", "type": "TemporaryDisk"},
"persistent_disk": {"key": "persistentDisk", "type": "PersistentDisk"},
"custom_persistent_disks": {"key": "customPersistentDisks", "type": "[CustomPersistentDiskResource]"},
"enable_end_to_end_tls": {"key": "enableEndToEndTLS", "type": "bool"},
"loaded_certificates": {"key": "loadedCertificates", "type": "[LoadedCertificate]"},
"vnet_addons": {"key": "vnetAddons", "type": "AppVNetAddons"},
"ingress_settings": {"key": "ingressSettings", "type": "IngressSettings"},
}
def __init__(
self,
*,
public: Optional[bool] = None,
addon_configs: Optional[Dict[str, JSON]] = None,
https_only: bool = False,
temporary_disk: Optional["_models.TemporaryDisk"] = None,
persistent_disk: Optional["_models.PersistentDisk"] = None,
custom_persistent_disks: Optional[List["_models.CustomPersistentDiskResource"]] = None,
enable_end_to_end_tls: bool = False,
loaded_certificates: Optional[List["_models.LoadedCertificate"]] = None,
vnet_addons: Optional["_models.AppVNetAddons"] = None,
ingress_settings: Optional["_models.IngressSettings"] = None,
**kwargs: Any
) -> None:
"""
:keyword public: Indicates whether the App exposes public endpoint.
:paramtype public: bool
:keyword addon_configs: Collection of addons.
:paramtype addon_configs: dict[str, JSON]
:keyword https_only: Indicate if only https is allowed.
:paramtype https_only: bool
:keyword temporary_disk: Temporary disk settings.
:paramtype temporary_disk: ~azure.mgmt.appplatform.v2023_12_01.models.TemporaryDisk
:keyword persistent_disk: Persistent disk settings.
:paramtype persistent_disk: ~azure.mgmt.appplatform.v2023_12_01.models.PersistentDisk
:keyword custom_persistent_disks: List of custom persistent disks.
:paramtype custom_persistent_disks:
list[~azure.mgmt.appplatform.v2023_12_01.models.CustomPersistentDiskResource]
:keyword enable_end_to_end_tls: Indicate if end to end TLS is enabled.
:paramtype enable_end_to_end_tls: bool
:keyword loaded_certificates: Collection of loaded certificates.
:paramtype loaded_certificates:
list[~azure.mgmt.appplatform.v2023_12_01.models.LoadedCertificate]
:keyword vnet_addons: Additional App settings in vnet injection instance.
:paramtype vnet_addons: ~azure.mgmt.appplatform.v2023_12_01.models.AppVNetAddons
:keyword ingress_settings: App ingress settings payload.
:paramtype ingress_settings: ~azure.mgmt.appplatform.v2023_12_01.models.IngressSettings
"""
super().__init__(**kwargs)
self.public = public
self.url = None
self.addon_configs = addon_configs
self.provisioning_state = None
self.fqdn = None
self.https_only = https_only
self.temporary_disk = temporary_disk
self.persistent_disk = persistent_disk
self.custom_persistent_disks = custom_persistent_disks
self.enable_end_to_end_tls = enable_end_to_end_tls
self.loaded_certificates = loaded_certificates
self.vnet_addons = vnet_addons
self.ingress_settings = ingress_settings
|
class AppResourceProperties(_serialization.Model):
'''App resource properties payload.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar public: Indicates whether the App exposes public endpoint.
:vartype public: bool
:ivar url: URL of the App.
:vartype url: str
:ivar addon_configs: Collection of addons.
:vartype addon_configs: dict[str, JSON]
:ivar provisioning_state: Provisioning state of the App. Known values are: "Succeeded",
"Failed", "Creating", "Updating", and "Deleting".
:vartype provisioning_state: str or
~azure.mgmt.appplatform.v2023_12_01.models.AppResourceProvisioningState
:ivar fqdn: Fully qualified dns Name.
:vartype fqdn: str
:ivar https_only: Indicate if only https is allowed.
:vartype https_only: bool
:ivar temporary_disk: Temporary disk settings.
:vartype temporary_disk: ~azure.mgmt.appplatform.v2023_12_01.models.TemporaryDisk
:ivar persistent_disk: Persistent disk settings.
:vartype persistent_disk: ~azure.mgmt.appplatform.v2023_12_01.models.PersistentDisk
:ivar custom_persistent_disks: List of custom persistent disks.
:vartype custom_persistent_disks:
list[~azure.mgmt.appplatform.v2023_12_01.models.CustomPersistentDiskResource]
:ivar enable_end_to_end_tls: Indicate if end to end TLS is enabled.
:vartype enable_end_to_end_tls: bool
:ivar loaded_certificates: Collection of loaded certificates.
:vartype loaded_certificates:
list[~azure.mgmt.appplatform.v2023_12_01.models.LoadedCertificate]
:ivar vnet_addons: Additional App settings in vnet injection instance.
:vartype vnet_addons: ~azure.mgmt.appplatform.v2023_12_01.models.AppVNetAddons
:ivar ingress_settings: App ingress settings payload.
:vartype ingress_settings: ~azure.mgmt.appplatform.v2023_12_01.models.IngressSettings
'''
def __init__(
self,
*,
public: Optional[bool] = None,
addon_configs: Optional[Dict[str, JSON]] = None,
https_only: bool = False,
temporary_disk: Optional["_models.TemporaryDisk"] = None,
persistent_disk: Optional["_models.PersistentDisk"] = None,
custom_persistent_disks: Optional[List["_models.CustomPersistentDiskResource"]] = None,
enable_end_to_end_tls: bool = False,
loaded_certificates: Optional[List["_models.LoadedCertificate"]] = None,
vnet_addons: Optional["_models.AppVNetAddons"] = None,
ingress_settings: Optional["_models.IngressSettings"] = None,
**kwargs: Any
) -> None:
'''
:keyword public: Indicates whether the App exposes public endpoint.
:paramtype public: bool
:keyword addon_configs: Collection of addons.
:paramtype addon_configs: dict[str, JSON]
:keyword https_only: Indicate if only https is allowed.
:paramtype https_only: bool
:keyword temporary_disk: Temporary disk settings.
:paramtype temporary_disk: ~azure.mgmt.appplatform.v2023_12_01.models.TemporaryDisk
:keyword persistent_disk: Persistent disk settings.
:paramtype persistent_disk: ~azure.mgmt.appplatform.v2023_12_01.models.PersistentDisk
:keyword custom_persistent_disks: List of custom persistent disks.
:paramtype custom_persistent_disks:
list[~azure.mgmt.appplatform.v2023_12_01.models.CustomPersistentDiskResource]
:keyword enable_end_to_end_tls: Indicate if end to end TLS is enabled.
:paramtype enable_end_to_end_tls: bool
:keyword loaded_certificates: Collection of loaded certificates.
:paramtype loaded_certificates:
list[~azure.mgmt.appplatform.v2023_12_01.models.LoadedCertificate]
:keyword vnet_addons: Additional App settings in vnet injection instance.
:paramtype vnet_addons: ~azure.mgmt.appplatform.v2023_12_01.models.AppVNetAddons
:keyword ingress_settings: App ingress settings payload.
:paramtype ingress_settings: ~azure.mgmt.appplatform.v2023_12_01.models.IngressSettings
'''
pass
| 2 | 2 | 53 | 0 | 29 | 24 | 1 | 1.16 | 1 | 4 | 0 | 0 | 1 | 13 | 1 | 16 | 112 | 5 | 50 | 31 | 34 | 58 | 18 | 17 | 16 | 1 | 2 | 0 | 1 |
8,440 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/aio/operations/_config_servers_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.aio.operations._config_servers_operations.ConfigServersOperations
|
class ConfigServersOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`config_servers` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.ConfigServerResource:
"""Get the config server and its properties.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: ConfigServerResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("ConfigServerResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _update_put_initial(
self,
resource_group_name: str,
service_name: str,
config_server_resource: Union[_models.ConfigServerResource, IO[bytes]],
**kwargs: Any
) -> _models.ConfigServerResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(config_server_resource, (IOBase, bytes)):
_content = config_server_resource
else:
_json = self._serialize.body(config_server_resource, "ConfigServerResource")
_request = build_update_put_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("ConfigServerResource", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("ConfigServerResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_update_put(
self,
resource_group_name: str,
service_name: str,
config_server_resource: _models.ConfigServerResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerResource]:
"""Update the config 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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_resource: Parameters for the update operation. Required.
:type config_server_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_update_put(
self,
resource_group_name: str,
service_name: str,
config_server_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerResource]:
"""Update the config 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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_resource: Parameters for the update operation. Required.
:type config_server_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_update_put(
self,
resource_group_name: str,
service_name: str,
config_server_resource: Union[_models.ConfigServerResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerResource]:
"""Update the config 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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_resource: Parameters for the update operation. Is either a
ConfigServerResource type or a IO[bytes] type. Required.
:type config_server_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource
or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._update_put_initial(
resource_group_name=resource_group_name,
service_name=service_name,
config_server_resource=config_server_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ConfigServerResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.ConfigServerResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _update_patch_initial(
self,
resource_group_name: str,
service_name: str,
config_server_resource: Union[_models.ConfigServerResource, IO[bytes]],
**kwargs: Any
) -> _models.ConfigServerResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(config_server_resource, (IOBase, bytes)):
_content = config_server_resource
else:
_json = self._serialize.body(config_server_resource, "ConfigServerResource")
_request = build_update_patch_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("ConfigServerResource", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("ConfigServerResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_update_patch(
self,
resource_group_name: str,
service_name: str,
config_server_resource: _models.ConfigServerResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerResource]:
"""Update the config 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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_resource: Parameters for the update operation. Required.
:type config_server_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_update_patch(
self,
resource_group_name: str,
service_name: str,
config_server_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerResource]:
"""Update the config 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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_resource: Parameters for the update operation. Required.
:type config_server_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_update_patch(
self,
resource_group_name: str,
service_name: str,
config_server_resource: Union[_models.ConfigServerResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerResource]:
"""Update the config 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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_resource: Parameters for the update operation. Is either a
ConfigServerResource type or a IO[bytes] type. Required.
:type config_server_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource
or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ConfigServerResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._update_patch_initial(
resource_group_name=resource_group_name,
service_name=service_name,
config_server_resource=config_server_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ConfigServerResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.ConfigServerResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.ConfigServerResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _validate_initial(
self,
resource_group_name: str,
service_name: str,
config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]],
**kwargs: Any
) -> _models.ConfigServerSettingsValidateResult:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ConfigServerSettingsValidateResult] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(config_server_settings, (IOBase, bytes)):
_content = config_server_settings
else:
_json = self._serialize.body(config_server_settings, "ConfigServerSettings")
_request = build_validate_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
config_server_settings: _models.ConfigServerSettings,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]:
"""Check if the config server settings are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_settings: Config server settings to be validated. Required.
:type config_server_settings: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerSettings
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult
or the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerSettingsValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
config_server_settings: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]:
"""Check if the config server settings are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_settings: Config server settings to be validated. Required.
:type config_server_settings: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult
or the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerSettingsValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]:
"""Check if the config server settings are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_settings: Config server settings to be validated. Is either a
ConfigServerSettings type or a IO[bytes] type. Required.
:type config_server_settings: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerSettings
or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult
or the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerSettingsValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ConfigServerSettingsValidateResult] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._validate_initial(
resource_group_name=resource_group_name,
service_name=service_name,
config_server_settings=config_server_settings,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ConfigServerSettingsValidateResult", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
)
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.ConfigServerSettingsValidateResult].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.ConfigServerSettingsValidateResult](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
|
class ConfigServersOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.aio.AppPlatformManagementClient`'s
:attr:`config_servers` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace_async
async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.ConfigServerResource:
'''Get the config server and its properties.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: ConfigServerResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _update_put_initial(
self,
resource_group_name: str,
service_name: str,
config_server_resource: Union[_models.ConfigServerResource, IO[bytes]],
**kwargs: Any
) -> _models.ConfigServerResource:
pass
@overload
async def begin_update_put(
self,
resource_group_name: str,
service_name: str,
config_server_resource: _models.ConfigServerResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerResource]:
'''Update the config 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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_resource: Parameters for the update operation. Required.
:type config_server_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_update_put(
self,
resource_group_name: str,
service_name: str,
config_server_resource: _models.ConfigServerResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerResource]:
'''Update the config 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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_resource: Parameters for the update operation. Required.
:type config_server_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_update_put(
self,
resource_group_name: str,
service_name: str,
config_server_resource: _models.ConfigServerResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerResource]:
'''Update the config 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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_resource: Parameters for the update operation. Is either a
ConfigServerResource type or a IO[bytes] type. Required.
:type config_server_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource
or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _update_patch_initial(
self,
resource_group_name: str,
service_name: str,
config_server_resource: Union[_models.ConfigServerResource, IO[bytes]],
**kwargs: Any
) -> _models.ConfigServerResource:
pass
@overload
async def begin_update_patch(
self,
resource_group_name: str,
service_name: str,
config_server_resource: _models.ConfigServerResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerResource]:
'''Update the config 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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_resource: Parameters for the update operation. Required.
:type config_server_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_update_patch(
self,
resource_group_name: str,
service_name: str,
config_server_resource: _models.ConfigServerResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerResource]:
'''Update the config 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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_resource: Parameters for the update operation. Required.
:type config_server_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_update_patch(
self,
resource_group_name: str,
service_name: str,
config_server_resource: _models.ConfigServerResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerResource]:
'''Update the config 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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_resource: Parameters for the update operation. Is either a
ConfigServerResource type or a IO[bytes] type. Required.
:type config_server_resource: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource
or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ConfigServerResource or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _validate_initial(
self,
resource_group_name: str,
service_name: str,
config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]],
**kwargs: Any
) -> _models.ConfigServerSettingsValidateResult:
pass
@overload
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
config_server_settings: _models.ConfigServerSettings,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]:
'''Check if the config server settings are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_settings: Config server settings to be validated. Required.
:type config_server_settings: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerSettings
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult
or the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerSettingsValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
config_server_settings: _models.ConfigServerSettings,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]:
'''Check if the config server settings are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_settings: Config server settings to be validated. Required.
:type config_server_settings: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult
or the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerSettingsValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_validate(
self,
resource_group_name: str,
service_name: str,
config_server_settings: _models.ConfigServerSettings,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ConfigServerSettingsValidateResult]:
'''Check if the config server settings are valid.
: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. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param config_server_settings: Config server settings to be validated. Is either a
ConfigServerSettings type or a IO[bytes] type. Required.
:type config_server_settings: ~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerSettings
or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ConfigServerSettingsValidateResult
or the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ConfigServerSettingsValidateResult]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
| 28 | 11 | 38 | 4 | 25 | 11 | 3 | 0.44 | 0 | 7 | 0 | 0 | 14 | 5 | 14 | 14 | 662 | 77 | 418 | 201 | 306 | 185 | 197 | 107 | 179 | 6 | 0 | 1 | 54 |
8,441 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.AppResourceCollection
|
class AppResourceCollection(_serialization.Model):
"""Object that includes an array of App resources and a possible link for next set.
:ivar value: Collection of App resources.
:vartype value: list[~azure.mgmt.appplatform.v2023_12_01.models.AppResource]
:ivar next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:vartype next_link: str
"""
_attribute_map = {
"value": {"key": "value", "type": "[AppResource]"},
"next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
self, *, value: Optional[List["_models.AppResource"]] = None, next_link: Optional[str] = None, **kwargs: Any
) -> None:
"""
:keyword value: Collection of App resources.
:paramtype value: list[~azure.mgmt.appplatform.v2023_12_01.models.AppResource]
:keyword next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:paramtype next_link: str
"""
super().__init__(**kwargs)
self.value = value
self.next_link = next_link
|
class AppResourceCollection(_serialization.Model):
'''Object that includes an array of App resources and a possible link for next set.
:ivar value: Collection of App resources.
:vartype value: list[~azure.mgmt.appplatform.v2023_12_01.models.AppResource]
:ivar next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:vartype next_link: str
'''
def __init__(
self, *, value: Optional[List["_models.AppResource"]] = None, next_link: Optional[str] = None, **kwargs: Any
) -> None:
'''
:keyword value: Collection of App resources.
:paramtype value: list[~azure.mgmt.appplatform.v2023_12_01.models.AppResource]
:keyword next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:paramtype next_link: str
'''
pass
| 2 | 2 | 13 | 0 | 6 | 7 | 1 | 1.27 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 16 | 28 | 3 | 11 | 7 | 7 | 14 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
8,442 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApmResourceCollection
|
class ApmResourceCollection(_serialization.Model):
"""Object that includes an array of APM resources and a possible link for next set.
:ivar value: Collection of APM resources.
:vartype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApmResource]
:ivar next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:vartype next_link: str
"""
_attribute_map = {
"value": {"key": "value", "type": "[ApmResource]"},
"next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
self, *, value: Optional[List["_models.ApmResource"]] = None, next_link: Optional[str] = None, **kwargs: Any
) -> None:
"""
:keyword value: Collection of APM resources.
:paramtype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApmResource]
:keyword next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:paramtype next_link: str
"""
super().__init__(**kwargs)
self.value = value
self.next_link = next_link
|
class ApmResourceCollection(_serialization.Model):
'''Object that includes an array of APM resources and a possible link for next set.
:ivar value: Collection of APM resources.
:vartype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApmResource]
:ivar next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:vartype next_link: str
'''
def __init__(
self, *, value: Optional[List["_models.ApmResource"]] = None, next_link: Optional[str] = None, **kwargs: Any
) -> None:
'''
:keyword value: Collection of APM resources.
:paramtype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApmResource]
:keyword next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:paramtype next_link: str
'''
pass
| 2 | 2 | 13 | 0 | 6 | 7 | 1 | 1.27 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 16 | 28 | 3 | 11 | 7 | 7 | 14 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
8,443 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApmResource
|
class ApmResource(ProxyResource):
"""APM Resource object.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource Id for the resource.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource.
:vartype type: str
:ivar system_data: Metadata pertaining to creation and last modification of the resource.
:vartype system_data: ~azure.mgmt.appplatform.v2023_12_01.models.SystemData
:ivar properties: Properties of an APM.
:vartype properties: ~azure.mgmt.appplatform.v2023_12_01.models.ApmProperties
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"properties": {"key": "properties", "type": "ApmProperties"},
}
def __init__(self, *, properties: Optional["_models.ApmProperties"] = None, **kwargs: Any) -> None:
"""
:keyword properties: Properties of an APM.
:paramtype properties: ~azure.mgmt.appplatform.v2023_12_01.models.ApmProperties
"""
super().__init__(**kwargs)
self.properties = properties
|
class ApmResource(ProxyResource):
'''APM Resource object.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource Id for the resource.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource.
:vartype type: str
:ivar system_data: Metadata pertaining to creation and last modification of the resource.
:vartype system_data: ~azure.mgmt.appplatform.v2023_12_01.models.SystemData
:ivar properties: Properties of an APM.
:vartype properties: ~azure.mgmt.appplatform.v2023_12_01.models.ApmProperties
'''
def __init__(self, *, properties: Optional["_models.ApmProperties"] = None, **kwargs: Any) -> None:
'''
:keyword properties: Properties of an APM.
:paramtype properties: ~azure.mgmt.appplatform.v2023_12_01.models.ApmProperties
'''
pass
| 2 | 2 | 7 | 0 | 3 | 4 | 1 | 1 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 17 | 39 | 5 | 17 | 5 | 15 | 17 | 6 | 5 | 4 | 1 | 4 | 0 | 1 |
8,444 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApmProperties
|
class ApmProperties(_serialization.Model):
"""Properties of an APM.
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 server.
:ivar type: APM Type. Required.
:vartype type: str
:ivar provisioning_state: State of the APM. Known values are: "Creating", "Updating",
"Succeeded", "Failed", "Deleting", and "Canceled".
:vartype provisioning_state: str or
~azure.mgmt.appplatform.v2023_12_01.models.ApmProvisioningState
:ivar properties: Non-sensitive properties for the APM.
:vartype properties: dict[str, str]
:ivar secrets: Sensitive properties for the APM.
:vartype secrets: dict[str, str]
"""
_validation = {
"type": {"required": True},
"provisioning_state": {"readonly": True},
}
_attribute_map = {
"type": {"key": "type", "type": "str"},
"provisioning_state": {"key": "provisioningState", "type": "str"},
"properties": {"key": "properties", "type": "{str}"},
"secrets": {"key": "secrets", "type": "{str}"},
}
def __init__(
self,
*,
type: str,
properties: Optional[Dict[str, str]] = None,
secrets: Optional[Dict[str, str]] = None,
**kwargs: Any
) -> None:
"""
:keyword type: APM Type. Required.
:paramtype type: str
:keyword properties: Non-sensitive properties for the APM.
:paramtype properties: dict[str, str]
:keyword secrets: Sensitive properties for the APM.
:paramtype secrets: dict[str, str]
"""
super().__init__(**kwargs)
self.type = type
self.provisioning_state = None
self.properties = properties
self.secrets = secrets
|
class ApmProperties(_serialization.Model):
'''Properties of an APM.
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 server.
:ivar type: APM Type. Required.
:vartype type: str
:ivar provisioning_state: State of the APM. Known values are: "Creating", "Updating",
"Succeeded", "Failed", "Deleting", and "Canceled".
:vartype provisioning_state: str or
~azure.mgmt.appplatform.v2023_12_01.models.ApmProvisioningState
:ivar properties: Non-sensitive properties for the APM.
:vartype properties: dict[str, str]
:ivar secrets: Sensitive properties for the APM.
:vartype secrets: dict[str, str]
'''
def __init__(
self,
*,
type: str,
properties: Optional[Dict[str, str]] = None,
secrets: Optional[Dict[str, str]] = None,
**kwargs: Any
) -> None:
'''
:keyword type: APM Type. Required.
:paramtype type: str
:keyword properties: Non-sensitive properties for the APM.
:paramtype properties: dict[str, str]
:keyword secrets: Sensitive properties for the APM.
:paramtype secrets: dict[str, str]
'''
pass
| 2 | 2 | 21 | 0 | 13 | 8 | 1 | 0.92 | 1 | 3 | 0 | 0 | 1 | 4 | 1 | 16 | 52 | 6 | 24 | 15 | 15 | 22 | 9 | 8 | 7 | 1 | 2 | 0 | 1 |
8,445 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApiPortalResourceRequests
|
class ApiPortalResourceRequests(_serialization.Model):
"""Resource requests of the API portal.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar cpu: Cpu allocated to each API portal instance.
:vartype cpu: str
:ivar memory: Memory allocated to each API portal instance.
:vartype memory: str
"""
_validation = {
"cpu": {"readonly": True},
"memory": {"readonly": True},
}
_attribute_map = {
"cpu": {"key": "cpu", "type": "str"},
"memory": {"key": "memory", "type": "str"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.cpu = None
self.memory = None
|
class ApiPortalResourceRequests(_serialization.Model):
'''Resource requests of the API portal.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar cpu: Cpu allocated to each API portal instance.
:vartype cpu: str
:ivar memory: Memory allocated to each API portal instance.
:vartype memory: str
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 5 | 0 | 4 | 1 | 1 | 0.62 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 16 | 26 | 5 | 13 | 6 | 11 | 8 | 7 | 6 | 5 | 1 | 2 | 0 | 1 |
8,446 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApiPortalResourceCollection
|
class ApiPortalResourceCollection(_serialization.Model):
"""Object that includes an array of API portal resources and a possible link for next set.
:ivar value: Collection of API portal resources.
:vartype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalResource]
:ivar next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:vartype next_link: str
"""
_attribute_map = {
"value": {"key": "value", "type": "[ApiPortalResource]"},
"next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
self,
*,
value: Optional[List["_models.ApiPortalResource"]] = None,
next_link: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword value: Collection of API portal resources.
:paramtype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalResource]
:keyword next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:paramtype next_link: str
"""
super().__init__(**kwargs)
self.value = value
self.next_link = next_link
|
class ApiPortalResourceCollection(_serialization.Model):
'''Object that includes an array of API portal resources and a possible link for next set.
:ivar value: Collection of API portal resources.
:vartype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalResource]
:ivar next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:vartype next_link: str
'''
def __init__(
self,
*,
value: Optional[List["_models.ApiPortalResource"]] = None,
next_link: Optional[str] = None,
**kwargs: Any
) -> None:
'''
:keyword value: Collection of API portal resources.
:paramtype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalResource]
:keyword next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:paramtype next_link: str
'''
pass
| 2 | 2 | 17 | 0 | 10 | 7 | 1 | 0.93 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 16 | 32 | 3 | 15 | 11 | 7 | 14 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
8,447 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApiPortalResource
|
class ApiPortalResource(ProxyResource):
"""API portal resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource Id for the resource.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource.
:vartype type: str
:ivar system_data: Metadata pertaining to creation and last modification of the resource.
:vartype system_data: ~azure.mgmt.appplatform.v2023_12_01.models.SystemData
:ivar properties: API portal properties payload.
:vartype properties: ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalProperties
:ivar sku: Sku of the API portal resource.
:vartype sku: ~azure.mgmt.appplatform.v2023_12_01.models.Sku
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"properties": {"key": "properties", "type": "ApiPortalProperties"},
"sku": {"key": "sku", "type": "Sku"},
}
def __init__(
self,
*,
properties: Optional["_models.ApiPortalProperties"] = None,
sku: Optional["_models.Sku"] = None,
**kwargs: Any
) -> None:
"""
:keyword properties: API portal properties payload.
:paramtype properties: ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalProperties
:keyword sku: Sku of the API portal resource.
:paramtype sku: ~azure.mgmt.appplatform.v2023_12_01.models.Sku
"""
super().__init__(**kwargs)
self.properties = properties
self.sku = sku
|
class ApiPortalResource(ProxyResource):
'''API portal resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource Id for the resource.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource.
:vartype type: str
:ivar system_data: Metadata pertaining to creation and last modification of the resource.
:vartype system_data: ~azure.mgmt.appplatform.v2023_12_01.models.SystemData
:ivar properties: API portal properties payload.
:vartype properties: ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalProperties
:ivar sku: Sku of the API portal resource.
:vartype sku: ~azure.mgmt.appplatform.v2023_12_01.models.Sku
'''
def __init__(
self,
*,
properties: Optional["_models.ApiPortalProperties"] = None,
sku: Optional["_models.Sku"] = None,
**kwargs: Any
) -> None:
'''
:keyword properties: API portal properties payload.
:paramtype properties: ~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalProperties
:keyword sku: Sku of the API portal resource.
:paramtype sku: ~azure.mgmt.appplatform.v2023_12_01.models.Sku
'''
pass
| 2 | 2 | 16 | 0 | 10 | 6 | 1 | 0.84 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 17 | 51 | 5 | 25 | 12 | 17 | 21 | 7 | 6 | 5 | 1 | 4 | 0 | 1 |
8,448 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApiPortalProperties
|
class ApiPortalProperties(_serialization.Model):
"""API portal properties payload.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar provisioning_state: State of the API portal. Known values are: "Creating", "Updating",
"Succeeded", "Failed", and "Deleting".
:vartype provisioning_state: str or
~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalProvisioningState
:ivar public: Indicates whether the API portal exposes endpoint.
:vartype public: bool
:ivar url: URL of the API portal, exposed when 'public' is true.
:vartype url: str
:ivar https_only: Indicate if only https is allowed.
:vartype https_only: bool
:ivar gateway_ids: The array of resource Ids of gateway to integrate with API portal.
:vartype gateway_ids: list[str]
:ivar source_urls: Collection of OpenAPI source URL locations.
:vartype source_urls: list[str]
:ivar sso_properties: Single sign-on related configuration.
:vartype sso_properties: ~azure.mgmt.appplatform.v2023_12_01.models.SsoProperties
:ivar resource_requests: The requested resource quantity for required CPU and Memory.
:vartype resource_requests:
~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalResourceRequests
:ivar instances: Collection of instances belong to API portal.
:vartype instances: list[~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalInstance]
:ivar api_try_out_enabled_state: Indicates whether the API try-out feature is enabled or
disabled. When enabled, users can try out the API by sending requests and viewing responses in
API portal. When disabled, users cannot try out the API. Known values are: "Enabled" and
"Disabled".
:vartype api_try_out_enabled_state: str or
~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalApiTryOutEnabledState
"""
_validation = {
"provisioning_state": {"readonly": True},
"url": {"readonly": True},
"resource_requests": {"readonly": True},
"instances": {"readonly": True},
}
_attribute_map = {
"provisioning_state": {"key": "provisioningState", "type": "str"},
"public": {"key": "public", "type": "bool"},
"url": {"key": "url", "type": "str"},
"https_only": {"key": "httpsOnly", "type": "bool"},
"gateway_ids": {"key": "gatewayIds", "type": "[str]"},
"source_urls": {"key": "sourceUrls", "type": "[str]"},
"sso_properties": {"key": "ssoProperties", "type": "SsoProperties"},
"resource_requests": {"key": "resourceRequests", "type": "ApiPortalResourceRequests"},
"instances": {"key": "instances", "type": "[ApiPortalInstance]"},
"api_try_out_enabled_state": {"key": "apiTryOutEnabledState", "type": "str"},
}
def __init__(
self,
*,
public: bool = False,
https_only: bool = False,
gateway_ids: Optional[List[str]] = None,
source_urls: Optional[List[str]] = None,
sso_properties: Optional["_models.SsoProperties"] = None,
api_try_out_enabled_state: Union[str, "_models.ApiPortalApiTryOutEnabledState"] = "Enabled",
**kwargs: Any
) -> None:
"""
:keyword public: Indicates whether the API portal exposes endpoint.
:paramtype public: bool
:keyword https_only: Indicate if only https is allowed.
:paramtype https_only: bool
:keyword gateway_ids: The array of resource Ids of gateway to integrate with API portal.
:paramtype gateway_ids: list[str]
:keyword source_urls: Collection of OpenAPI source URL locations.
:paramtype source_urls: list[str]
:keyword sso_properties: Single sign-on related configuration.
:paramtype sso_properties: ~azure.mgmt.appplatform.v2023_12_01.models.SsoProperties
:keyword api_try_out_enabled_state: Indicates whether the API try-out feature is enabled or
disabled. When enabled, users can try out the API by sending requests and viewing responses in
API portal. When disabled, users cannot try out the API. Known values are: "Enabled" and
"Disabled".
:paramtype api_try_out_enabled_state: str or
~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalApiTryOutEnabledState
"""
super().__init__(**kwargs)
self.provisioning_state = None
self.public = public
self.url = None
self.https_only = https_only
self.gateway_ids = gateway_ids
self.source_urls = source_urls
self.sso_properties = sso_properties
self.resource_requests = None
self.instances = None
self.api_try_out_enabled_state = api_try_out_enabled_state
|
class ApiPortalProperties(_serialization.Model):
'''API portal properties payload.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar provisioning_state: State of the API portal. Known values are: "Creating", "Updating",
"Succeeded", "Failed", and "Deleting".
:vartype provisioning_state: str or
~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalProvisioningState
:ivar public: Indicates whether the API portal exposes endpoint.
:vartype public: bool
:ivar url: URL of the API portal, exposed when 'public' is true.
:vartype url: str
:ivar https_only: Indicate if only https is allowed.
:vartype https_only: bool
:ivar gateway_ids: The array of resource Ids of gateway to integrate with API portal.
:vartype gateway_ids: list[str]
:ivar source_urls: Collection of OpenAPI source URL locations.
:vartype source_urls: list[str]
:ivar sso_properties: Single sign-on related configuration.
:vartype sso_properties: ~azure.mgmt.appplatform.v2023_12_01.models.SsoProperties
:ivar resource_requests: The requested resource quantity for required CPU and Memory.
:vartype resource_requests:
~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalResourceRequests
:ivar instances: Collection of instances belong to API portal.
:vartype instances: list[~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalInstance]
:ivar api_try_out_enabled_state: Indicates whether the API try-out feature is enabled or
disabled. When enabled, users can try out the API by sending requests and viewing responses in
API portal. When disabled, users cannot try out the API. Known values are: "Enabled" and
"Disabled".
:vartype api_try_out_enabled_state: str or
~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalApiTryOutEnabledState
'''
def __init__(
self,
*,
public: bool = False,
https_only: bool = False,
gateway_ids: Optional[List[str]] = None,
source_urls: Optional[List[str]] = None,
sso_properties: Optional["_models.SsoProperties"] = None,
api_try_out_enabled_state: Union[str, "_models.ApiPortalApiTryOutEnabledState"] = "Enabled",
**kwargs: Any
) -> None:
'''
:keyword public: Indicates whether the API portal exposes endpoint.
:paramtype public: bool
:keyword https_only: Indicate if only https is allowed.
:paramtype https_only: bool
:keyword gateway_ids: The array of resource Ids of gateway to integrate with API portal.
:paramtype gateway_ids: list[str]
:keyword source_urls: Collection of OpenAPI source URL locations.
:paramtype source_urls: list[str]
:keyword sso_properties: Single sign-on related configuration.
:paramtype sso_properties: ~azure.mgmt.appplatform.v2023_12_01.models.SsoProperties
:keyword api_try_out_enabled_state: Indicates whether the API try-out feature is enabled or
disabled. When enabled, users can try out the API by sending requests and viewing responses in
API portal. When disabled, users cannot try out the API. Known values are: "Enabled" and
"Disabled".
:paramtype api_try_out_enabled_state: str or
~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalApiTryOutEnabledState
'''
pass
| 2 | 2 | 40 | 0 | 22 | 18 | 1 | 1.17 | 1 | 4 | 0 | 0 | 1 | 10 | 1 | 16 | 94 | 5 | 41 | 24 | 29 | 48 | 15 | 14 | 13 | 1 | 2 | 0 | 1 |
8,449 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.ApiPortalCustomDomainResourceCollection
|
class ApiPortalCustomDomainResourceCollection(_serialization.Model):
"""Object that includes an array of API portal custom domain resources and a possible link for
next set.
:ivar value: Collection of API portal custom domain resources.
:vartype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalCustomDomainResource]
:ivar next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:vartype next_link: str
"""
_attribute_map = {
"value": {"key": "value", "type": "[ApiPortalCustomDomainResource]"},
"next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
self,
*,
value: Optional[List["_models.ApiPortalCustomDomainResource"]] = None,
next_link: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword value: Collection of API portal custom domain resources.
:paramtype value:
list[~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalCustomDomainResource]
:keyword next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:paramtype next_link: str
"""
super().__init__(**kwargs)
self.value = value
self.next_link = next_link
|
class ApiPortalCustomDomainResourceCollection(_serialization.Model):
'''Object that includes an array of API portal custom domain resources and a possible link for
next set.
:ivar value: Collection of API portal custom domain resources.
:vartype value: list[~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalCustomDomainResource]
:ivar next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:vartype next_link: str
'''
def __init__(
self,
*,
value: Optional[List["_models.ApiPortalCustomDomainResource"]] = None,
next_link: Optional[str] = None,
**kwargs: Any
) -> None:
'''
:keyword value: Collection of API portal custom domain resources.
:paramtype value:
list[~azure.mgmt.appplatform.v2023_12_01.models.ApiPortalCustomDomainResource]
:keyword next_link: URL client should use to fetch the next page (per server side paging).
It's null for now, added for future use.
:paramtype next_link: str
'''
pass
| 2 | 2 | 18 | 0 | 10 | 8 | 1 | 1.07 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 16 | 34 | 3 | 15 | 11 | 7 | 16 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
8,450 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.AppResource
|
class AppResource(ProxyResource):
"""App resource payload.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource Id for the resource.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource.
:vartype type: str
:ivar system_data: Metadata pertaining to creation and last modification of the resource.
:vartype system_data: ~azure.mgmt.appplatform.v2023_12_01.models.SystemData
:ivar properties: Properties of the App resource.
:vartype properties: ~azure.mgmt.appplatform.v2023_12_01.models.AppResourceProperties
:ivar identity: The Managed Identity type of the app resource.
:vartype identity: ~azure.mgmt.appplatform.v2023_12_01.models.ManagedIdentityProperties
:ivar location: The GEO location of the application, always the same with its parent resource.
:vartype location: str
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"properties": {"key": "properties", "type": "AppResourceProperties"},
"identity": {"key": "identity", "type": "ManagedIdentityProperties"},
"location": {"key": "location", "type": "str"},
}
def __init__(
self,
*,
properties: Optional["_models.AppResourceProperties"] = None,
identity: Optional["_models.ManagedIdentityProperties"] = None,
location: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword properties: Properties of the App resource.
:paramtype properties: ~azure.mgmt.appplatform.v2023_12_01.models.AppResourceProperties
:keyword identity: The Managed Identity type of the app resource.
:paramtype identity: ~azure.mgmt.appplatform.v2023_12_01.models.ManagedIdentityProperties
:keyword location: The GEO location of the application, always the same with its parent
resource.
:paramtype location: str
"""
super().__init__(**kwargs)
self.properties = properties
self.identity = identity
self.location = location
|
class AppResource(ProxyResource):
'''App resource payload.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource Id for the resource.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource.
:vartype type: str
:ivar system_data: Metadata pertaining to creation and last modification of the resource.
:vartype system_data: ~azure.mgmt.appplatform.v2023_12_01.models.SystemData
:ivar properties: Properties of the App resource.
:vartype properties: ~azure.mgmt.appplatform.v2023_12_01.models.AppResourceProperties
:ivar identity: The Managed Identity type of the app resource.
:vartype identity: ~azure.mgmt.appplatform.v2023_12_01.models.ManagedIdentityProperties
:ivar location: The GEO location of the application, always the same with its parent resource.
:vartype location: str
'''
def __init__(
self,
*,
properties: Optional["_models.AppResourceProperties"] = None,
identity: Optional["_models.ManagedIdentityProperties"] = None,
location: Optional[str] = None,
**kwargs: Any
) -> None:
'''
:keyword properties: Properties of the App resource.
:paramtype properties: ~azure.mgmt.appplatform.v2023_12_01.models.AppResourceProperties
:keyword identity: The Managed Identity type of the app resource.
:paramtype identity: ~azure.mgmt.appplatform.v2023_12_01.models.ManagedIdentityProperties
:keyword location: The GEO location of the application, always the same with its parent
resource.
:paramtype location: str
'''
pass
| 2 | 2 | 21 | 0 | 12 | 9 | 1 | 0.93 | 1 | 3 | 0 | 0 | 1 | 3 | 1 | 17 | 59 | 5 | 28 | 14 | 19 | 26 | 8 | 7 | 6 | 1 | 4 | 0 | 1 |
8,451 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/baremetalmachine/_update.py
|
azext_networkcloud.aaz.latest.networkcloud.baremetalmachine._update.Update.BareMetalMachinesUpdate
|
class BareMetalMachinesUpdate(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [202]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}",
**self.url_parameters
)
@property
def method(self):
return "PATCH"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"bareMetalMachineName", self.ctx.args.bare_metal_machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-02-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"If-Match", self.ctx.args.if_match,
),
**self.serialize_header_param(
"If-None-Match", self.ctx.args.if_none_match,
),
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={"flags": {"client_flatten": True}}
)
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
_builder.set_prop("tags", AAZDictType, ".tags")
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop(
"machineDetails", AAZStrType, ".machine_details")
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return self.serialize_content(_content_value)
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_UpdateHelper._build_schema_bare_metal_machine_read(
cls._schema_on_200)
return cls._schema_on_200
|
class BareMetalMachinesUpdate(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
@property
def content(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 19 | 0 | 11 | 1 | 10 | 0 | 2 | 0 | 1 | 1 | 1 | 0 | 9 | 1 | 10 | 10 | 127 | 17 | 110 | 31 | 91 | 0 | 46 | 22 | 35 | 3 | 1 | 1 | 15 |
8,452 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_delete.py
|
azext_networkcloud.aaz.latest.networkcloud.cloudservicesnetwork._delete.Delete.CloudServicesNetworksDelete
|
class CloudServicesNetworksDelete(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [202]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [204]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_204,
self.on_error,
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200, 201]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}",
**self.url_parameters
)
@property
def method(self):
return "DELETE"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"cloudServicesNetworkName", self.ctx.args.cloud_services_network_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-02-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"If-Match", self.ctx.args.if_match,
),
**self.serialize_header_param(
"If-None-Match", self.ctx.args.if_none_match,
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_204(self, session):
pass
def on_200_201(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200_201
)
_schema_on_200_201 = None
@classmethod
def _build_schema_on_200_201(cls):
if cls._schema_on_200_201 is not None:
return cls._schema_on_200_201
cls._schema_on_200_201 = AAZObjectType()
_DeleteHelper._build_schema_operation_status_result_read(
cls._schema_on_200_201)
return cls._schema_on_200_201
|
class CloudServicesNetworksDelete(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_204(self, session):
pass
def on_200_201(self, session):
pass
@classmethod
def _build_schema_on_200_201(cls):
pass
| 18 | 0 | 10 | 0 | 9 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 9 | 1 | 10 | 10 | 116 | 14 | 102 | 27 | 84 | 0 | 39 | 19 | 28 | 4 | 1 | 1 | 14 |
8,453 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/networkcloud/azext_networkcloud/aaz/latest/networkcloud/cloudservicesnetwork/_create.py
|
azext_networkcloud.aaz.latest.networkcloud.cloudservicesnetwork._create.Create.CloudServicesNetworksCreateOrUpdate
|
class CloudServicesNetworksCreateOrUpdate(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [202]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200, 201]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"cloudServicesNetworkName", self.ctx.args.cloud_services_network_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-02-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"If-Match", self.ctx.args.if_match,
),
**self.serialize_header_param(
"If-None-Match", self.ctx.args.if_none_match,
),
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={
"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("extendedLocation", AAZObjectType, ".extended_location", typ_kwargs={
"flags": {"required": True}})
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={
"flags": {"required": True}})
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
_builder.set_prop("tags", AAZDictType, ".tags")
extended_location = _builder.get(".extendedLocation")
if extended_location is not None:
extended_location.set_prop("name", AAZStrType, ".name", typ_kwargs={
"flags": {"required": True}})
extended_location.set_prop("type", AAZStrType, ".type", typ_kwargs={
"flags": {"required": True}})
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("additionalEgressEndpoints",
AAZListType, ".additional_egress_endpoints")
properties.set_prop(
"enableDefaultEgressEndpoints", AAZStrType, ".enable_default_egress_endpoints")
additional_egress_endpoints = _builder.get(
".properties.additionalEgressEndpoints")
if additional_egress_endpoints is not None:
additional_egress_endpoints.set_elements(AAZObjectType, ".")
_elements = _builder.get(".properties.additionalEgressEndpoints[]")
if _elements is not None:
_elements.set_prop("category", AAZStrType, ".category", typ_kwargs={
"flags": {"required": True}})
_elements.set_prop("endpoints", AAZListType, ".endpoints", typ_kwargs={
"flags": {"required": True}})
endpoints = _builder.get(
".properties.additionalEgressEndpoints[].endpoints")
if endpoints is not None:
endpoints.set_elements(AAZObjectType, ".")
_elements = _builder.get(
".properties.additionalEgressEndpoints[].endpoints[]")
if _elements is not None:
_elements.set_prop("domainName", AAZStrType, ".domain_name", typ_kwargs={
"flags": {"required": True}})
_elements.set_prop("port", AAZIntType, ".port")
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return self.serialize_content(_content_value)
def on_200_201(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200_201
)
_schema_on_200_201 = None
@classmethod
def _build_schema_on_200_201(cls):
if cls._schema_on_200_201 is not None:
return cls._schema_on_200_201
cls._schema_on_200_201 = AAZObjectType()
_schema_on_200_201 = cls._schema_on_200_201
_schema_on_200_201.etag = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.extended_location = AAZObjectType(
serialized_name="extendedLocation",
flags={"required": True},
)
_schema_on_200_201.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.location = AAZStrType(
flags={"required": True},
)
_schema_on_200_201.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200_201.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200_201.tags = AAZDictType()
_schema_on_200_201.type = AAZStrType(
flags={"read_only": True},
)
extended_location = cls._schema_on_200_201.extended_location
extended_location.name = AAZStrType(
flags={"required": True},
)
extended_location.type = AAZStrType(
flags={"required": True},
)
properties = cls._schema_on_200_201.properties
properties.additional_egress_endpoints = AAZListType(
serialized_name="additionalEgressEndpoints",
)
properties.associated_resource_ids = AAZListType(
serialized_name="associatedResourceIds",
flags={"read_only": True},
)
properties.cluster_id = AAZStrType(
serialized_name="clusterId",
flags={"read_only": True},
)
properties.detailed_status = AAZStrType(
serialized_name="detailedStatus",
flags={"read_only": True},
)
properties.detailed_status_message = AAZStrType(
serialized_name="detailedStatusMessage",
flags={"read_only": True},
)
properties.enable_default_egress_endpoints = AAZStrType(
serialized_name="enableDefaultEgressEndpoints",
)
properties.enabled_egress_endpoints = AAZListType(
serialized_name="enabledEgressEndpoints",
flags={"read_only": True},
)
properties.hybrid_aks_clusters_associated_ids = AAZListType(
serialized_name="hybridAksClustersAssociatedIds",
flags={"read_only": True},
)
properties.interface_name = AAZStrType(
serialized_name="interfaceName",
flags={"read_only": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.virtual_machines_associated_ids = AAZListType(
serialized_name="virtualMachinesAssociatedIds",
flags={"read_only": True},
)
additional_egress_endpoints = cls._schema_on_200_201.properties.additional_egress_endpoints
additional_egress_endpoints.Element = AAZObjectType()
_CreateHelper._build_schema_egress_endpoint_read(
additional_egress_endpoints.Element)
associated_resource_ids = cls._schema_on_200_201.properties.associated_resource_ids
associated_resource_ids.Element = AAZStrType()
enabled_egress_endpoints = cls._schema_on_200_201.properties.enabled_egress_endpoints
enabled_egress_endpoints.Element = AAZObjectType()
_CreateHelper._build_schema_egress_endpoint_read(
enabled_egress_endpoints.Element)
hybrid_aks_clusters_associated_ids = cls._schema_on_200_201.properties.hybrid_aks_clusters_associated_ids
hybrid_aks_clusters_associated_ids.Element = AAZStrType()
virtual_machines_associated_ids = cls._schema_on_200_201.properties.virtual_machines_associated_ids
virtual_machines_associated_ids.Element = AAZStrType()
system_data = cls._schema_on_200_201.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200_201.tags
tags.Element = AAZStrType()
return cls._schema_on_200_201
|
class CloudServicesNetworksCreateOrUpdate(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
@property
def content(self):
pass
def on_200_201(self, session):
pass
@classmethod
def _build_schema_on_200_201(cls):
pass
| 19 | 0 | 25 | 2 | 23 | 0 | 2 | 0 | 1 | 1 | 1 | 0 | 9 | 1 | 10 | 10 | 273 | 32 | 241 | 45 | 222 | 0 | 112 | 36 | 101 | 8 | 1 | 1 | 20 |
8,454 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/wns/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.credential.wns._create.Create.NotificationHubsGet
|
class NotificationHubsGet(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"notificationHubName", self.ctx.args.notification_hub_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_CreateHelper._build_schema_notification_hub_resource_read(
cls._schema_on_200)
return cls._schema_on_200
|
class NotificationHubsGet(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 86 | 13 | 73 | 25 | 56 | 0 | 33 | 18 | 23 | 2 | 1 | 1 | 11 |
8,455 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/wns/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.credential.wns._create.Create.NotificationHubsCreateOrUpdate
|
class NotificationHubsCreateOrUpdate(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200, 201]:
return self.on_200_201(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"notificationHubName", self.ctx.args.notification_hub_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
value=self.ctx.vars.instance,
)
return self.serialize_content(_content_value)
def on_200_201(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200_201
)
_schema_on_200_201 = None
@classmethod
def _build_schema_on_200_201(cls):
if cls._schema_on_200_201 is not None:
return cls._schema_on_200_201
cls._schema_on_200_201 = AAZObjectType()
_CreateHelper._build_schema_notification_hub_resource_read(
cls._schema_on_200_201)
return cls._schema_on_200_201
|
class NotificationHubsCreateOrUpdate(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
@property
def content(self):
pass
def on_200_201(self, session):
pass
@classmethod
def _build_schema_on_200_201(cls):
pass
| 19 | 0 | 8 | 0 | 7 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 9 | 0 | 10 | 10 | 98 | 15 | 83 | 28 | 64 | 0 | 36 | 20 | 25 | 2 | 1 | 1 | 12 |
8,456 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/wns/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.credential.wns._create.Create.InstanceCreateByJson
|
class InstanceCreateByJson(AAZJsonInstanceCreateOperation):
def __call__(self, *args, **kwargs):
self.ctx.selectors.subresource.set(self._create_instance())
def _create_instance(self):
_instance_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType
)
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("packageSid", AAZStrType, ".package_sid")
properties.set_prop("secretKey", AAZStrType, ".secret_key")
return _instance_value
|
class InstanceCreateByJson(AAZJsonInstanceCreateOperation):
def __call__(self, *args, **kwargs):
pass
def _create_instance(self):
pass
| 3 | 0 | 8 | 1 | 7 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 18 | 4 | 14 | 5 | 11 | 0 | 11 | 5 | 8 | 2 | 1 | 1 | 3 |
8,457 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/mpns/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.credential.mpns._create.Create.SubresourceSelector
|
class SubresourceSelector(AAZJsonSelector):
def _get(self):
result = self.ctx.vars.instance
return result.properties.mpnsCredential
def _set(self, value):
result = self.ctx.vars.instance
result.properties.mpnsCredential = value
return
|
class SubresourceSelector(AAZJsonSelector):
def _get(self):
pass
def _set(self, value):
pass
| 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 10 | 2 | 8 | 5 | 5 | 0 | 8 | 5 | 5 | 1 | 1 | 0 | 2 |
8,458 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/mpns/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.credential.mpns._create.Create.InstanceCreateByJson
|
class InstanceCreateByJson(AAZJsonInstanceCreateOperation):
def __call__(self, *args, **kwargs):
self.ctx.selectors.subresource.set(self._create_instance())
def _create_instance(self):
_instance_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType
)
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop(
"certificateKey", AAZStrType, ".certificate_key")
properties.set_prop("mpnsCertificate",
AAZStrType, ".mpns_certificate_org")
return _instance_value
|
class InstanceCreateByJson(AAZJsonInstanceCreateOperation):
def __call__(self, *args, **kwargs):
pass
def _create_instance(self):
pass
| 3 | 0 | 8 | 1 | 7 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 18 | 4 | 14 | 5 | 11 | 0 | 11 | 5 | 8 | 2 | 1 | 1 | 3 |
8,459 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/gcm/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.credential.gcm._create.Create.SubresourceSelector
|
class SubresourceSelector(AAZJsonSelector):
def _get(self):
result = self.ctx.vars.instance
return result.properties.gcmCredential
def _set(self, value):
result = self.ctx.vars.instance
result.properties.gcmCredential = value
return
|
class SubresourceSelector(AAZJsonSelector):
def _get(self):
pass
def _set(self, value):
pass
| 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 10 | 2 | 8 | 5 | 5 | 0 | 8 | 5 | 5 | 1 | 1 | 0 | 2 |
8,460 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/gcm/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.credential.gcm._create.Create.InstanceCreateByJson
|
class InstanceCreateByJson(AAZJsonInstanceCreateOperation):
def __call__(self, *args, **kwargs):
self.ctx.selectors.subresource.set(self._create_instance())
def _create_instance(self):
_instance_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType
)
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop(
"googleApiKey", AAZStrType, ".google_api_key")
return _instance_value
|
class InstanceCreateByJson(AAZJsonInstanceCreateOperation):
def __call__(self, *args, **kwargs):
pass
def _create_instance(self):
pass
| 3 | 0 | 7 | 1 | 6 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 17 | 4 | 13 | 5 | 10 | 0 | 10 | 5 | 7 | 2 | 1 | 1 | 3 |
8,461 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/baidu/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.credential.baidu._create.Create.SubresourceSelector
|
class SubresourceSelector(AAZJsonSelector):
def _get(self):
result = self.ctx.vars.instance
return result.properties.baiduCredential
def _set(self, value):
result = self.ctx.vars.instance
result.properties.baiduCredential = value
return
|
class SubresourceSelector(AAZJsonSelector):
def _get(self):
pass
def _set(self, value):
pass
| 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 10 | 2 | 8 | 5 | 5 | 0 | 8 | 5 | 5 | 1 | 1 | 0 | 2 |
8,462 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/baidu/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.credential.baidu._create.Create.InstanceCreateByJson
|
class InstanceCreateByJson(AAZJsonInstanceCreateOperation):
def __call__(self, *args, **kwargs):
self.ctx.selectors.subresource.set(self._create_instance())
def _create_instance(self):
_instance_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType
)
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop(
"baiduApiKey", AAZStrType, ".baidu_api_key")
properties.set_prop(
"baiduSecretKey", AAZStrType, ".baidu_secret_key")
return _instance_value
|
class InstanceCreateByJson(AAZJsonInstanceCreateOperation):
def __call__(self, *args, **kwargs):
pass
def _create_instance(self):
pass
| 3 | 0 | 8 | 1 | 7 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 18 | 4 | 14 | 5 | 11 | 0 | 11 | 5 | 8 | 2 | 1 | 1 | 3 |
8,463 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/apns/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.credential.apns._create.Create.SubresourceSelector
|
class SubresourceSelector(AAZJsonSelector):
def _get(self):
result = self.ctx.vars.instance
return result.properties.apnsCredential
def _set(self, value):
result = self.ctx.vars.instance
result.properties.apnsCredential = value
return
|
class SubresourceSelector(AAZJsonSelector):
def _get(self):
pass
def _set(self, value):
pass
| 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 10 | 2 | 8 | 5 | 5 | 0 | 8 | 5 | 5 | 1 | 1 | 0 | 2 |
8,464 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/apns/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.credential.apns._create.Create.InstanceCreateByJson
|
class InstanceCreateByJson(AAZJsonInstanceCreateOperation):
def __call__(self, *args, **kwargs):
self.ctx.selectors.subresource.set(self._create_instance())
def _create_instance(self):
_instance_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType
)
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("apnsCertificate",
AAZStrType, ".apns_certificate_org")
properties.set_prop("appId", AAZStrType, ".app_id")
properties.set_prop("appName", AAZStrType, ".app_name")
properties.set_prop(
"certificateKey", AAZStrType, ".certificate_key")
properties.set_prop("endpoint", AAZStrType, ".endpoint")
properties.set_prop("keyId", AAZStrType, ".key_id")
properties.set_prop("token", AAZStrType, ".token")
return _instance_value
|
class InstanceCreateByJson(AAZJsonInstanceCreateOperation):
def __call__(self, *args, **kwargs):
pass
def _create_instance(self):
pass
| 3 | 0 | 10 | 1 | 9 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 23 | 4 | 19 | 5 | 16 | 0 | 16 | 5 | 13 | 2 | 1 | 1 | 3 |
8,465 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/adm/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.credential.adm._create.Create.SubresourceSelector
|
class SubresourceSelector(AAZJsonSelector):
def _get(self):
result = self.ctx.vars.instance
return result.properties.admCredential
def _set(self, value):
result = self.ctx.vars.instance
result.properties.admCredential = value
return
|
class SubresourceSelector(AAZJsonSelector):
def _get(self):
pass
def _set(self, value):
pass
| 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 10 | 2 | 8 | 5 | 5 | 0 | 8 | 5 | 5 | 1 | 1 | 0 | 2 |
8,466 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/adm/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.credential.adm._create.Create.InstanceCreateByJson
|
class InstanceCreateByJson(AAZJsonInstanceCreateOperation):
def __call__(self, *args, **kwargs):
self.ctx.selectors.subresource.set(self._create_instance())
def _create_instance(self):
_instance_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType
)
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("clientId", AAZStrType, ".client_id")
properties.set_prop(
"clientSecret", AAZStrType, ".client_secret")
return _instance_value
|
class InstanceCreateByJson(AAZJsonInstanceCreateOperation):
def __call__(self, *args, **kwargs):
pass
def _create_instance(self):
pass
| 3 | 0 | 8 | 1 | 7 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 18 | 4 | 14 | 5 | 11 | 0 | 11 | 5 | 8 | 2 | 1 | 1 | 3 |
8,467 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/_list.py
|
azext_notification_hub.aaz.latest.notification_hub.credential._list.List.NotificationHubsGetPnsCredentials
|
class NotificationHubsGetPnsCredentials(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials",
**self.url_parameters
)
@property
def method(self):
return "POST"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"notificationHubName", self.ctx.args.notification_hub_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType()
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.sku = AAZObjectType()
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.adm_credential = AAZObjectType(
serialized_name="admCredential",
)
properties.apns_credential = AAZObjectType(
serialized_name="apnsCredential",
)
properties.baidu_credential = AAZObjectType(
serialized_name="baiduCredential",
)
properties.gcm_credential = AAZObjectType(
serialized_name="gcmCredential",
)
properties.mpns_credential = AAZObjectType(
serialized_name="mpnsCredential",
)
properties.wns_credential = AAZObjectType(
serialized_name="wnsCredential",
)
adm_credential = cls._schema_on_200.properties.adm_credential
adm_credential.properties = AAZObjectType(
flags={"client_flatten": True},
)
properties = cls._schema_on_200.properties.adm_credential.properties
properties.auth_token_url = AAZStrType(
serialized_name="authTokenUrl",
)
properties.client_id = AAZStrType(
serialized_name="clientId",
)
properties.client_secret = AAZStrType(
serialized_name="clientSecret",
)
apns_credential = cls._schema_on_200.properties.apns_credential
apns_credential.properties = AAZObjectType(
flags={"client_flatten": True},
)
properties = cls._schema_on_200.properties.apns_credential.properties
properties.apns_certificate = AAZStrType(
serialized_name="apnsCertificate",
)
properties.app_id = AAZStrType(
serialized_name="appId",
)
properties.app_name = AAZStrType(
serialized_name="appName",
)
properties.certificate_key = AAZStrType(
serialized_name="certificateKey",
)
properties.endpoint = AAZStrType()
properties.key_id = AAZStrType(
serialized_name="keyId",
)
properties.thumbprint = AAZStrType()
properties.token = AAZStrType()
baidu_credential = cls._schema_on_200.properties.baidu_credential
baidu_credential.properties = AAZObjectType(
flags={"client_flatten": True},
)
properties = cls._schema_on_200.properties.baidu_credential.properties
properties.baidu_api_key = AAZStrType(
serialized_name="baiduApiKey",
)
properties.baidu_end_point = AAZStrType(
serialized_name="baiduEndPoint",
)
properties.baidu_secret_key = AAZStrType(
serialized_name="baiduSecretKey",
)
gcm_credential = cls._schema_on_200.properties.gcm_credential
gcm_credential.properties = AAZObjectType(
flags={"client_flatten": True},
)
properties = cls._schema_on_200.properties.gcm_credential.properties
properties.gcm_endpoint = AAZStrType(
serialized_name="gcmEndpoint",
)
properties.google_api_key = AAZStrType(
serialized_name="googleApiKey",
)
mpns_credential = cls._schema_on_200.properties.mpns_credential
mpns_credential.properties = AAZObjectType(
flags={"client_flatten": True},
)
properties = cls._schema_on_200.properties.mpns_credential.properties
properties.certificate_key = AAZStrType(
serialized_name="certificateKey",
)
properties.mpns_certificate = AAZStrType(
serialized_name="mpnsCertificate",
)
properties.thumbprint = AAZStrType()
wns_credential = cls._schema_on_200.properties.wns_credential
wns_credential.properties = AAZObjectType(
flags={"client_flatten": True},
)
properties = cls._schema_on_200.properties.wns_credential.properties
properties.package_sid = AAZStrType(
serialized_name="packageSid",
)
properties.secret_key = AAZStrType(
serialized_name="secretKey",
)
properties.windows_live_endpoint = AAZStrType(
serialized_name="windowsLiveEndpoint",
)
sku = cls._schema_on_200.sku
sku.capacity = AAZIntType()
sku.family = AAZStrType()
sku.name = AAZStrType(
flags={"required": True},
)
sku.size = AAZStrType()
sku.tier = AAZStrType()
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class NotificationHubsGetPnsCredentials(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 24 | 2 | 22 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 234 | 29 | 205 | 35 | 188 | 0 | 95 | 28 | 85 | 2 | 1 | 1 | 11 |
8,468 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_show.py
|
azext_notification_hub.aaz.latest.notification_hub.authorization_rule._show.Show.NotificationHubsGetAuthorizationRule
|
class NotificationHubsGetAuthorizationRule(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"authorizationRuleName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"notificationHubName", self.ctx.args.notification_hub_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType()
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.sku = AAZObjectType()
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.claim_type = AAZStrType(
serialized_name="claimType",
flags={"read_only": True},
)
properties.claim_value = AAZStrType(
serialized_name="claimValue",
flags={"read_only": True},
)
properties.created_time = AAZStrType(
serialized_name="createdTime",
flags={"read_only": True},
)
properties.key_name = AAZStrType(
serialized_name="keyName",
flags={"read_only": True},
)
properties.modified_time = AAZStrType(
serialized_name="modifiedTime",
flags={"read_only": True},
)
properties.primary_key = AAZStrType(
serialized_name="primaryKey",
flags={"read_only": True},
)
properties.revision = AAZIntType(
flags={"read_only": True},
)
properties.rights = AAZListType()
properties.secondary_key = AAZStrType(
serialized_name="secondaryKey",
flags={"read_only": True},
)
rights = cls._schema_on_200.properties.rights
rights.Element = AAZStrType()
sku = cls._schema_on_200.sku
sku.capacity = AAZIntType()
sku.family = AAZStrType()
sku.name = AAZStrType(
flags={"required": True},
)
sku.size = AAZStrType()
sku.tier = AAZStrType()
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class NotificationHubsGetAuthorizationRule(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 15 | 1 | 14 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 155 | 18 | 137 | 30 | 120 | 0 | 60 | 23 | 50 | 2 | 1 | 1 | 11 |
8,469 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_regenerate_keys.py
|
azext_notification_hub.aaz.latest.notification_hub.authorization_rule._regenerate_keys.RegenerateKeys.NotificationHubsRegenerateKeys
|
class NotificationHubsRegenerateKeys(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys",
**self.url_parameters
)
@property
def method(self):
return "POST"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"authorizationRuleName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"notificationHubName", self.ctx.args.notification_hub_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={
"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("policyKey", AAZStrType, ".policy_key")
return self.serialize_content(_content_value)
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.key_name = AAZStrType(
serialized_name="keyName",
)
_schema_on_200.primary_connection_string = AAZStrType(
serialized_name="primaryConnectionString",
)
_schema_on_200.primary_key = AAZStrType(
serialized_name="primaryKey",
)
_schema_on_200.secondary_connection_string = AAZStrType(
serialized_name="secondaryConnectionString",
)
_schema_on_200.secondary_key = AAZStrType(
serialized_name="secondaryKey",
)
return cls._schema_on_200
|
class NotificationHubsRegenerateKeys(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
@property
def content(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 19 | 0 | 10 | 1 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 9 | 0 | 10 | 10 | 120 | 16 | 104 | 29 | 85 | 0 | 42 | 21 | 31 | 2 | 1 | 1 | 12 |
8,470 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_list_keys.py
|
azext_notification_hub.aaz.latest.notification_hub.authorization_rule._list_keys.ListKeys.NotificationHubsListKeys
|
class NotificationHubsListKeys(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys",
**self.url_parameters
)
@property
def method(self):
return "POST"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"authorizationRuleName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"notificationHubName", self.ctx.args.notification_hub_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.key_name = AAZStrType(
serialized_name="keyName",
)
_schema_on_200.primary_connection_string = AAZStrType(
serialized_name="primaryConnectionString",
)
_schema_on_200.primary_key = AAZStrType(
serialized_name="primaryKey",
)
_schema_on_200.secondary_connection_string = AAZStrType(
serialized_name="secondaryConnectionString",
)
_schema_on_200.secondary_key = AAZStrType(
serialized_name="secondaryKey",
)
return cls._schema_on_200
|
class NotificationHubsListKeys(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 10 | 0 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 106 | 14 | 92 | 26 | 75 | 0 | 38 | 19 | 28 | 2 | 1 | 1 | 11 |
8,471 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/credential/wns/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.credential.wns._create.Create.SubresourceSelector
|
class SubresourceSelector(AAZJsonSelector):
def _get(self):
result = self.ctx.vars.instance
return result.properties.wnsCredential
def _set(self, value):
result = self.ctx.vars.instance
result.properties.wnsCredential = value
return
|
class SubresourceSelector(AAZJsonSelector):
def _get(self):
pass
def _set(self, value):
pass
| 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 10 | 2 | 8 | 5 | 5 | 0 | 8 | 5 | 5 | 1 | 1 | 0 | 2 |
8,472 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_list.py
|
azext_notification_hub.aaz.latest.notification_hub.authorization_rule._list.List.NotificationHubsListAuthorizationRules
|
class NotificationHubsListAuthorizationRules(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"notificationHubName", self.ctx.args.notification_hub_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.next_link = AAZStrType(
serialized_name="nextLink",
)
_schema_on_200.value = AAZListType()
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.location = AAZStrType()
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType(
flags={"client_flatten": True},
)
_element.sku = AAZObjectType()
_element.tags = AAZDictType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.claim_type = AAZStrType(
serialized_name="claimType",
flags={"read_only": True},
)
properties.claim_value = AAZStrType(
serialized_name="claimValue",
flags={"read_only": True},
)
properties.created_time = AAZStrType(
serialized_name="createdTime",
flags={"read_only": True},
)
properties.key_name = AAZStrType(
serialized_name="keyName",
flags={"read_only": True},
)
properties.modified_time = AAZStrType(
serialized_name="modifiedTime",
flags={"read_only": True},
)
properties.primary_key = AAZStrType(
serialized_name="primaryKey",
flags={"read_only": True},
)
properties.revision = AAZIntType(
flags={"read_only": True},
)
properties.rights = AAZListType()
properties.secondary_key = AAZStrType(
serialized_name="secondaryKey",
flags={"read_only": True},
)
rights = cls._schema_on_200.value.Element.properties.rights
rights.Element = AAZStrType()
sku = cls._schema_on_200.value.Element.sku
sku.capacity = AAZIntType()
sku.family = AAZStrType()
sku.name = AAZStrType(
flags={"required": True},
)
sku.size = AAZStrType()
sku.tier = AAZStrType()
tags = cls._schema_on_200.value.Element.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class NotificationHubsListAuthorizationRules(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 16 | 1 | 14 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 160 | 20 | 140 | 32 | 123 | 0 | 65 | 25 | 55 | 2 | 1 | 1 | 11 |
8,473 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_check_availability.py
|
azext_notification_hub.aaz.latest.notification_hub.namespace._check_availability.CheckAvailability.NamespacesCheckAvailability
|
class NamespacesCheckAvailability(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability",
**self.url_parameters
)
@property
def method(self):
return "POST"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={
"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("name", AAZStrType, ".name", typ_kwargs={
"flags": {"required": True}})
return self.serialize_content(_content_value)
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.is_availiable = AAZBoolType(
serialized_name="isAvailiable",
)
_schema_on_200.location = AAZStrType()
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.sku = AAZObjectType()
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
sku = cls._schema_on_200.sku
sku.capacity = AAZIntType()
sku.family = AAZStrType()
sku.name = AAZStrType(
flags={"required": True},
)
sku.size = AAZStrType()
sku.tier = AAZStrType()
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class NamespacesCheckAvailability(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
@property
def content(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 19 | 0 | 9 | 1 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 9 | 0 | 10 | 10 | 116 | 18 | 98 | 31 | 79 | 0 | 52 | 23 | 41 | 2 | 1 | 1 | 12 |
8,474 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_delete.py
|
azext_notification_hub.aaz.latest.notification_hub.namespace._delete.Delete.NamespacesDelete
|
class NamespacesDelete(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [202]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [204]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_204,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}",
**self.url_parameters
)
@property
def method(self):
return "DELETE"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"namespaceName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
def on_200(self, session):
pass
def on_204(self, session):
pass
|
class NamespacesDelete(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
def on_200(self, session):
pass
def on_204(self, session):
pass
| 14 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 1 | 8 | 8 | 84 | 9 | 75 | 20 | 61 | 0 | 28 | 14 | 19 | 4 | 1 | 1 | 11 |
8,475 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/nsp/azext_nsp/aaz/latest/network/perimeter/_show.py
|
azext_nsp.aaz.latest.network.perimeter._show.Show.NetworkSecurityPerimetersGet
|
class NetworkSecurityPerimetersGet(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "ODataV4Format"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"networkSecurityPerimeterName", self.ctx.args.perimeter_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-08-01-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType()
_schema_on_200.name = AAZStrType()
_schema_on_200.properties = AAZObjectType()
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.perimeter_guid = AAZStrType(
serialized_name="perimeterGuid",
flags={"read_only": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class NetworkSecurityPerimetersGet(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 10 | 1 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 106 | 16 | 90 | 28 | 73 | 0 | 44 | 21 | 34 | 2 | 1 | 1 | 11 |
8,476 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/nsp/azext_nsp/aaz/latest/network/perimeter/_list.py
|
azext_nsp.aaz.latest.network.perimeter._list.List.NetworkSecurityPerimetersListBySubscription
|
class NetworkSecurityPerimetersListBySubscription(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityPerimeters",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "ODataV4Format"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"$skipToken", self.ctx.args.skip_token,
),
**self.serialize_query_param(
"$top", self.ctx.args.top,
),
**self.serialize_query_param(
"api-version", "2023-08-01-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.next_link = AAZStrType(
serialized_name="nextLink",
)
_schema_on_200.value = AAZListType()
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.location = AAZStrType()
_element.name = AAZStrType()
_element.properties = AAZObjectType()
_element.tags = AAZDictType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.perimeter_guid = AAZStrType(
serialized_name="perimeterGuid",
flags={"read_only": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
tags = cls._schema_on_200.value.Element.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class NetworkSecurityPerimetersListBySubscription(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 10 | 1 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 113 | 18 | 95 | 30 | 78 | 0 | 49 | 23 | 39 | 2 | 1 | 1 | 11 |
8,477 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/nsp/azext_nsp/aaz/latest/network/perimeter/_list.py
|
azext_nsp.aaz.latest.network.perimeter._list.List.NetworkSecurityPerimetersList
|
class NetworkSecurityPerimetersList(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "ODataV4Format"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"$skipToken", self.ctx.args.skip_token,
),
**self.serialize_query_param(
"$top", self.ctx.args.top,
),
**self.serialize_query_param(
"api-version", "2023-08-01-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.next_link = AAZStrType(
serialized_name="nextLink",
)
_schema_on_200.value = AAZListType()
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.location = AAZStrType()
_element.name = AAZStrType()
_element.properties = AAZObjectType()
_element.tags = AAZDictType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.perimeter_guid = AAZStrType(
serialized_name="perimeterGuid",
flags={"read_only": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
tags = cls._schema_on_200.value.Element.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class NetworkSecurityPerimetersList(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 11 | 1 | 10 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 117 | 18 | 99 | 30 | 82 | 0 | 49 | 23 | 39 | 2 | 1 | 1 | 11 |
8,478 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/nsp/azext_nsp/aaz/latest/network/perimeter/_delete.py
|
azext_nsp.aaz.latest.network.perimeter._delete.Delete.NetworkSecurityPerimetersDelete
|
class NetworkSecurityPerimetersDelete(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
if session.http_response.status_code in [204]:
return self.on_204(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}",
**self.url_parameters
)
@property
def method(self):
return "DELETE"
@property
def error_format(self):
return "ODataV4Format"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"networkSecurityPerimeterName", self.ctx.args.perimeter_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-08-01-preview",
required=True,
),
}
return parameters
def on_200(self, session):
pass
def on_204(self, session):
pass
|
class NetworkSecurityPerimetersDelete(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
def on_200(self, session):
pass
def on_204(self, session):
pass
| 14 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 8 | 8 | 61 | 9 | 52 | 19 | 38 | 0 | 26 | 14 | 17 | 3 | 1 | 1 | 10 |
8,479 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/nsp/azext_nsp/aaz/latest/network/perimeter/_create.py
|
azext_nsp.aaz.latest.network.perimeter._create.Create.NetworkSecurityPerimetersCreateOrUpdate
|
class NetworkSecurityPerimetersCreateOrUpdate(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200, 201]:
return self.on_200_201(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "ODataV4Format"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"networkSecurityPerimeterName", self.ctx.args.perimeter_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-08-01-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={
"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("location", AAZStrType, ".location")
_builder.set_prop("name", AAZStrType, ".perimeter_name")
_builder.set_prop("tags", AAZDictType, ".tags")
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return self.serialize_content(_content_value)
def on_200_201(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200_201
)
_schema_on_200_201 = None
@classmethod
def _build_schema_on_200_201(cls):
if cls._schema_on_200_201 is not None:
return cls._schema_on_200_201
cls._schema_on_200_201 = AAZObjectType()
_schema_on_200_201 = cls._schema_on_200_201
_schema_on_200_201.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.location = AAZStrType()
_schema_on_200_201.name = AAZStrType()
_schema_on_200_201.properties = AAZObjectType()
_schema_on_200_201.tags = AAZDictType()
_schema_on_200_201.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200_201.properties
properties.perimeter_guid = AAZStrType(
serialized_name="perimeterGuid",
flags={"read_only": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
tags = cls._schema_on_200_201.tags
tags.Element = AAZStrType()
return cls._schema_on_200_201
|
class NetworkSecurityPerimetersCreateOrUpdate(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
@property
def content(self):
pass
def on_200_201(self, session):
pass
@classmethod
def _build_schema_on_200_201(cls):
pass
| 19 | 0 | 10 | 1 | 10 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 9 | 0 | 10 | 10 | 126 | 19 | 107 | 32 | 88 | 0 | 53 | 24 | 42 | 2 | 1 | 1 | 13 |
8,480 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_show.py
|
azext_notification_hub.aaz.latest.notification_hub.namespace.authorization_rule._show.Show.NamespacesGetAuthorizationRule
|
class NamespacesGetAuthorizationRule(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"authorizationRuleName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType()
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.sku = AAZObjectType()
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.claim_type = AAZStrType(
serialized_name="claimType",
flags={"read_only": True},
)
properties.claim_value = AAZStrType(
serialized_name="claimValue",
flags={"read_only": True},
)
properties.created_time = AAZStrType(
serialized_name="createdTime",
flags={"read_only": True},
)
properties.key_name = AAZStrType(
serialized_name="keyName",
flags={"read_only": True},
)
properties.modified_time = AAZStrType(
serialized_name="modifiedTime",
flags={"read_only": True},
)
properties.primary_key = AAZStrType(
serialized_name="primaryKey",
flags={"read_only": True},
)
properties.revision = AAZIntType(
flags={"read_only": True},
)
properties.rights = AAZListType()
properties.secondary_key = AAZStrType(
serialized_name="secondaryKey",
flags={"read_only": True},
)
rights = cls._schema_on_200.properties.rights
rights.Element = AAZStrType()
sku = cls._schema_on_200.sku
sku.capacity = AAZIntType()
sku.family = AAZStrType()
sku.name = AAZStrType(
flags={"required": True},
)
sku.size = AAZStrType()
sku.tier = AAZStrType()
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class NamespacesGetAuthorizationRule(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 15 | 1 | 14 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 151 | 18 | 133 | 30 | 116 | 0 | 60 | 23 | 50 | 2 | 1 | 1 | 11 |
8,481 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_regenerate_keys.py
|
azext_notification_hub.aaz.latest.notification_hub.namespace.authorization_rule._regenerate_keys.RegenerateKeys.NamespacesRegenerateKeys
|
class NamespacesRegenerateKeys(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys",
**self.url_parameters
)
@property
def method(self):
return "POST"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"authorizationRuleName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={
"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("policyKey", AAZStrType, ".policy_key")
return self.serialize_content(_content_value)
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.key_name = AAZStrType(
serialized_name="keyName",
)
_schema_on_200.primary_connection_string = AAZStrType(
serialized_name="primaryConnectionString",
)
_schema_on_200.primary_key = AAZStrType(
serialized_name="primaryKey",
)
_schema_on_200.secondary_connection_string = AAZStrType(
serialized_name="secondaryConnectionString",
)
_schema_on_200.secondary_key = AAZStrType(
serialized_name="secondaryKey",
)
return cls._schema_on_200
|
class NamespacesRegenerateKeys(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
@property
def content(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 19 | 0 | 9 | 1 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 9 | 0 | 10 | 10 | 116 | 16 | 100 | 29 | 81 | 0 | 42 | 21 | 31 | 2 | 1 | 1 | 12 |
8,482 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_list_keys.py
|
azext_notification_hub.aaz.latest.notification_hub.namespace.authorization_rule._list_keys.ListKeys.NamespacesListKeys
|
class NamespacesListKeys(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys",
**self.url_parameters
)
@property
def method(self):
return "POST"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"authorizationRuleName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.key_name = AAZStrType(
serialized_name="keyName",
)
_schema_on_200.primary_connection_string = AAZStrType(
serialized_name="primaryConnectionString",
)
_schema_on_200.primary_key = AAZStrType(
serialized_name="primaryKey",
)
_schema_on_200.secondary_connection_string = AAZStrType(
serialized_name="secondaryConnectionString",
)
_schema_on_200.secondary_key = AAZStrType(
serialized_name="secondaryKey",
)
return cls._schema_on_200
|
class NamespacesListKeys(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 102 | 14 | 88 | 26 | 71 | 0 | 38 | 19 | 28 | 2 | 1 | 1 | 11 |
8,483 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_list.py
|
azext_notification_hub.aaz.latest.notification_hub.namespace.authorization_rule._list.List.NamespacesListAuthorizationRules
|
class NamespacesListAuthorizationRules(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.next_link = AAZStrType(
serialized_name="nextLink",
)
_schema_on_200.value = AAZListType()
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.location = AAZStrType()
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType(
flags={"client_flatten": True},
)
_element.sku = AAZObjectType()
_element.tags = AAZDictType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.claim_type = AAZStrType(
serialized_name="claimType",
flags={"read_only": True},
)
properties.claim_value = AAZStrType(
serialized_name="claimValue",
flags={"read_only": True},
)
properties.created_time = AAZStrType(
serialized_name="createdTime",
flags={"read_only": True},
)
properties.key_name = AAZStrType(
serialized_name="keyName",
flags={"read_only": True},
)
properties.modified_time = AAZStrType(
serialized_name="modifiedTime",
flags={"read_only": True},
)
properties.primary_key = AAZStrType(
serialized_name="primaryKey",
flags={"read_only": True},
)
properties.revision = AAZIntType(
flags={"read_only": True},
)
properties.rights = AAZListType()
properties.secondary_key = AAZStrType(
serialized_name="secondaryKey",
flags={"read_only": True},
)
rights = cls._schema_on_200.value.Element.properties.rights
rights.Element = AAZStrType()
sku = cls._schema_on_200.value.Element.sku
sku.capacity = AAZIntType()
sku.family = AAZStrType()
sku.name = AAZStrType(
flags={"required": True},
)
sku.size = AAZStrType()
sku.tier = AAZStrType()
tags = cls._schema_on_200.value.Element.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class NamespacesListAuthorizationRules(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 15 | 1 | 14 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 156 | 20 | 136 | 32 | 119 | 0 | 65 | 25 | 55 | 2 | 1 | 1 | 11 |
8,484 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_delete.py
|
azext_notification_hub.aaz.latest.notification_hub.namespace.authorization_rule._delete.Delete.NamespacesDeleteAuthorizationRule
|
class NamespacesDeleteAuthorizationRule(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
if session.http_response.status_code in [204]:
return self.on_204(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}",
**self.url_parameters
)
@property
def method(self):
return "DELETE"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"authorizationRuleName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
def on_200(self, session):
pass
def on_204(self, session):
pass
|
class NamespacesDeleteAuthorizationRule(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
def on_200(self, session):
pass
def on_204(self, session):
pass
| 14 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 8 | 8 | 65 | 9 | 56 | 19 | 42 | 0 | 26 | 14 | 17 | 3 | 1 | 1 | 10 |
8,485 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/authorization_rule/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.namespace.authorization_rule._create.Create.NamespacesCreateOrUpdateAuthorizationRule
|
class NamespacesCreateOrUpdateAuthorizationRule(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"authorizationRuleName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={
"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("properties", AAZObjectType, ".",
typ_kwargs={"flags": {"required": True}})
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("rights", AAZListType, ".rights")
rights = _builder.get(".properties.rights")
if rights is not None:
rights.set_elements(AAZStrType, ".")
return self.serialize_content(_content_value)
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType()
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.sku = AAZObjectType()
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.claim_type = AAZStrType(
serialized_name="claimType",
flags={"read_only": True},
)
properties.claim_value = AAZStrType(
serialized_name="claimValue",
flags={"read_only": True},
)
properties.created_time = AAZStrType(
serialized_name="createdTime",
flags={"read_only": True},
)
properties.key_name = AAZStrType(
serialized_name="keyName",
flags={"read_only": True},
)
properties.modified_time = AAZStrType(
serialized_name="modifiedTime",
flags={"read_only": True},
)
properties.primary_key = AAZStrType(
serialized_name="primaryKey",
flags={"read_only": True},
)
properties.revision = AAZIntType(
flags={"read_only": True},
)
properties.rights = AAZListType()
properties.secondary_key = AAZStrType(
serialized_name="secondaryKey",
flags={"read_only": True},
)
rights = cls._schema_on_200.properties.rights
rights.Element = AAZStrType()
sku = cls._schema_on_200.sku
sku.capacity = AAZIntType()
sku.family = AAZStrType()
sku.name = AAZStrType(
flags={"required": True},
)
sku.size = AAZStrType()
sku.tier = AAZStrType()
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class NamespacesCreateOrUpdateAuthorizationRule(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
@property
def content(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 19 | 0 | 15 | 1 | 14 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 9 | 0 | 10 | 10 | 173 | 22 | 151 | 35 | 132 | 0 | 70 | 27 | 59 | 3 | 1 | 1 | 14 |
8,486 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_wait.py
|
azext_notification_hub.aaz.latest.notification_hub.namespace._wait.Wait.NamespacesGet
|
class NamespacesGet(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"namespaceName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType()
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.sku = AAZObjectType()
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.created_at = AAZStrType(
serialized_name="createdAt",
)
properties.critical = AAZBoolType()
properties.data_center = AAZStrType(
serialized_name="dataCenter",
)
properties.enabled = AAZBoolType()
properties.metric_id = AAZStrType(
serialized_name="metricId",
flags={"read_only": True},
)
properties.name = AAZStrType()
properties.namespace_type = AAZStrType(
serialized_name="namespaceType",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
)
properties.region = AAZStrType()
properties.scale_unit = AAZStrType(
serialized_name="scaleUnit",
)
properties.service_bus_endpoint = AAZStrType(
serialized_name="serviceBusEndpoint",
)
properties.status = AAZStrType()
properties.subscription_id = AAZStrType(
serialized_name="subscriptionId",
)
properties.updated_at = AAZStrType(
serialized_name="updatedAt",
)
sku = cls._schema_on_200.sku
sku.capacity = AAZIntType()
sku.family = AAZStrType()
sku.name = AAZStrType(
flags={"required": True},
)
sku.size = AAZStrType()
sku.tier = AAZStrType()
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class NamespacesGet(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 14 | 1 | 13 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 145 | 17 | 128 | 29 | 111 | 0 | 63 | 22 | 53 | 2 | 1 | 1 | 11 |
8,487 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_update.py
|
azext_notification_hub.aaz.latest.notification_hub.namespace._update.Update.NamespacesGet
|
class NamespacesGet(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"namespaceName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_UpdateHelper._build_schema_namespace_resource_read(
cls._schema_on_200)
return cls._schema_on_200
|
class NamespacesGet(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 82 | 13 | 69 | 25 | 52 | 0 | 33 | 18 | 23 | 2 | 1 | 1 | 11 |
8,488 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_update.py
|
azext_notification_hub.aaz.latest.notification_hub.namespace._update.Update.NamespacesCreateOrUpdate
|
class NamespacesCreateOrUpdate(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200, 201]:
return self.on_200_201(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"namespaceName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
value=self.ctx.vars.instance,
)
return self.serialize_content(_content_value)
def on_200_201(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200_201
)
_schema_on_200_201 = None
@classmethod
def _build_schema_on_200_201(cls):
if cls._schema_on_200_201 is not None:
return cls._schema_on_200_201
cls._schema_on_200_201 = AAZObjectType()
_UpdateHelper._build_schema_namespace_resource_read(
cls._schema_on_200_201)
return cls._schema_on_200_201
|
class NamespacesCreateOrUpdate(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
@property
def content(self):
pass
def on_200_201(self, session):
pass
@classmethod
def _build_schema_on_200_201(cls):
pass
| 19 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 9 | 0 | 10 | 10 | 94 | 15 | 79 | 28 | 60 | 0 | 36 | 20 | 25 | 2 | 1 | 1 | 12 |
8,489 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_update.py
|
azext_notification_hub.aaz.latest.notification_hub.namespace._update.Update.InstanceUpdateByJson
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
self._update_instance(self.ctx.vars.instance)
def _update_instance(self, instance):
_instance_value, _builder = self.new_content_builder(
self.ctx.args,
value=instance,
typ=AAZObjectType
)
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={
"flags": {"required": True}})
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
_builder.set_prop("sku", AAZObjectType)
_builder.set_prop("tags", AAZDictType, ".tags")
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("name", AAZStrType, ".name")
sku = _builder.get(".sku")
if sku is not None:
sku.set_prop("name", AAZStrType, ".sku", typ_kwargs={
"flags": {"required": True}})
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return _instance_value
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
pass
def _update_instance(self, instance):
pass
| 3 | 0 | 13 | 2 | 11 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 29 | 6 | 23 | 7 | 20 | 0 | 19 | 7 | 16 | 4 | 1 | 1 | 5 |
8,490 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_list.py
|
azext_notification_hub.aaz.latest.notification_hub.namespace._list.List.NamespacesListAll
|
class NamespacesListAll(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.next_link = AAZStrType(
serialized_name="nextLink",
)
_schema_on_200.value = AAZListType()
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.location = AAZStrType()
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType(
flags={"client_flatten": True},
)
_element.sku = AAZObjectType()
_element.tags = AAZDictType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.created_at = AAZStrType(
serialized_name="createdAt",
)
properties.critical = AAZBoolType()
properties.data_center = AAZStrType(
serialized_name="dataCenter",
)
properties.enabled = AAZBoolType()
properties.metric_id = AAZStrType(
serialized_name="metricId",
flags={"read_only": True},
)
properties.name = AAZStrType()
properties.namespace_type = AAZStrType(
serialized_name="namespaceType",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
)
properties.region = AAZStrType()
properties.scale_unit = AAZStrType(
serialized_name="scaleUnit",
)
properties.service_bus_endpoint = AAZStrType(
serialized_name="serviceBusEndpoint",
)
properties.status = AAZStrType()
properties.subscription_id = AAZStrType(
serialized_name="subscriptionId",
)
properties.updated_at = AAZStrType(
serialized_name="updatedAt",
)
sku = cls._schema_on_200.value.Element.sku
sku.capacity = AAZIntType()
sku.family = AAZStrType()
sku.name = AAZStrType(
flags={"required": True},
)
sku.size = AAZStrType()
sku.tier = AAZStrType()
tags = cls._schema_on_200.value.Element.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class NamespacesListAll(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 14 | 1 | 13 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 146 | 19 | 127 | 31 | 110 | 0 | 68 | 24 | 58 | 2 | 1 | 1 | 11 |
8,491 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_list.py
|
azext_notification_hub.aaz.latest.notification_hub.namespace._list.List.NamespacesList
|
class NamespacesList(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.next_link = AAZStrType(
serialized_name="nextLink",
)
_schema_on_200.value = AAZListType()
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.location = AAZStrType()
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType(
flags={"client_flatten": True},
)
_element.sku = AAZObjectType()
_element.tags = AAZDictType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.created_at = AAZStrType(
serialized_name="createdAt",
)
properties.critical = AAZBoolType()
properties.data_center = AAZStrType(
serialized_name="dataCenter",
)
properties.enabled = AAZBoolType()
properties.metric_id = AAZStrType(
serialized_name="metricId",
flags={"read_only": True},
)
properties.name = AAZStrType()
properties.namespace_type = AAZStrType(
serialized_name="namespaceType",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
)
properties.region = AAZStrType()
properties.scale_unit = AAZStrType(
serialized_name="scaleUnit",
)
properties.service_bus_endpoint = AAZStrType(
serialized_name="serviceBusEndpoint",
)
properties.status = AAZStrType()
properties.subscription_id = AAZStrType(
serialized_name="subscriptionId",
)
properties.updated_at = AAZStrType(
serialized_name="updatedAt",
)
sku = cls._schema_on_200.value.Element.sku
sku.capacity = AAZIntType()
sku.family = AAZStrType()
sku.name = AAZStrType(
flags={"required": True},
)
sku.size = AAZStrType()
sku.tier = AAZStrType()
tags = cls._schema_on_200.value.Element.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class NamespacesList(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 14 | 1 | 13 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 150 | 19 | 131 | 31 | 114 | 0 | 68 | 24 | 58 | 2 | 1 | 1 | 11 |
8,492 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/namespace/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.namespace._create.Create.NamespacesCreateOrUpdate
|
class NamespacesCreateOrUpdate(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200, 201]:
return self.on_200_201(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"namespaceName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={
"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={
"flags": {"required": True}})
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
_builder.set_prop("sku", AAZObjectType)
_builder.set_prop("tags", AAZDictType, ".tags")
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("name", AAZStrType, ".name")
sku = _builder.get(".sku")
if sku is not None:
sku.set_prop("name", AAZStrType, ".sku", typ_kwargs={
"flags": {"required": True}})
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return self.serialize_content(_content_value)
def on_200_201(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200_201
)
_schema_on_200_201 = None
@classmethod
def _build_schema_on_200_201(cls):
if cls._schema_on_200_201 is not None:
return cls._schema_on_200_201
cls._schema_on_200_201 = AAZObjectType()
_schema_on_200_201 = cls._schema_on_200_201
_schema_on_200_201.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.location = AAZStrType()
_schema_on_200_201.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200_201.sku = AAZObjectType()
_schema_on_200_201.tags = AAZDictType()
_schema_on_200_201.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200_201.properties
properties.created_at = AAZStrType(
serialized_name="createdAt",
)
properties.critical = AAZBoolType()
properties.data_center = AAZStrType(
serialized_name="dataCenter",
)
properties.enabled = AAZBoolType()
properties.metric_id = AAZStrType(
serialized_name="metricId",
flags={"read_only": True},
)
properties.name = AAZStrType()
properties.namespace_type = AAZStrType(
serialized_name="namespaceType",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
)
properties.region = AAZStrType()
properties.scale_unit = AAZStrType(
serialized_name="scaleUnit",
)
properties.service_bus_endpoint = AAZStrType(
serialized_name="serviceBusEndpoint",
)
properties.status = AAZStrType()
properties.subscription_id = AAZStrType(
serialized_name="subscriptionId",
)
properties.updated_at = AAZStrType(
serialized_name="updatedAt",
)
sku = cls._schema_on_200_201.sku
sku.capacity = AAZIntType()
sku.family = AAZStrType()
sku.name = AAZStrType(
flags={"required": True},
)
sku.size = AAZStrType()
sku.tier = AAZStrType()
tags = cls._schema_on_200_201.tags
tags.Element = AAZStrType()
return cls._schema_on_200_201
|
class NamespacesCreateOrUpdate(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
@property
def content(self):
pass
def on_200_201(self, session):
pass
@classmethod
def _build_schema_on_200_201(cls):
pass
| 19 | 0 | 15 | 1 | 14 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 9 | 0 | 10 | 10 | 174 | 22 | 152 | 35 | 133 | 0 | 79 | 27 | 68 | 4 | 1 | 1 | 15 |
8,493 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_delete.py
|
azext_notification_hub.aaz.latest.notification_hub.authorization_rule._delete.Delete.NotificationHubsDeleteAuthorizationRule
|
class NotificationHubsDeleteAuthorizationRule(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
if session.http_response.status_code in [204]:
return self.on_204(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}",
**self.url_parameters
)
@property
def method(self):
return "DELETE"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"authorizationRuleName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"notificationHubName", self.ctx.args.notification_hub_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
def on_200(self, session):
pass
def on_204(self, session):
pass
|
class NotificationHubsDeleteAuthorizationRule(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
def on_200(self, session):
pass
def on_204(self, session):
pass
| 14 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 8 | 8 | 69 | 9 | 60 | 19 | 46 | 0 | 26 | 14 | 17 | 3 | 1 | 1 | 10 |
8,494 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/authorization_rule/_create.py
|
azext_notification_hub.aaz.latest.notification_hub.authorization_rule._create.Create.NotificationHubsCreateOrUpdateAuthorizationRule
|
class NotificationHubsCreateOrUpdateAuthorizationRule(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"authorizationRuleName", self.ctx.args.name,
required=True,
),
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"notificationHubName", self.ctx.args.notification_hub_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={
"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("properties", AAZObjectType, ".",
typ_kwargs={"flags": {"required": True}})
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("rights", AAZListType, ".rights")
rights = _builder.get(".properties.rights")
if rights is not None:
rights.set_elements(AAZStrType, ".")
return self.serialize_content(_content_value)
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType()
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.sku = AAZObjectType()
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.claim_type = AAZStrType(
serialized_name="claimType",
flags={"read_only": True},
)
properties.claim_value = AAZStrType(
serialized_name="claimValue",
flags={"read_only": True},
)
properties.created_time = AAZStrType(
serialized_name="createdTime",
flags={"read_only": True},
)
properties.key_name = AAZStrType(
serialized_name="keyName",
flags={"read_only": True},
)
properties.modified_time = AAZStrType(
serialized_name="modifiedTime",
flags={"read_only": True},
)
properties.primary_key = AAZStrType(
serialized_name="primaryKey",
flags={"read_only": True},
)
properties.revision = AAZIntType(
flags={"read_only": True},
)
properties.rights = AAZListType()
properties.secondary_key = AAZStrType(
serialized_name="secondaryKey",
flags={"read_only": True},
)
rights = cls._schema_on_200.properties.rights
rights.Element = AAZStrType()
sku = cls._schema_on_200.sku
sku.capacity = AAZIntType()
sku.family = AAZStrType()
sku.name = AAZStrType(
flags={"required": True},
)
sku.size = AAZStrType()
sku.tier = AAZStrType()
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class NotificationHubsCreateOrUpdateAuthorizationRule(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
@property
def content(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 19 | 0 | 16 | 1 | 14 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 9 | 0 | 10 | 10 | 177 | 22 | 155 | 35 | 136 | 0 | 70 | 27 | 59 | 3 | 1 | 1 | 14 |
8,495 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/notification-hub/azext_notification_hub/aaz/latest/notification_hub/_update.py
|
azext_notification_hub.aaz.latest.notification_hub._update.Update.NotificationHubsGet
|
class NotificationHubsGet(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"namespaceName", self.ctx.args.namespace_name,
required=True,
),
**self.serialize_url_param(
"notificationHubName", self.ctx.args.notification_hub_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2017-04-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_UpdateHelper._build_schema_notification_hub_resource_read(
cls._schema_on_200)
return cls._schema_on_200
|
class NotificationHubsGet(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 86 | 13 | 73 | 25 | 56 | 0 | 33 | 18 | 23 | 2 | 1 | 1 | 11 |
8,496 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/nginx/azext_nginx/aaz/latest/nginx/deployment/certificate/_delete.py
|
azext_nginx.aaz.latest.nginx.deployment.certificate._delete.Delete.CertificatesDelete
|
class CertificatesDelete(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [202]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [204]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_204,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}",
**self.url_parameters
)
@property
def method(self):
return "DELETE"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"certificateName", self.ctx.args.certificate_name,
required=True,
),
**self.serialize_url_param(
"deploymentName", self.ctx.args.deployment_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-11-01-preview",
required=True,
),
}
return parameters
def on_200(self, session):
pass
def on_204(self, session):
pass
|
class CertificatesDelete(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
def on_200(self, session):
pass
def on_204(self, session):
pass
| 14 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 1 | 8 | 8 | 88 | 9 | 79 | 20 | 65 | 0 | 28 | 14 | 19 | 4 | 1 | 1 | 11 |
8,497 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/nginx/azext_nginx/aaz/latest/nginx/deployment/certificate/_create.py
|
azext_nginx.aaz.latest.nginx.deployment.certificate._create.Create.CertificatesCreateOrUpdate
|
class CertificatesCreateOrUpdate(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [202]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200, 201]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"certificateName", self.ctx.args.certificate_name,
required=True,
),
**self.serialize_url_param(
"deploymentName", self.ctx.args.deployment_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-11-01-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={"flags": {"client_flatten": True}}
)
_builder.set_prop("properties", AAZObjectType)
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("certificateVirtualPath",
AAZStrType, ".certificate_path")
properties.set_prop("keyVaultSecretId",
AAZStrType, ".key_vault_secret_id")
properties.set_prop("keyVirtualPath", AAZStrType, ".key_path")
return self.serialize_content(_content_value)
def on_200_201(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200_201
)
_schema_on_200_201 = None
@classmethod
def _build_schema_on_200_201(cls):
if cls._schema_on_200_201 is not None:
return cls._schema_on_200_201
cls._schema_on_200_201 = AAZObjectType()
_schema_on_200_201 = cls._schema_on_200_201
_schema_on_200_201.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.location = AAZStrType()
_schema_on_200_201.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.properties = AAZObjectType()
_schema_on_200_201.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200_201.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200_201.properties
properties.certificate_error = AAZObjectType(
serialized_name="certificateError",
)
properties.certificate_virtual_path = AAZStrType(
serialized_name="certificateVirtualPath",
)
properties.key_vault_secret_created = AAZStrType(
serialized_name="keyVaultSecretCreated",
flags={"read_only": True},
)
properties.key_vault_secret_id = AAZStrType(
serialized_name="keyVaultSecretId",
)
properties.key_vault_secret_version = AAZStrType(
serialized_name="keyVaultSecretVersion",
flags={"read_only": True},
)
properties.key_virtual_path = AAZStrType(
serialized_name="keyVirtualPath",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.sha1_thumbprint = AAZStrType(
serialized_name="sha1Thumbprint",
flags={"read_only": True},
)
certificate_error = cls._schema_on_200_201.properties.certificate_error
certificate_error.code = AAZStrType()
certificate_error.message = AAZStrType()
system_data = cls._schema_on_200_201.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
return cls._schema_on_200_201
|
class CertificatesCreateOrUpdate(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
@property
def content(self):
pass
def on_200_201(self, session):
pass
@classmethod
def _build_schema_on_200_201(cls):
pass
| 19 | 0 | 17 | 1 | 16 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 9 | 1 | 10 | 10 | 192 | 20 | 172 | 34 | 153 | 0 | 69 | 25 | 58 | 3 | 1 | 1 | 14 |
8,498 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/nginx/azext_nginx/aaz/latest/nginx/deployment/api_key/_update.py
|
azext_nginx.aaz.latest.nginx.deployment.api_key._update.Update.InstanceUpdateByJson
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
self._update_instance(self.ctx.vars.instance)
def _update_instance(self, instance):
_instance_value, _builder = self.new_content_builder(
self.ctx.args,
value=instance,
typ=AAZObjectType
)
_builder.set_prop("properties", AAZObjectType)
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop(
"endDateTime", AAZStrType, ".end_date_time")
properties.set_prop("secretText", AAZStrType, ".secret_text", typ_kwargs={
"flags": {"secret": True}})
return _instance_value
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
pass
def _update_instance(self, instance):
pass
| 3 | 0 | 8 | 1 | 7 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 19 | 4 | 15 | 5 | 12 | 0 | 11 | 5 | 8 | 2 | 1 | 1 | 3 |
8,499 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/nginx/azext_nginx/aaz/latest/nginx/deployment/api_key/_update.py
|
azext_nginx.aaz.latest.nginx.deployment.api_key._update.Update.ApiKeysGet
|
class ApiKeysGet(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(
request=request, stream=False, **kwargs)
if session.http_response.status_code in [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"apiKeyName", self.ctx.args.api_key_name,
required=True,
),
**self.serialize_url_param(
"deploymentName", self.ctx.args.deployment_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-11-01-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_UpdateHelper._build_schema_nginx_deployment_api_key_response_read(
cls._schema_on_200)
return cls._schema_on_200
|
class ApiKeysGet(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 17 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 86 | 13 | 73 | 25 | 56 | 0 | 33 | 18 | 23 | 2 | 1 | 1 | 11 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.