azure.mgmt.core package¶
- class azure.mgmt.core.ARMPipelineClient(base_url: str, **kwargs: Any)[source]¶
A pipeline client designed for ARM explicitly.
- Parameters:
base_url (str) – URL for the request.
- Keyword Arguments:
pipeline (Pipeline) – If omitted, a Pipeline object is created and returned.
policies (list[HTTPPolicy]) – If omitted, the standard policies of the configuration object is used.
per_call_policies (Union[HTTPPolicy, SansIOHTTPPolicy, list[HTTPPolicy], list[SansIOHTTPPolicy]]) – If specified, the policies will be added into the policy list before RetryPolicy
per_retry_policies (Union[HTTPPolicy, SansIOHTTPPolicy, list[HTTPPolicy], list[SansIOHTTPPolicy]]) – If specified, the policies will be added into the policy list after RetryPolicy
transport (HttpTransport) – If omitted, RequestsTransport is used for synchronous transport.
- delete(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, content: Any = None, form_content: Dict[str, Any] | None = None) HttpRequest ¶
Create a DELETE request object.
- format_url(url_template: str, **kwargs: Any) str ¶
Format request URL with the client base URL, unless the supplied URL is already absolute.
Note that both the base url and the template url can contain query parameters.
- get(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, content: Any = None, form_content: Dict[str, Any] | None = None) HttpRequest ¶
Create a GET request object.
- head(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, content: Any = None, form_content: Dict[str, Any] | None = None, stream_content: Any = None) HttpRequest ¶
Create a HEAD request object.
- Parameters:
- Returns:
An HttpRequest object
- Return type:
- merge(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, content: Any = None, form_content: Dict[str, Any] | None = None) HttpRequest ¶
Create a MERGE request object.
- options(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, *, content: bytes | str | Dict[Any, Any] | None = None, form_content: Dict[Any, Any] | None = None, **kwargs: Any) HttpRequest ¶
Create a OPTIONS request object.
- Parameters:
- Keyword Arguments:
content – The body content
form_content (dict) – Form content
- Returns:
An HttpRequest object
- Return type:
- patch(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, content: Any = None, form_content: Dict[str, Any] | None = None, stream_content: Any = None) HttpRequest ¶
Create a PATCH request object.
- Parameters:
- Returns:
An HttpRequest object
- Return type:
- post(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, content: Any = None, form_content: Dict[str, Any] | None = None, stream_content: Any = None) HttpRequest ¶
Create a POST request object.
- Parameters:
- Returns:
An HttpRequest object
- Return type:
- put(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, content: Any = None, form_content: Dict[str, Any] | None = None, stream_content: Any = None) HttpRequest ¶
Create a PUT request object.
- Parameters:
- Returns:
An HttpRequest object
- Return type:
- send_request(request: HTTPRequestType, *, stream: bool = False, **kwargs: Any) HTTPResponseType ¶
Method that runs the network request through the client’s chained policies.
>>> from azure.core.rest import HttpRequest >>> request = HttpRequest('GET', 'http://www.example.com') <HttpRequest [GET], url: 'http://www.example.com'> >>> response = client.send_request(request) <HttpResponse: 200 OK>
- Parameters:
request (HttpRequest) – The network request you want to make. Required.
- Keyword Arguments:
stream (bool) – Whether the response payload will be streamed. Defaults to False.
- Returns:
The response of your network call. Does not do error handling on your response.
- Return type:
- class azure.mgmt.core.AsyncARMPipelineClient(base_url: str, **kwargs: Any)[source]¶
A pipeline client designed for ARM explicitly.
- Parameters:
base_url (str) – URL for the request.
- Keyword Arguments:
pipeline (AsyncPipeline) – If omitted, a Pipeline object is created and returned.
policies (list[AsyncHTTPPolicy]) – If omitted, the standard policies of the configuration object is used.
per_call_policies (Union[AsyncHTTPPolicy, SansIOHTTPPolicy, list[AsyncHTTPPolicy], list[SansIOHTTPPolicy]]) – If specified, the policies will be added into the policy list before RetryPolicy
per_retry_policies (Union[AsyncHTTPPolicy, SansIOHTTPPolicy, list[AsyncHTTPPolicy], list[SansIOHTTPPolicy]]) – If specified, the policies will be added into the policy list after RetryPolicy
transport (AsyncHttpTransport) – If omitted, AioHttpTransport is used for asynchronous transport.
- delete(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, content: Any = None, form_content: Dict[str, Any] | None = None) HttpRequest ¶
Create a DELETE request object.
- format_url(url_template: str, **kwargs: Any) str ¶
Format request URL with the client base URL, unless the supplied URL is already absolute.
Note that both the base url and the template url can contain query parameters.
- get(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, content: Any = None, form_content: Dict[str, Any] | None = None) HttpRequest ¶
Create a GET request object.
- head(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, content: Any = None, form_content: Dict[str, Any] | None = None, stream_content: Any = None) HttpRequest ¶
Create a HEAD request object.
- Parameters:
- Returns:
An HttpRequest object
- Return type:
- merge(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, content: Any = None, form_content: Dict[str, Any] | None = None) HttpRequest ¶
Create a MERGE request object.
- options(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, *, content: bytes | str | Dict[Any, Any] | None = None, form_content: Dict[Any, Any] | None = None, **kwargs: Any) HttpRequest ¶
Create a OPTIONS request object.
- Parameters:
- Keyword Arguments:
content – The body content
form_content (dict) – Form content
- Returns:
An HttpRequest object
- Return type:
- patch(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, content: Any = None, form_content: Dict[str, Any] | None = None, stream_content: Any = None) HttpRequest ¶
Create a PATCH request object.
- Parameters:
- Returns:
An HttpRequest object
- Return type:
- post(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, content: Any = None, form_content: Dict[str, Any] | None = None, stream_content: Any = None) HttpRequest ¶
Create a POST request object.
- Parameters:
- Returns:
An HttpRequest object
- Return type:
- put(url: str, params: Dict[str, str] | None = None, headers: Dict[str, str] | None = None, content: Any = None, form_content: Dict[str, Any] | None = None, stream_content: Any = None) HttpRequest ¶
Create a PUT request object.
- Parameters:
- Returns:
An HttpRequest object
- Return type:
- send_request(request: HTTPRequestType, *, stream: bool = False, **kwargs: Any) Awaitable[AsyncHTTPResponseType] ¶
Method that runs the network request through the client’s chained policies.
>>> from azure.core.rest import HttpRequest >>> request = HttpRequest('GET', 'http://www.example.com') <HttpRequest [GET], url: 'http://www.example.com'> >>> response = await client.send_request(request) <AsyncHttpResponse: 200 OK>
- Parameters:
request (HttpRequest) – The network request you want to make. Required.
- Keyword Arguments:
stream (bool) – Whether the response payload will be streamed. Defaults to False.
- Returns:
The response of your network call. Does not do error handling on your response.
- Return type:
Subpackages¶
- azure.mgmt.core.policies package
ARMAutoResourceProviderRegistrationPolicy
ARMChallengeAuthenticationPolicy
ARMChallengeAuthenticationPolicy.authorize_request()
ARMChallengeAuthenticationPolicy.on_challenge()
ARMChallengeAuthenticationPolicy.on_exception()
ARMChallengeAuthenticationPolicy.on_request()
ARMChallengeAuthenticationPolicy.on_response()
ARMChallengeAuthenticationPolicy.send()
ARMChallengeAuthenticationPolicy.next
ARMHttpLoggingPolicy
AsyncARMAutoResourceProviderRegistrationPolicy
AsyncARMChallengeAuthenticationPolicy
AsyncARMChallengeAuthenticationPolicy.authorize_request()
AsyncARMChallengeAuthenticationPolicy.on_challenge()
AsyncARMChallengeAuthenticationPolicy.on_exception()
AsyncARMChallengeAuthenticationPolicy.on_request()
AsyncARMChallengeAuthenticationPolicy.on_response()
AsyncARMChallengeAuthenticationPolicy.send()
AsyncARMChallengeAuthenticationPolicy.next
AsyncAuxiliaryAuthenticationPolicy
AuxiliaryAuthenticationPolicy
- azure.mgmt.core.polling package
Submodules¶
azure.mgmt.core.exceptions module¶
- class azure.mgmt.core.exceptions.ARMErrorFormat(json_object: Mapping[str, Any])[source]¶
Describe error format from ARM, used at the base or inside “details” node.
This format is compatible with ODataV4 format. https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-details.md#error-response-content
- message_details() str ¶
Return a detailed string of the error.
- Returns:
A string with the details of the error.
- Return type:
- CODE_LABEL = 'code'¶
- DETAILS_LABEL = 'details'¶
- INNERERROR_LABEL = 'innererror'¶
- MESSAGE_LABEL = 'message'¶
- TARGET_LABEL = 'target'¶
- property error: SelfODataV4Format¶
azure.mgmt.core.tools module¶
- azure.mgmt.core.tools.get_arm_endpoints(cloud_setting: AzureClouds) Dict[str, Any] [source]¶
Get the ARM endpoint and ARM credential scopes for the given cloud setting.
- azure.mgmt.core.tools.is_valid_resource_id(rid: str, exception_type: Type[BaseException] | None = None) bool [source]¶
Validates the given resource id.
- azure.mgmt.core.tools.is_valid_resource_name(rname: str, exception_type: Type[BaseException] | None = None) bool [source]¶
Validates the given resource name to ARM guidelines, individual services may be more restrictive.
- azure.mgmt.core.tools.parse_resource_id(rid: str) Mapping[str, str | int] [source]¶
Parses a resource_id into its various parts.
Returns a dictionary with a single key-value pair, ‘name’: rid, if invalid resource id.
- Parameters:
rid (str) – The resource id being parsed
- Returns:
A dictionary with with following key/value pairs (if found):
subscription: Subscription id
resource_group: Name of resource group
namespace: Namespace for the resource provider (i.e. Microsoft.Compute)
type: Type of the root resource (i.e. virtualMachines)
name: Name of the root resource
child_namespace_{level}: Namespace for the child resource of that level
child_type_{level}: Type of the child resource of that level
child_name_{level}: Name of the child resource of that level
last_child_num: Level of the last child
resource_parent: Computed parent in the following pattern: providers/{namespace} /{parent}/{type}/{name}
resource_namespace: Same as namespace. Note that this may be different than the target resource’s namespace.
resource_type: Type of the target resource (not the parent)
resource_name: Name of the target resource (not the parent)
- Return type:
- azure.mgmt.core.tools.resource_id(**kwargs: str | None) str [source]¶
Create a valid resource id string from the given parts.
This method builds the resource id from the left until the next required id parameter to be appended is not found. It then returns the built up id.
- Keyword Arguments:
subscription (str) – (required) Subscription id
resource_group (str) – Name of resource group
namespace (str) – Namespace for the resource provider (i.e. Microsoft.Compute)
type (str) – Type of the resource (i.e. virtualMachines)
name (str) – Name of the resource (or parent if child_name is also specified)
child_namespace_{level} (str) – Namespace for the child resource of that level (optional)
child_type_{level} (str) – Type of the child resource of that level
child_name_{level} (str) – Name of the child resource of that level
- Returns:
A resource id built from the given arguments.
- Return type: