_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 31 13.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q267400 | ServiceManagementService.get_service_certificate | test | def get_service_certificate(self, service_name, thumbalgorithm, thumbprint):
'''
Returns the public data for the specified X.509 certificate associated
with a hosted service.
service_name:
Name of the hosted service.
thumbalgorithm:
The algorithm for the certificate's thumbprint.
| python | {
"resource": ""
} |
q267401 | ServiceManagementService.add_service_certificate | test | def add_service_certificate(self, service_name, data, certificate_format,
password=None):
'''
Adds a certificate to a hosted service.
service_name:
Name of the hosted service.
data:
The base-64 encoded form of the pfx/cer file.
certificate_format:
The service certificate format.
password:
| python | {
"resource": ""
} |
q267402 | ServiceManagementService.delete_service_certificate | test | def delete_service_certificate(self, service_name, thumbalgorithm,
thumbprint):
'''
Deletes a service certificate from the certificate store of a hosted
service.
service_name:
Name of the hosted service.
thumbalgorithm:
The algorithm for the certificate's thumbprint.
| python | {
"resource": ""
} |
q267403 | ServiceManagementService.get_management_certificate | test | def get_management_certificate(self, thumbprint):
'''
The Get Management Certificate operation retrieves information about
the management certificate with the specified thumbprint. Management
certificates, which are also known as subscription certificates,
authenticate clients attempting to connect to resources associated
with your Windows Azure subscription.
| python | {
"resource": ""
} |
q267404 | ServiceManagementService.add_management_certificate | test | def add_management_certificate(self, public_key, thumbprint, data):
'''
The Add Management Certificate operation adds a certificate to the
list of management certificates. Management certificates, which are
also known as subscription certificates, authenticate clients
attempting to connect to resources associated with your Windows Azure
subscription.
public_key:
A base64 representation of the management certificate public key.
thumbprint:
The thumb print that uniquely identifies the management
certificate.
data:
| python | {
"resource": ""
} |
q267405 | ServiceManagementService.delete_management_certificate | test | def delete_management_certificate(self, thumbprint):
'''
The Delete Management Certificate operation deletes a certificate from
the list of management certificates. Management certificates, which
are also known as subscription certificates, authenticate clients
attempting to connect to resources associated with your Windows Azure
subscription.
| python | {
"resource": ""
} |
q267406 | ServiceManagementService.get_affinity_group_properties | test | def get_affinity_group_properties(self, affinity_group_name):
'''
Returns the system properties associated with the specified affinity
group.
affinity_group_name:
The name of the affinity group.
'''
_validate_not_none('affinity_group_name', | python | {
"resource": ""
} |
q267407 | ServiceManagementService.create_affinity_group | test | def create_affinity_group(self, name, label, location, description=None):
'''
Creates a new affinity group for the specified subscription.
name:
A name for the affinity group that is unique to the subscription.
label:
A name for the affinity group. The name can be up to 100 characters
in length.
location:
The data center location where the affinity group will be created.
To list available locations, use the list_location function.
description:
A description for the affinity group. The description can be up to
1024 characters in length.
'''
| python | {
"resource": ""
} |
q267408 | ServiceManagementService.delete_affinity_group | test | def delete_affinity_group(self, affinity_group_name):
'''
Deletes an affinity group in the specified subscription.
affinity_group_name:
The name of the affinity group.
| python | {
"resource": ""
} |
q267409 | ServiceManagementService.list_subscription_operations | test | def list_subscription_operations(self, start_time=None, end_time=None, object_id_filter=None,
operation_result_filter=None, continuation_token=None):
'''
List subscription operations.
start_time: Required. An ISO8601 date.
end_time: Required. An ISO8601 date.
object_id_filter: Optional. Returns subscription operations only for the specified object type and object ID
operation_result_filter: Optional. Returns subscription operations only for the specified result status, either Succeeded, Failed, or InProgress.
continuation_token: Optional.
More information at:
https://msdn.microsoft.com/en-us/library/azure/gg715318.aspx
'''
start_time = ('StartTime=' + start_time) if start_time else ''
end_time = ('EndTime=' + end_time) if end_time else ''
object_id_filter | python | {
"resource": ""
} |
q267410 | ServiceManagementService.create_reserved_ip_address | test | def create_reserved_ip_address(self, name, label=None, location=None):
'''
Reserves an IPv4 address for the specified subscription.
name:
Required. Specifies the name for the reserved IP address.
label:
Optional. Specifies a label for the reserved IP address. The label
can be up to 100 characters long and can be used for your tracking
purposes.
location:
Required. Specifies the location of the reserved IP address. This
should be the same location that is assigned to the cloud service
| python | {
"resource": ""
} |
q267411 | ServiceManagementService.delete_reserved_ip_address | test | def delete_reserved_ip_address(self, name):
'''
Deletes a reserved IP address from the specified subscription.
name:
Required. Name of the reserved IP address.
'''
_validate_not_none('name', name)
| python | {
"resource": ""
} |
q267412 | ServiceManagementService.associate_reserved_ip_address | test | def associate_reserved_ip_address(
self, name, service_name, deployment_name, virtual_ip_name=None
):
'''
Associate an existing reservedIP to a deployment.
name:
Required. Name of the reserved IP address.
service_name:
Required. Name of the hosted service.
deployment_name:
Required. Name of the deployment.
virtual_ip_name:
Optional. Name of the VirtualIP in case of multi Vip tenant.
If this value is not specified default virtualIP is used
for this operation.
'''
_validate_not_none('name', name)
| python | {
"resource": ""
} |
q267413 | ServiceManagementService.disassociate_reserved_ip_address | test | def disassociate_reserved_ip_address(
self, name, service_name, deployment_name, virtual_ip_name=None
):
'''
Disassociate an existing reservedIP from the given deployment.
name:
Required. Name of the reserved IP address.
service_name:
Required. Name of the hosted service.
deployment_name:
Required. Name of the deployment.
virtual_ip_name:
Optional. Name of the VirtualIP in case of multi Vip tenant.
If this value is not specified default virtualIP is used
for this operation.
'''
| python | {
"resource": ""
} |
q267414 | ServiceManagementService.get_reserved_ip_address | test | def get_reserved_ip_address(self, name):
'''
Retrieves information about the specified reserved IP address.
name:
Required. Name of the reserved IP address.
'''
| python | {
"resource": ""
} |
q267415 | ServiceManagementService.get_role | test | def get_role(self, service_name, deployment_name, role_name):
'''
Retrieves the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
'''
| python | {
"resource": ""
} |
q267416 | ServiceManagementService.create_virtual_machine_deployment | test | def create_virtual_machine_deployment(self, service_name, deployment_name,
deployment_slot, label, role_name,
system_config, os_virtual_hard_disk,
network_config=None,
availability_set_name=None,
data_virtual_hard_disks=None,
role_size=None,
role_type='PersistentVMRole',
virtual_network_name=None,
resource_extension_references=None,
provision_guest_agent=None,
vm_image_name=None,
media_location=None,
dns_servers=None,
reserved_ip_name=None):
'''
Provisions a virtual machine based on the supplied configuration.
service_name:
Name of the hosted service.
deployment_name:
The name for the deployment. The deployment name must be unique
among other deployments for the hosted service.
deployment_slot:
The environment to which the hosted service is deployed. Valid
values are: staging, production
label:
Specifies an identifier for the deployment. The label can be up to
100 characters long. The label can be used for tracking purposes.
role_name:
The name of the role.
system_config:
Contains the metadata required to provision a virtual machine from
a Windows or Linux OS image. Use an instance of
WindowsConfigurationSet or LinuxConfigurationSet.
os_virtual_hard_disk:
Contains the parameters Windows Azure uses to create the operating
system disk for the virtual machine. If you are creating a Virtual
Machine by using a VM Image, this parameter is not used.
network_config:
Encapsulates the metadata required to create the virtual network
configuration for a virtual machine. If you do not include a
network configuration set you will not be able to access the VM
through VIPs over the internet. If your virtual machine belongs to
a virtual network you can not specify which subnet address space
it resides under. Use an instance of ConfigurationSet.
availability_set_name:
Specifies the name of an availability | python | {
"resource": ""
} |
q267417 | ServiceManagementService.add_role | test | def add_role(self, service_name, deployment_name, role_name, system_config,
os_virtual_hard_disk, network_config=None,
availability_set_name=None, data_virtual_hard_disks=None,
role_size=None, role_type='PersistentVMRole',
resource_extension_references=None,
provision_guest_agent=None, vm_image_name=None,
media_location=None):
'''
Adds a virtual machine to an existing deployment.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
system_config:
Contains the metadata required to provision a virtual machine from
a Windows or Linux OS image. Use an instance of
WindowsConfigurationSet or LinuxConfigurationSet.
os_virtual_hard_disk:
Contains the parameters Windows Azure uses to create the operating
system disk for the virtual machine. If you are creating a Virtual
Machine by using a VM Image, this parameter is not used.
network_config:
Encapsulates the metadata required to create the virtual network
configuration for a virtual machine. If you do not include a
network configuration set you will not be able to access the VM
through VIPs over the internet. If your virtual machine belongs to
a virtual network you can not specify which subnet address space
it resides under.
availability_set_name:
Specifies the name of an availability set to which to add the
virtual machine. This value controls the virtual machine allocation
in the Windows Azure environment. Virtual machines specified in the
same availability set are allocated to different nodes to maximize
availability.
data_virtual_hard_disks:
Contains the parameters Windows Azure uses to create a data disk
for a virtual machine.
role_size:
The size of the virtual machine to allocate. The default value is
Small. Possible values are: ExtraSmall, Small, Medium, Large,
ExtraLarge. The specified value must be compatible with the disk
selected in the OSVirtualHardDisk values.
role_type:
The type of the role for the virtual machine. The only supported
value is PersistentVMRole.
resource_extension_references:
Optional. Contains a collection of resource extensions that are to
| python | {
"resource": ""
} |
q267418 | ServiceManagementService.update_role | test | def update_role(self, service_name, deployment_name, role_name,
os_virtual_hard_disk=None, network_config=None,
availability_set_name=None, data_virtual_hard_disks=None,
role_size=None, role_type='PersistentVMRole',
resource_extension_references=None,
provision_guest_agent=None):
'''
Updates the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
os_virtual_hard_disk:
Contains the parameters Windows Azure uses to create the operating
system disk for the virtual machine.
network_config:
Encapsulates the metadata required to create the virtual network
configuration for a virtual machine. If you do not include a
network configuration set you will not be able to access the VM
through VIPs over the internet. If your virtual machine belongs to
a virtual network you can not specify which subnet address space
it resides under.
availability_set_name:
Specifies the name of an availability set to which to add the
virtual machine. This value controls the virtual machine allocation
in the Windows Azure environment. Virtual machines specified in the
same availability set are allocated to different nodes to maximize
availability.
data_virtual_hard_disks:
Contains the parameters Windows Azure uses to create a data disk
for a virtual machine.
role_size:
The size of the virtual machine to allocate. The default value is
Small. Possible values are: ExtraSmall, Small, Medium, Large,
ExtraLarge. The specified value must be compatible with the disk
selected in the OSVirtualHardDisk values.
role_type:
The type of the role for the virtual machine. The only supported
value is PersistentVMRole.
resource_extension_references:
Optional. Contains a collection of resource extensions that are to
| python | {
"resource": ""
} |
q267419 | ServiceManagementService.delete_role | test | def delete_role(self, service_name, deployment_name, role_name, complete = False):
'''
Deletes the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
complete:
True if all OS/data disks and | python | {
"resource": ""
} |
q267420 | ServiceManagementService.capture_role | test | def capture_role(self, service_name, deployment_name, role_name,
post_capture_action, target_image_name,
target_image_label, provisioning_configuration=None):
'''
The Capture Role operation captures a virtual machine image to your
image gallery. From the captured image, you can create additional
customized virtual machines.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
post_capture_action:
Specifies the action after capture operation completes. Possible
values are: Delete, Reprovision.
| python | {
"resource": ""
} |
q267421 | ServiceManagementService.start_role | test | def start_role(self, service_name, deployment_name, role_name):
'''
Starts the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
| python | {
"resource": ""
} |
q267422 | ServiceManagementService.start_roles | test | def start_roles(self, service_name, deployment_name, role_names):
'''
Starts the specified virtual machines.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_names:
The names of the roles, as an enumerable of strings.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', | python | {
"resource": ""
} |
q267423 | ServiceManagementService.restart_role | test | def restart_role(self, service_name, deployment_name, role_name):
'''
Restarts the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
| python | {
"resource": ""
} |
q267424 | ServiceManagementService.shutdown_role | test | def shutdown_role(self, service_name, deployment_name, role_name,
post_shutdown_action='Stopped'):
'''
Shuts down the specified virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
post_shutdown_action:
Specifies how the Virtual Machine should be shut down. Values are:
Stopped
Shuts down the Virtual Machine but retains the compute
resources. You will continue to be billed for the resources
that the stopped machine uses.
StoppedDeallocated
Shuts down the Virtual Machine and releases the compute
resources. You are not billed for the compute resources that
this Virtual Machine uses. If a static Virtual Network IP
| python | {
"resource": ""
} |
q267425 | ServiceManagementService.shutdown_roles | test | def shutdown_roles(self, service_name, deployment_name, role_names,
post_shutdown_action='Stopped'):
'''
Shuts down the specified virtual machines.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_names:
The names of the roles, as an enumerable of strings.
post_shutdown_action:
Specifies how the Virtual Machine should be shut down. Values are:
Stopped
Shuts down the Virtual Machine but retains the compute
resources. You will continue to be billed for the resources
that the stopped machine uses.
StoppedDeallocated
Shuts down the Virtual Machine and releases the compute
resources. You are not billed for the compute resources that
this Virtual Machine uses. If a static Virtual Network IP
| python | {
"resource": ""
} |
q267426 | ServiceManagementService.add_dns_server | test | def add_dns_server(self, service_name, deployment_name, dns_server_name, address):
'''
Adds a DNS server definition to an existing deployment.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
dns_server_name:
Specifies the name of the DNS server.
| python | {
"resource": ""
} |
q267427 | ServiceManagementService.update_dns_server | test | def update_dns_server(self, service_name, deployment_name, dns_server_name, address):
'''
Updates the ip address of a DNS server.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
dns_server_name:
Specifies the name of the DNS server.
address:
Specifies the IP address of | python | {
"resource": ""
} |
q267428 | ServiceManagementService.delete_dns_server | test | def delete_dns_server(self, service_name, deployment_name, dns_server_name):
'''
Deletes a DNS server from a deployment.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
dns_server_name:
Name of the DNS server that you want to delete.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name) | python | {
"resource": ""
} |
q267429 | ServiceManagementService.list_resource_extension_versions | test | def list_resource_extension_versions(self, publisher_name, extension_name):
'''
Lists the versions of a resource extension that are available to add
to a Virtual Machine.
publisher_name:
Name of the resource extension publisher.
extension_name:
| python | {
"resource": ""
} |
q267430 | ServiceManagementService.replicate_vm_image | test | def replicate_vm_image(self, vm_image_name, regions, offer, sku, version):
'''
Replicate a VM image to multiple target locations. This operation
is only for publishers. You have to be registered as image publisher
with Microsoft Azure to be able to call this.
vm_image_name:
Specifies the name of the VM Image that is to be used for
replication
regions:
Specified a list of regions to replicate the image to
Note: The regions in the request body are not additive. If a VM
Image has already been replicated to Regions A, B, and C, and
a request is made to replicate to Regions A and D, the VM
Image will remain in Region A, will be replicated in Region D,
and will be unreplicated from Regions B and C
offer:
Specifies the publisher defined name of the offer. The allowed
characters are uppercase or lowercase letters, digit,
hypen(-), period (.).The maximum allowed length is 64 characters.
sku:
Specifies the publisher defined name of the Sku. The allowed
characters are uppercase or lowercase letters, digit,
hypen(-), period (.). The maximum allowed length is 64 characters.
version:
Specifies the publisher defined version of | python | {
"resource": ""
} |
q267431 | ServiceManagementService.unreplicate_vm_image | test | def unreplicate_vm_image(self, vm_image_name):
'''
Unreplicate a VM image from all regions This operation
is only for publishers. You have to be registered as image publisher
with Microsoft Azure to be able to call this
vm_image_name:
Specifies the name of the VM | python | {
"resource": ""
} |
q267432 | ServiceManagementService.share_vm_image | test | def share_vm_image(self, vm_image_name, permission):
'''
Share an already replicated OS image. This operation is only for
publishers. You have to be registered as image publisher with Windows
Azure to be able to call this.
vm_image_name:
The name of the virtual machine image to share
| python | {
"resource": ""
} |
q267433 | ServiceManagementService.create_vm_image | test | def create_vm_image(self, vm_image):
'''
Creates a VM Image in the image repository that is associated with the
specified subscription using a specified set of virtual hard disks.
vm_image:
An instance of VMImage class.
vm_image.name: Required. Specifies the name of the image.
vm_image.label: Required. Specifies an identifier for the image.
vm_image.description: Optional. Specifies the description of the image.
vm_image.os_disk_configuration:
Required. Specifies configuration information for the operating
system disk that is associated with the image.
vm_image.os_disk_configuration.host_caching:
Optional. Specifies the caching behavior of the operating system disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.os_disk_configuration.os_state:
Required. Specifies the state of the operating system in the image.
Possible values are: Generalized, Specialized
A Virtual Machine that is fully configured and running contains a
Specialized operating system. A Virtual Machine on which the
Sysprep command has been run with the generalize option contains a
Generalized operating system.
vm_image.os_disk_configuration.os:
Required. Specifies the operating system type of the image.
vm_image.os_disk_configuration.media_link:
Required. Specifies the location of the blob in Windows Azure
storage. The blob location belongs to a storage account in the
subscription specified by the <subscription-id> value in the
operation call.
vm_image.data_disk_configurations:
Optional. Specifies configuration information for the data disks
that are associated with the image. A VM Image might not have data
disks associated with it.
vm_image.data_disk_configurations[].host_caching:
Optional. Specifies the caching behavior of the data disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.data_disk_configurations[].lun:
Optional if the lun for the disk is 0. Specifies the Logical Unit
Number (LUN) for the data disk.
vm_image.data_disk_configurations[].media_link:
Required. Specifies the location of the blob in Windows Azure
storage. The blob location belongs to a storage account in the
subscription specified by the <subscription-id> value in the
operation call.
vm_image.data_disk_configurations[].logical_size_in_gb:
Required. Specifies the size, in GB, of the data disk.
vm_image.language: Optional. Specifies the language of the image.
vm_image.image_family:
Optional. Specifies a value that can be used to group VM Images.
vm_image.recommended_vm_size:
| python | {
"resource": ""
} |
q267434 | ServiceManagementService.delete_vm_image | test | def delete_vm_image(self, vm_image_name, delete_vhd=False):
'''
Deletes the specified VM Image from the image repository that is
associated with the specified subscription.
vm_image_name:
The name of the image.
delete_vhd:
Deletes the underlying vhd blob in Azure storage. | python | {
"resource": ""
} |
q267435 | ServiceManagementService.list_vm_images | test | def list_vm_images(self, location=None, publisher=None, category=None):
'''
Retrieves a list of the VM Images from the image repository that is
associated with the specified subscription.
'''
path = self._get_vm_image_path()
| python | {
"resource": ""
} |
q267436 | ServiceManagementService.update_vm_image | test | def update_vm_image(self, vm_image_name, vm_image):
'''
Updates a VM Image in the image repository that is associated with the
specified subscription.
vm_image_name:
Name of image to update.
vm_image:
An instance of VMImage class.
vm_image.label: Optional. Specifies an identifier for the image.
vm_image.os_disk_configuration:
Required. Specifies configuration information for the operating
system disk that is associated with the image.
vm_image.os_disk_configuration.host_caching:
Optional. Specifies the caching behavior of the operating system disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.data_disk_configurations:
Optional. Specifies configuration information for the data disks
that are associated with the image. A VM Image might not have data
disks associated with it.
vm_image.data_disk_configurations[].name:
Required. Specifies the name of the data disk.
vm_image.data_disk_configurations[].host_caching:
Optional. Specifies the caching behavior of the data disk.
Possible values are: None, ReadOnly, ReadWrite
vm_image.data_disk_configurations[].lun:
| python | {
"resource": ""
} |
q267437 | ServiceManagementService.add_os_image | test | def add_os_image(self, label, media_link, name, os):
'''
Adds an OS image that is currently stored in a storage account in your
subscription to the image repository.
label:
Specifies the friendly name of the image.
media_link:
Specifies the location of the blob in Windows Azure blob store
where the media for the image is located. The blob location must
belong to a storage account in the subscription specified by the
<subscription-id> value in the operation call. Example:
| python | {
"resource": ""
} |
q267438 | ServiceManagementService.update_os_image | test | def update_os_image(self, image_name, label, media_link, name, os):
'''
Updates an OS image that in your image repository.
image_name:
The name of the image to update.
label:
Specifies the friendly name of the image to be updated. You cannot
use this operation to update images provided by the Windows Azure
platform.
media_link:
Specifies the location of the blob in Windows Azure blob store
where the media for the image is located. The blob location must
belong to a storage account in the subscription specified by the
<subscription-id> value in the operation call. Example:
http://example.blob.core.windows.net/disks/mydisk.vhd
name:
Specifies a name for the OS image that Windows Azure uses to
identify the image when creating one or more VM Roles.
os:
The operating system type of the OS image. Possible values are:
Linux, Windows
''' | python | {
"resource": ""
} |
q267439 | ServiceManagementService.update_os_image_from_image_reference | test | def update_os_image_from_image_reference(self, image_name, os_image):
'''
Updates metadata elements from a given OS image reference.
image_name:
The name of the image to update.
os_image:
An instance of OSImage class.
os_image.label: Optional. Specifies an identifier for the image.
os_image.description: Optional. Specifies the description of the image.
os_image.language: Optional. Specifies the language of the image.
os_image.image_family:
Optional. Specifies a value that can be used to group VM Images.
os_image.recommended_vm_size:
Optional. Specifies the size to use for the Virtual Machine that
is created from the VM Image.
os_image.eula:
Optional. Specifies the End User License Agreement that is
associated with the image. The value for this element is a string,
but it is recommended that the value be a URL that points to a EULA.
os_image.icon_uri:
Optional. Specifies the URI | python | {
"resource": ""
} |
q267440 | ServiceManagementService.delete_os_image | test | def delete_os_image(self, image_name, delete_vhd=False):
'''
Deletes the specified OS image from your image repository.
image_name:
The name of the image.
delete_vhd:
Deletes the underlying vhd blob in Azure storage.
'''
| python | {
"resource": ""
} |
q267441 | ServiceManagementService.get_data_disk | test | def get_data_disk(self, service_name, deployment_name, role_name, lun):
'''
Retrieves the specified data disk from a virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
| python | {
"resource": ""
} |
q267442 | ServiceManagementService.add_data_disk | test | def add_data_disk(self, service_name, deployment_name, role_name, lun,
host_caching=None, media_link=None, disk_label=None,
disk_name=None, logical_disk_size_in_gb=None,
source_media_link=None):
'''
Adds a data disk to a virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
lun:
Specifies the Logical Unit Number (LUN) for the disk. The LUN
specifies the slot in which the data drive appears when mounted
for usage by the virtual machine. Valid LUN values are 0 through 15.
host_caching:
Specifies the platform caching behavior of data disk blob for
read/write efficiency. The default vault is ReadOnly. Possible
values are: None, ReadOnly, ReadWrite
media_link:
Specifies the location of the blob in Windows Azure blob store
where the media for the disk is located. The blob location must
belong to the storage account in the subscription specified by the
<subscription-id> value in the operation call. Example:
| python | {
"resource": ""
} |
q267443 | ServiceManagementService.update_data_disk | test | def update_data_disk(self, service_name, deployment_name, role_name, lun,
host_caching=None, media_link=None, updated_lun=None,
disk_label=None, disk_name=None,
logical_disk_size_in_gb=None):
'''
Updates the specified data disk attached to the specified virtual
machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
lun:
Specifies the Logical Unit Number (LUN) for the disk. The LUN
specifies the slot in which the data drive appears when mounted
for usage by the virtual machine. Valid LUN values are 0 through
15.
host_caching:
Specifies the platform caching behavior of data disk blob for
read/write efficiency. The default vault is ReadOnly. Possible
values are: None, ReadOnly, ReadWrite
media_link:
Specifies the location of the blob in Windows Azure blob store
where the media for the disk is located. The blob location must
belong to the storage account in the subscription specified by
the <subscription-id> value in the operation call. Example:
http://example.blob.core.windows.net/disks/mydisk.vhd
updated_lun:
Specifies the Logical Unit Number (LUN) for the disk. The LUN
specifies the slot in which the data drive appears when mounted
for usage by the virtual machine. Valid LUN values are 0 through 15.
disk_label:
Specifies the description of the data disk. When you attach a disk,
either by directly referencing a media using the MediaLink element
or specifying the target disk size, you can use the DiskLabel
element to customize the name property of the target data disk.
disk_name:
Specifies the name of the disk. Windows Azure uses the specified
disk to create the data disk for the machine and populates this
field with the disk name.
logical_disk_size_in_gb:
| python | {
"resource": ""
} |
q267444 | ServiceManagementService.delete_data_disk | test | def delete_data_disk(self, service_name, deployment_name, role_name, lun, delete_vhd=False):
'''
Removes the specified data disk from a virtual machine.
service_name:
The name of the service.
deployment_name:
The name of the deployment.
role_name:
The name of the role.
lun:
The Logical Unit Number (LUN) for the disk.
delete_vhd:
Deletes the underlying vhd blob in Azure storage.
'''
_validate_not_none('service_name', service_name)
_validate_not_none('deployment_name', deployment_name)
| python | {
"resource": ""
} |
q267445 | ServiceManagementService.add_disk | test | def add_disk(self, has_operating_system, label, media_link, name, os):
'''
Adds a disk to the user image repository. The disk can be an OS disk
or a data disk.
has_operating_system:
Deprecated.
label:
Specifies the description of the disk.
media_link:
Specifies the location of the blob in Windows Azure blob store
where the media for the disk is located. The blob location must
belong to the storage account in the current subscription specified
by the <subscription-id> value in the operation call. Example:
| python | {
"resource": ""
} |
q267446 | ServiceManagementService.update_disk | test | def update_disk(self, disk_name, has_operating_system=None, label=None, media_link=None,
name=None, os=None):
'''
Updates an existing disk in your image repository.
disk_name:
The name of the disk to update.
has_operating_system:
Deprecated.
label:
Specifies the description of the disk.
media_link:
Deprecated.
name:
Deprecated.
os:
Deprecated.
| python | {
"resource": ""
} |
q267447 | ServiceManagementService.delete_disk | test | def delete_disk(self, disk_name, delete_vhd=False):
'''
Deletes the specified data or operating system disk from your image
repository.
disk_name:
The name of the disk to delete.
delete_vhd:
Deletes the underlying vhd blob in Azure storage.
| python | {
"resource": ""
} |
q267448 | PolicyStatesOperations.summarize_for_management_group | test | def summarize_for_management_group(
self, management_group_name, query_options=None, custom_headers=None, raw=False, **operation_config):
"""Summarizes policy states for the resources under the management group.
:param management_group_name: Management group name.
:type management_group_name: str
:param query_options: Additional parameters for the operation
:type query_options: ~azure.mgmt.policyinsights.models.QueryOptions
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: SummarizeResults or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.policyinsights.models.SummarizeResults or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`QueryFailureException<azure.mgmt.policyinsights.models.QueryFailureException>`
"""
top = None
if query_options is not None:
top = query_options.top
from_parameter = None
if query_options is not None:
from_parameter = query_options.from_property
to = None
if query_options is not None:
to = query_options.to
filter = None
if query_options is not None:
filter = query_options.filter
# Construct URL
url = self.summarize_for_management_group.metadata['url']
path_format_arguments = {
'policyStatesSummaryResource': self._serialize.url("self.policy_states_summary_resource", self.policy_states_summary_resource, 'str'),
'managementGroupsNamespace': self._serialize.url("self.management_groups_namespace", self.management_groups_namespace, 'str'),
'managementGroupName': self._serialize.url("management_group_name", management_group_name, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
if top is not None:
query_parameters['$top'] = self._serialize.query("top", top, 'int', | python | {
"resource": ""
} |
q267449 | Receiver._build_receiver | test | def _build_receiver(self):
"""This is a temporary patch pending a fix in uAMQP."""
# pylint: disable=protected-access
self._handler.message_handler = self._handler.receiver_type(
self._handler._session,
self._handler._remote_address,
self._handler._name,
on_message_received=self._handler._message_received,
name='receiver-link-{}'.format(uuid.uuid4()),
debug=self._handler._debug_trace,
prefetch=self._handler._prefetch,
max_message_size=self._handler._max_message_size,
properties=self._handler._link_properties,
error_policy=self._handler._error_policy,
encoding=self._handler._encoding)
| python | {
"resource": ""
} |
q267450 | Receiver.fetch_next | test | def fetch_next(self, max_batch_size=None, timeout=None):
"""Receive a batch of messages at once.
This approach it optimal if you wish to process multiple messages simultaneously. Note that the
number of messages retrieved in a single batch will be dependent on
whether `prefetch` was set for the receiver. This call will prioritize returning
quickly over meeting a specified batch size, and so will return as soon as at least
one message is received and there is a gap in incoming messages regardless
of the specified batch size.
:param max_batch_size: Maximum number of messages in the batch. Actual number
returned will depend on prefetch size and incoming stream rate.
:type max_batch_size: int
:param timeout: The time to wait in seconds for the first message to arrive.
If no messages arrive, and no timeout is specified, this call will not return
until the connection is closed. If specified, an no messages arrive within the
timeout period, an empty list will be returned.
:rtype: list[~azure.servicebus.common.message.Message]
Example:
.. literalinclude:: ../examples/test_examples.py
:start-after: [START fetch_next_messages]
:end-before: [END fetch_next_messages]
| python | {
"resource": ""
} |
q267451 | SessionReceiver.renew_lock | test | def renew_lock(self):
"""Renew the session lock.
This operation must be performed periodically in order to retain a lock on the
session to continue message processing.
Once the lock is lost the connection will be closed. This operation can
also be performed as a threaded background task by registering the session
with an `azure.servicebus.AutoLockRenew` instance.
Example:
.. literalinclude:: ../examples/test_examples.py
:start-after: [START renew_lock]
:end-before: [END renew_lock]
| python | {
"resource": ""
} |
q267452 | VirtualMachineScaleSetsOperations.create_or_update | test | def create_or_update(
self, resource_group_name, vm_scale_set_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config):
"""Create or update a VM scale set.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param vm_scale_set_name: The name of the VM scale set to create or
update.
:type vm_scale_set_name: str
:param parameters: The scale set object.
:type parameters:
~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSet
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns VirtualMachineScaleSet
or ClientRawResponse<VirtualMachineScaleSet> if raw==True
:rtype:
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSet]
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSet]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
vm_scale_set_name=vm_scale_set_name,
parameters=parameters,
custom_headers=custom_headers,
| python | {
"resource": ""
} |
q267453 | VirtualMachineScaleSetsOperations.convert_to_single_placement_group | test | def convert_to_single_placement_group(
self, resource_group_name, vm_scale_set_name, active_placement_group_id=None, custom_headers=None, raw=False, **operation_config):
"""Converts SinglePlacementGroup property to false for a existing virtual
machine scale set.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param vm_scale_set_name: The name of the virtual machine scale set to
create or update.
:type vm_scale_set_name: str
:param active_placement_group_id: Id of the placement group in which
you want future virtual machine instances to be placed. To query
placement group Id, please use Virtual Machine Scale Set VMs - Get
API. If not provided, the platform will choose one with maximum number
of virtual machine instances.
:type active_placement_group_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
parameters = models.VMScaleSetConvertToSinglePlacementGroupInput(active_placement_group_id=active_placement_group_id)
# Construct URL
url = self.convert_to_single_placement_group.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
| python | {
"resource": ""
} |
q267454 | TextModerationOperations.screen_text | test | def screen_text(
self, text_content_type, text_content, language=None, autocorrect=False, pii=False, list_id=None, classify=False, custom_headers=None, raw=False, callback=None, **operation_config):
"""Detect profanity and match against custom and shared blacklists.
Detects profanity in more than 100 languages and match against custom
and shared blacklists.
:param text_content_type: The content type. Possible values include:
'text/plain', 'text/html', 'text/xml', 'text/markdown'
:type text_content_type: str
:param text_content: Content to screen.
:type text_content: Generator
:param language: Language of the text.
:type language: str
:param autocorrect: Autocorrect text.
:type autocorrect: bool
:param pii: Detect personal identifiable information.
:type pii: bool
:param list_id: The list Id.
:type list_id: str
:param classify: Classify input.
:type classify: bool
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param callback: When specified, will be called with each chunk of
data that is streamed. The callback should take two arguments, the
bytes of the current chunk of data and the response object. If the
data is uploading, response will be None.
:type callback: Callable[Bytes, response=None]
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: Screen or ClientRawResponse if raw=true
| python | {
"resource": ""
} |
q267455 | KeyVaultClient.create_key | test | def create_key(
self, vault_base_url, key_name, kty, key_size=None, key_ops=None, key_attributes=None, tags=None, curve=None, custom_headers=None, raw=False, **operation_config):
"""Creates a new key, stores it, then returns key parameters and
attributes to the client.
The create key operation can be used to create any key type in Azure
Key Vault. If the named key already exists, Azure Key Vault creates a
new version of the key. It requires the keys/create permission.
:param vault_base_url: The vault name, for example
https://myvault.vault.azure.net.
:type vault_base_url: str
:param key_name: The name for the new key. The system will generate
the version name for the new key.
:type key_name: str
:param kty: The type of key to create. For valid values, see
JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA',
'RSA-HSM', 'oct'
:type kty: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyType
:param key_size: The key size in bits. For example: 2048, 3072, or
4096 for RSA.
:type key_size: int
:param key_ops:
:type key_ops: list[str or
~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
:param key_attributes:
:type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
:param tags: Application specific metadata in the form of key-value
pairs.
:type tags: dict[str, str]
:param curve: Elliptic curve name. For valid values, see
JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384',
'P-521', 'SECP256K1'
:type curve: str or
~azure.keyvault.v2016_10_01.models.JsonWebKeyCurveName
:param dict custom_headers: headers that will be added | python | {
"resource": ""
} |
q267456 | KeyVaultClient.import_key | test | def import_key(
self, vault_base_url, key_name, key, hsm=None, key_attributes=None, tags=None, custom_headers=None, raw=False, **operation_config):
"""Imports an externally created key, stores it, and returns key
parameters and attributes to the client.
The import key operation may be used to import any key type into an
Azure Key Vault. If the named key already exists, Azure Key Vault
creates a new version of the key. This operation requires the
keys/import permission.
:param vault_base_url: The vault name, for example
https://myvault.vault.azure.net.
:type vault_base_url: str
:param key_name: Name for the imported key.
:type key_name: str
:param key: The Json web key
:type key: ~azure.keyvault.v2016_10_01.models.JsonWebKey
:param hsm: Whether to import as a hardware key (HSM) or software key.
:type hsm: bool
:param key_attributes: The key management attributes.
:type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
:param tags: Application specific metadata in the form of key-value
pairs.
:type tags: dict[str, str]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: KeyBundle or ClientRawResponse if raw=true
:rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`KeyVaultErrorException<azure.keyvault.v2016_10_01.models.KeyVaultErrorException>`
"""
parameters = models.KeyImportParameters(hsm=hsm, key=key, key_attributes=key_attributes, tags=tags)
# Construct URL
url = self.import_key.metadata['url']
path_format_arguments = {
'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
| python | {
"resource": ""
} |
q267457 | KeyVaultClient.update_key | test | def update_key(
self, vault_base_url, key_name, key_version, key_ops=None, key_attributes=None, tags=None, custom_headers=None, raw=False, **operation_config):
"""The update key operation changes specified attributes of a stored key
and can be applied to any key type and key version stored in Azure Key
Vault.
In order to perform this operation, the key must already exist in the
Key Vault. Note: The cryptographic material of a key itself cannot be
changed. This operation requires the keys/update permission.
:param vault_base_url: The vault name, for example
https://myvault.vault.azure.net.
:type vault_base_url: str
:param key_name: The name of key to update.
:type key_name: str
:param key_version: The version of the key to update.
:type key_version: str
:param key_ops: Json web key operations. For more information on
possible key operations, see JsonWebKeyOperation.
:type key_ops: list[str or
~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
:param key_attributes:
:type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
:param tags: Application specific metadata in the form of key-value
pairs.
:type tags: dict[str, str]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
| python | {
"resource": ""
} |
q267458 | KeyVaultClient.set_secret | test | def set_secret(
self, vault_base_url, secret_name, value, tags=None, content_type=None, secret_attributes=None, custom_headers=None, raw=False, **operation_config):
"""Sets a secret in a specified key vault.
The SET operation adds a secret to the Azure Key Vault. If the named
secret already exists, Azure Key Vault creates a new version of that
secret. This operation requires the secrets/set permission.
:param vault_base_url: The vault name, for example
https://myvault.vault.azure.net.
:type vault_base_url: str
:param secret_name: The name of the secret.
:type secret_name: str
:param value: The value of the secret.
:type value: str
:param tags: Application specific metadata in the form of key-value
pairs.
:type tags: dict[str, str]
:param content_type: Type of the secret value such as a password.
:type content_type: str
:param secret_attributes: The secret management attributes.
:type secret_attributes:
~azure.keyvault.v2016_10_01.models.SecretAttributes
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: SecretBundle or ClientRawResponse if raw=true
:rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`KeyVaultErrorException<azure.keyvault.v2016_10_01.models.KeyVaultErrorException>`
"""
parameters = models.SecretSetParameters(value=value, tags=tags, content_type=content_type, secret_attributes=secret_attributes)
# Construct URL
url = self.set_secret.metadata['url']
path_format_arguments = {
'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
'secret-name': self._serialize.url("secret_name", secret_name, 'str', pattern=r'^[0-9a-zA-Z-]+$')
}
| python | {
"resource": ""
} |
q267459 | KeyVaultClient.set_certificate_issuer | test | def set_certificate_issuer(
self, vault_base_url, issuer_name, provider, credentials=None, organization_details=None, attributes=None, custom_headers=None, raw=False, **operation_config):
"""Sets the specified certificate issuer.
The SetCertificateIssuer operation adds or updates the specified
certificate issuer. This operation requires the certificates/setissuers
permission.
:param vault_base_url: The vault name, for example
https://myvault.vault.azure.net.
:type vault_base_url: str
:param issuer_name: The name of the issuer.
:type issuer_name: str
:param provider: The issuer provider.
:type provider: str
:param credentials: The credentials to be used for the issuer.
:type credentials:
~azure.keyvault.v2016_10_01.models.IssuerCredentials
:param organization_details: Details of the organization as provided
to the issuer.
:type organization_details:
~azure.keyvault.v2016_10_01.models.OrganizationDetails
:param attributes: Attributes of the issuer object.
:type attributes: ~azure.keyvault.v2016_10_01.models.IssuerAttributes
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: IssuerBundle or ClientRawResponse if raw=true
:rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`KeyVaultErrorException<azure.keyvault.v2016_10_01.models.KeyVaultErrorException>`
"""
parameter = models.CertificateIssuerSetParameters(provider=provider, credentials=credentials, organization_details=organization_details, attributes=attributes)
# Construct URL
url = self.set_certificate_issuer.metadata['url']
path_format_arguments = {
'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True),
'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str')
}
| python | {
"resource": ""
} |
q267460 | ServiceBusClient.from_connection_string | test | def from_connection_string(cls, conn_str, *, loop=None, **kwargs):
"""Create a Service Bus client from a connection string.
:param conn_str: The connection string.
:type conn_str: str
Example:
.. literalinclude:: ../examples/async_examples/test_examples_async.py
:start-after: [START create_async_servicebus_client_connstr]
:end-before: [END create_async_servicebus_client_connstr]
:language: python
:dedent: 4
:caption: Create a ServiceBusClient via a connection string.
"""
| python | {
"resource": ""
} |
q267461 | ServiceBusClient.get_subscription | test | def get_subscription(self, topic_name, subscription_name):
"""Get an async client for a subscription entity.
:param topic_name: The name of the topic.
:type topic_name: str
:param subscription_name: The name of the subscription.
:type subscription_name: str
:rtype: ~azure.servicebus.aio.async_client.SubscriptionClient
:raises: ~azure.servicebus.common.errors.ServiceBusConnectionError if the namespace is not found.
:raises: ~azure.servicebus.common.errors.ServiceBusResourceNotFound if the subscription is not found.
Example:
.. literalinclude:: ../examples/async_examples/test_examples_async.py
:start-after: [START get_async_subscription_client]
:end-before: [END get_async_subscription_client]
:language: python
:dedent: 4
:caption: Get a TopicClient for the specified topic.
"""
try:
subscription = self.mgmt_client.get_subscription(topic_name, subscription_name)
except requests.exceptions.ConnectionError as e:
| python | {
"resource": ""
} |
q267462 | ServiceBusClient.list_subscriptions | test | def list_subscriptions(self, topic_name):
"""Get an async client for all subscription entities in the topic.
:param topic_name: The topic to list subscriptions for.
:type topic_name: str
:rtype: list[~azure.servicebus.aio.async_client.SubscriptionClient]
:raises: ~azure.servicebus.common.errors.ServiceBusConnectionError if the namespace is not found.
:raises: ~azure.servicebus.common.errors.ServiceBusResourceNotFound if the topic is not found.
"""
try:
subs = self.mgmt_client.list_subscriptions(topic_name)
except requests.exceptions.ConnectionError as e:
raise ServiceBusConnectionError("Namespace: {} not found".format(self.service_namespace), e)
except AzureServiceBusResourceNotFound:
| python | {
"resource": ""
} |
q267463 | SendClientMixin.send | test | async def send(self, messages, message_timeout=0, session=None, **kwargs):
"""Send one or more messages to the current entity.
This operation will open a single-use connection, send the supplied messages, and close
connection. If the entity requires sessions, a session ID must be either
provided here, or set on each outgoing message.
:param messages: One or more messages to be sent.
:type messages: ~azure.servicebus.aio.async_message.Message or
list[~azure.servicebus.aio.async_message.Message]
:param message_timeout: The period in seconds during which the Message must be
sent. If the send is not completed in this time it will return a failure result.
:type message_timeout: int
:param session: An optional session ID. If supplied this session ID will be
applied to every outgoing message sent with this Sender.
If an individual message already has a session ID, that will be
used instead. If no session ID is supplied here, nor set on an outgoing
message, a ValueError will be raised if the entity is sessionful.
:type session: str or ~uuid.Guid
:raises: ~azure.servicebus.common.errors.MessageSendFailed
:returns: A list of the send results of | python | {
"resource": ""
} |
q267464 | SendClientMixin.get_sender | test | def get_sender(self, message_timeout=0, session=None, **kwargs):
"""Get a Sender for the Service Bus endpoint.
A Sender represents a single open connection within which multiple send operations can be made.
:param message_timeout: The period in seconds during which messages sent with
this Sender must be sent. If the send is not completed in this time it will fail.
:type message_timeout: int
:param session: An optional session ID. If supplied this session ID will be
applied to every outgoing message sent with this Sender.
If an individual message already has a session ID, that will be
used instead. If no session ID is supplied here, nor set on an outgoing
message, a ValueError will be raised if the entity is sessionful.
:type session: str or ~uuid.Guid
:returns: A Sender instance with an unopened connection.
:rtype: ~azure.servicebus.aio.async_send_handler.Sender
Example:
.. literalinclude:: ../examples/async_examples/test_examples_async.py
:start-after: [START open_close_sender_context]
:end-before: [END open_close_sender_context]
:language: python
:dedent: 4
| python | {
"resource": ""
} |
q267465 | ReceiveClientMixin.get_receiver | test | def get_receiver(self, session=None, prefetch=0, mode=ReceiveSettleMode.PeekLock, idle_timeout=0, **kwargs):
"""Get a Receiver for the Service Bus endpoint.
A Receiver represents a single open connection with which multiple receive operations can be made.
:param session: A specific session from which to receive. This must be specified for a
sessionful entity, otherwise it must be None. In order to receive the next available
session, set this to NEXT_AVAILABLE.
:type session: str or ~azure.servicebus.common.constants.NEXT_AVAILABLE
:param prefetch: The maximum number of messages to cache with each request to the service.
The default value is 0, meaning messages will be received from the service and processed
one at a time. Increasing this value will improve message throughput performance but increase
the chance that messages will expire while they are cached if they're not processed fast enough.
:type prefetch: int
:param mode: The mode with which messages will be retrieved from the entity. The two options
are PeekLock and ReceiveAndDelete. Messages received with PeekLock must be settled within a given
lock period before they will be removed from the queue. Messages received with ReceiveAndDelete
will be immediately removed from the queue, and cannot be subsequently rejected or re-received if
| python | {
"resource": ""
} |
q267466 | ReceiveClientMixin.get_deadletter_receiver | test | def get_deadletter_receiver(
self, transfer_deadletter=False, prefetch=0,
mode=ReceiveSettleMode.PeekLock, idle_timeout=0, **kwargs):
"""Get a Receiver for the deadletter endpoint of the entity.
A Receiver represents a single open connection with which multiple receive operations can be made.
:param transfer_deadletter: Whether to connect to the transfer deadletter queue, or the standard
deadletter queue. Default is False, using the standard deadletter endpoint.
:type transfer_deadletter: bool
:param prefetch: The maximum number of messages to cache with each request to the service.
The default value is 0, meaning messages will be received from the service and processed
one at a time. Increasing this value will improve message throughput performance but increase
the change that messages will expire while they are cached if they're not processed fast enough.
:type prefetch: int
:param mode: The mode with which messages will be retrieved from the entity. The two options
are PeekLock and ReceiveAndDelete. Messages received with PeekLock must be settled within a given
lock period before they will be removed from the queue. Messages received with ReceiveAndDelete
will be immediately removed from the queue, and cannot be subsequently rejected or re-received if
the client fails to process the message. The default mode is PeekLock.
:type mode: ~azure.servicebus.common.constants.ReceiveSettleMode
:param idle_timeout: The timeout in seconds between received messages after which the receiver will
automatically shutdown. The default value is 0, meaning no timeout.
:type idle_timeout: int
:returns: A Receiver instance with an unopened | python | {
"resource": ""
} |
q267467 | parse_response_for_async_op | test | def parse_response_for_async_op(response):
''' Extracts request id from response header. '''
if response is None:
return None
result = AsynchronousOperationResult()
if response.headers:
| python | {
"resource": ""
} |
q267468 | _ServiceManagementClient.perform_get | test | def perform_get(self, path, x_ms_version=None):
'''
Performs a GET request and returns the response.
path:
Path to the resource.
Ex: '/<subscription-id>/services/hostedservices/<service-name>'
x_ms_version:
If specified, this is used for the x-ms-version header.
Otherwise, self.x_ms_version is used.
'''
request = HTTPRequest()
request.method = 'GET'
request.host = self.host
request.path = path
| python | {
"resource": ""
} |
q267469 | _ServiceManagementClient.perform_put | test | def perform_put(self, path, body, x_ms_version=None):
'''
Performs a PUT request and returns the response.
path:
Path to the resource.
Ex: '/<subscription-id>/services/hostedservices/<service-name>'
body:
Body for the PUT request.
x_ms_version:
If specified, this is used for the x-ms-version header.
Otherwise, self.x_ms_version is used.
'''
request = HTTPRequest()
request.method = 'PUT'
request.host = self.host
| python | {
"resource": ""
} |
q267470 | _ServiceManagementClient.wait_for_operation_status | test | def wait_for_operation_status(self,
request_id, wait_for_status='Succeeded', timeout=30, sleep_interval=5,
progress_callback=wait_for_operation_status_progress_default_callback,
success_callback=wait_for_operation_status_success_default_callback,
failure_callback=wait_for_operation_status_failure_default_callback):
'''
Waits for an asynchronous operation to complete.
This calls get_operation_status in a loop and returns when the expected
status is reached. The result of get_operation_status is returned. By
default, an exception is raised on timeout or error status.
request_id:
The request ID for the request you wish to track.
wait_for_status:
Status to wait for. Default is 'Succeeded'.
timeout:
Total timeout in seconds. Default is 30s.
sleep_interval:
Sleep time in seconds for each iteration. Default is 5s.
progress_callback:
Callback for each iteration. | python | {
"resource": ""
} |
q267471 | _ServiceManagementClient.get_operation_status | test | def get_operation_status(self, request_id):
'''
Returns the status of the specified operation. After calling an
asynchronous operation, you can call Get Operation Status to determine
whether the operation has succeeded, failed, or is still in progress.
request_id:
The request ID for the | python | {
"resource": ""
} |
q267472 | _ServiceManagementClient._update_management_header | test | def _update_management_header(self, request, x_ms_version):
''' Add additional headers for management. '''
if request.method in ['PUT', 'POST', 'MERGE', 'DELETE']:
request.headers.append(('Content-Length', str(len(request.body))))
# append additional headers base on the service
request.headers.append(('x-ms-version', x_ms_version or self.x_ms_version))
# if it is not GET or HEAD request, must set content-type.
if | python | {
"resource": ""
} |
q267473 | travis_build_package | test | def travis_build_package():
"""Assumed called on Travis, to prepare a package to be deployed
This method prints on stdout for Travis.
Return is obj to pass to sys.exit() directly
"""
travis_tag = os.environ.get('TRAVIS_TAG')
if not travis_tag:
print("TRAVIS_TAG environment variable is not present")
return "TRAVIS_TAG environment variable is not present"
try:
name, version = travis_tag.split("_")
except ValueError:
print("TRAVIS_TAG is not '<package_name>_<version>' (tag is: {})".format(travis_tag))
return "TRAVIS_TAG is not '<package_name>_<version>' (tag is: {})".format(travis_tag)
try:
version = Version(version)
except InvalidVersion:
print("Version must be a valid PEP440 version (version is: {})".format(version))
return "Version must be a valid PEP440 version (version is: {})".format(version)
if name.lower() in OMITTED_RELEASE_PACKAGES:
| python | {
"resource": ""
} |
q267474 | KeyVaultClient.get_certificates | test | def get_certificates(
self, vault_base_url, maxresults=None, include_pending=None, custom_headers=None, raw=False, **operation_config):
"""List certificates in a specified key vault.
The GetCertificates operation returns the set of certificates resources
in the specified key vault. This operation requires the
certificates/list permission.
:param vault_base_url: The vault name, for example
https://myvault.vault.azure.net.
:type vault_base_url: str
:param maxresults: Maximum number of results to return in a page. If
not specified the service will return up to 25 results.
:type maxresults: int
:param include_pending: Specifies whether to include certificates
which are not completely provisioned.
:type include_pending: bool
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of CertificateItem
:rtype:
~azure.keyvault.v7_0.models.CertificateItemPaged[~azure.keyvault.v7_0.models.CertificateItem]
:raises:
:class:`KeyVaultErrorException<azure.keyvault.v7_0.models.KeyVaultErrorException>`
"""
def internal_paging(next_link=None, raw=False):
if not next_link:
# Construct URL
url = self.get_certificates.metadata['url']
path_format_arguments = {
'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True)
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if maxresults is not None:
query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1)
if include_pending is not None:
query_parameters['includePending'] = self._serialize.query("include_pending", include_pending, 'bool')
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
else:
| python | {
"resource": ""
} |
q267475 | ServiceBusManagementService.get_regions | test | def get_regions(self):
'''
Get list of available service bus regions.
'''
response = self._perform_get(
self._get_path('services/serviceBus/Regions/', None),
None)
| python | {
"resource": ""
} |
q267476 | ServiceBusManagementService.list_namespaces | test | def list_namespaces(self):
'''
List the service bus namespaces defined on the account.
'''
response = self._perform_get(
| python | {
"resource": ""
} |
q267477 | ServiceBusManagementService.get_namespace | test | def get_namespace(self, name):
'''
Get details about a specific namespace.
name:
Name of the service bus namespace.
| python | {
"resource": ""
} |
q267478 | ServiceBusManagementService.create_namespace | test | def create_namespace(self, name, region):
'''
Create a new service bus namespace.
name:
Name of the service bus namespace to create.
region:
Region to create the namespace in.
'''
_validate_not_none('name', | python | {
"resource": ""
} |
q267479 | ServiceBusManagementService.delete_namespace | test | def delete_namespace(self, name):
'''
Delete a service bus namespace.
name:
Name of the service bus namespace to | python | {
"resource": ""
} |
q267480 | ServiceBusManagementService.check_namespace_availability | test | def check_namespace_availability(self, name):
'''
Checks to see if the specified service bus namespace is available, or
if it has already been taken.
name:
Name of the service bus namespace to validate.
'''
_validate_not_none('name', name)
response = self._perform_get(
| python | {
"resource": ""
} |
q267481 | ServiceBusManagementService.list_topics | test | def list_topics(self, name):
'''
Retrieves the topics in the service namespace.
name:
Name of the service bus namespace.
'''
response = self._perform_get(
self._get_list_topics_path(name),
None)
return | python | {
"resource": ""
} |
q267482 | ServiceBusManagementService.list_notification_hubs | test | def list_notification_hubs(self, name):
'''
Retrieves the notification hubs in the service namespace.
name:
Name of the service bus namespace.
'''
response = self._perform_get(
self._get_list_notification_hubs_path(name),
None)
return | python | {
"resource": ""
} |
q267483 | ServiceBusManagementService.list_relays | test | def list_relays(self, name):
'''
Retrieves the relays in the service namespace.
name:
Name of the service bus namespace.
'''
response = self._perform_get(
self._get_list_relays_path(name),
None)
return | python | {
"resource": ""
} |
q267484 | ServiceBusManagementService.get_metrics_rollups_queue | test | def get_metrics_rollups_queue(self, name, queue_name, metric):
'''
This operation gets rollup data for Service Bus metrics queue.
Rollup data includes the time granularity for the telemetry aggregation as well as
the retention settings for each time granularity.
name:
Name of the service bus namespace.
queue_name:
Name of the service bus queue in this namespace.
metric:
name of a supported metric
'''
| python | {
"resource": ""
} |
q267485 | ServiceBusManagementService.get_metrics_rollups_topic | test | def get_metrics_rollups_topic(self, name, topic_name, metric):
'''
This operation gets rollup data for Service Bus metrics topic.
Rollup data includes the time granularity for the telemetry aggregation as well as
the retention settings for each time granularity.
name:
Name of the service bus namespace.
topic_name:
Name of the service bus queue in this namespace.
metric:
name of a supported metric
'''
| python | {
"resource": ""
} |
q267486 | ServiceBusManagementService.get_metrics_rollups_notification_hub | test | def get_metrics_rollups_notification_hub(self, name, hub_name, metric):
'''
This operation gets rollup data for Service Bus metrics notification hub.
Rollup data includes the time granularity for the telemetry aggregation as well as
the retention settings for each time granularity.
name:
Name of the service bus namespace.
hub_name:
Name of the service bus notification hub in this namespace.
metric:
name of a supported metric
'''
| python | {
"resource": ""
} |
q267487 | ServiceBusManagementService.get_metrics_rollups_relay | test | def get_metrics_rollups_relay(self, name, relay_name, metric):
'''
This operation gets rollup data for Service Bus metrics relay.
Rollup data includes the time granularity for the telemetry aggregation as well as
the retention settings for each time granularity.
name:
Name of the service bus namespace.
relay_name:
Name of the service bus relay in this namespace.
metric:
name of a supported metric
'''
| python | {
"resource": ""
} |
q267488 | create | test | def create(env_dir, system_site_packages=False, clear=False,
symlinks=False, with_pip=False, prompt=None):
"""Create a virtual environment in a directory."""
builder = ExtendedEnvBuilder(system_site_packages=system_site_packages,
| python | {
"resource": ""
} |
q267489 | create_venv_with_package | test | def create_venv_with_package(packages):
"""Create a venv with these packages in a temp dir and yielf the env.
packages should be an iterable of pip version instructio (e.g. package~=1.2.3)
"""
with tempfile.TemporaryDirectory() as tempdir:
myenv = create(tempdir, with_pip=True)
pip_call = [
myenv.env_exe,
"-m",
"pip",
| python | {
"resource": ""
} |
q267490 | SqlDatabaseManagementService.create_server | test | def create_server(self, admin_login, admin_password, location):
'''
Create a new Azure SQL Database server.
admin_login:
The administrator login name for the new server.
admin_password:
The administrator login password for the new server.
location:
The region to deploy the new server.
| python | {
"resource": ""
} |
q267491 | SqlDatabaseManagementService.set_server_admin_password | test | def set_server_admin_password(self, server_name, admin_password):
'''
Reset the administrator password for a server.
server_name:
Name of the server to change the password.
admin_password:
The new administrator password for the server.
'''
_validate_not_none('server_name', server_name)
_validate_not_none('admin_password', admin_password)
| python | {
"resource": ""
} |
q267492 | SqlDatabaseManagementService.list_quotas | test | def list_quotas(self, server_name):
'''
Gets quotas for an Azure SQL Database Server.
server_name:
Name of the server.
'''
_validate_not_none('server_name', server_name)
response = self._perform_get(self._get_quotas_path(server_name),
| python | {
"resource": ""
} |
q267493 | SqlDatabaseManagementService.get_server_event_logs | test | def get_server_event_logs(self, server_name, start_date,
interval_size_in_minutes, event_types=''):
'''
Gets the event logs for an Azure SQL Database Server.
server_name:
Name of the server to retrieve the event logs from.
start_date:
The starting date and time of the events to retrieve in UTC format,
for example '2011-09-28 16:05:00'.
interval_size_in_minutes:
Size of the event logs to retrieve (in minutes).
Valid values are: 5, 60, or 1440.
event_types:
The event type of the log entries you want to retrieve.
Valid values are:
- connection_successful
- connection_failed
- connection_terminated
- deadlock
- throttling
- throttling_long_transaction
To return all event types pass | python | {
"resource": ""
} |
q267494 | SqlDatabaseManagementService.create_firewall_rule | test | def create_firewall_rule(self, server_name, name, start_ip_address,
end_ip_address):
'''
Creates an Azure SQL Database server firewall rule.
server_name:
Name of the server to set the firewall rule on.
name:
The name of the new firewall rule.
start_ip_address:
The lowest IP address in the range of the server-level firewall
setting. IP addresses equal to or greater than this can attempt to
connect to the server. The lowest possible IP address is 0.0.0.0.
end_ip_address:
The highest IP address in the range of the server-level firewall
setting. IP addresses equal to or less than this can attempt to
| python | {
"resource": ""
} |
q267495 | SqlDatabaseManagementService.update_firewall_rule | test | def update_firewall_rule(self, server_name, name, start_ip_address,
end_ip_address):
'''
Update a firewall rule for an Azure SQL Database server.
server_name:
Name of the server to set the firewall rule on.
name:
The name of the firewall rule to update.
start_ip_address:
The lowest IP address in the range of the server-level firewall
setting. IP addresses equal to or greater than this can attempt to
connect to the server. The lowest possible IP address is 0.0.0.0.
end_ip_address:
The highest IP address in the range of the server-level firewall
setting. IP addresses equal to or less than this can attempt to
| python | {
"resource": ""
} |
q267496 | SqlDatabaseManagementService.delete_firewall_rule | test | def delete_firewall_rule(self, server_name, name):
'''
Deletes an Azure SQL Database server firewall rule.
server_name:
Name of the server with the firewall rule you want to delete.
name:
Name of the firewall rule you want to delete.
| python | {
"resource": ""
} |
q267497 | SqlDatabaseManagementService.list_firewall_rules | test | def list_firewall_rules(self, server_name):
'''
Retrieves the set of firewall rules for an Azure SQL Database Server.
server_name:
Name of the server.
'''
_validate_not_none('server_name', server_name)
| python | {
"resource": ""
} |
q267498 | SqlDatabaseManagementService.list_service_level_objectives | test | def list_service_level_objectives(self, server_name):
'''
Gets the service level objectives for an Azure SQL Database server.
server_name:
Name of the server.
'''
_validate_not_none('server_name', server_name)
response = self._perform_get(
| python | {
"resource": ""
} |
q267499 | SqlDatabaseManagementService.create_database | test | def create_database(self, server_name, name, service_objective_id,
edition=None, collation_name=None,
max_size_bytes=None):
'''
Creates a new Azure SQL Database.
server_name:
Name of the server to contain the new database.
name:
Required. The name for the new database. See Naming Requirements
in Azure SQL Database General Guidelines and Limitations and
Database Identifiers for more information.
service_objective_id:
Required. The GUID corresponding to the performance level for
Edition. See List Service Level Objectives for current values.
edition:
Optional. The Service Tier (Edition) for the new database. If
omitted, the default is Web. Valid values are Web, Business,
Basic, Standard, and Premium. See Azure SQL Database Service Tiers
(Editions) and Web and Business Edition Sunset FAQ for more
information.
collation_name:
Optional. The database collation. This can be any collation
supported by SQL. If omitted, the default collation is used. See
SQL Server Collation Support in Azure SQL Database General
Guidelines and Limitations for more information.
max_size_bytes:
| python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.