AzureautomationClient
Classes
CreateJobResponse
dataclass
Response for Get status of job
SubscriptionListResult
dataclass
SubscriptionListResult(*, value: Optional[List[Subscription | Mapping[str, Any]]] = None, next_link: Optional[str] = None)
ResourceGroupListResult
dataclass
ResourceGroupListResult(*, value: Optional[List[ResourceGroup | Mapping[str, Any]]] = None, next_link: Optional[str] = None)
AutomationAccountResponse
dataclass
RunbookListResults
dataclass
Response for List runbooks
Subscription
dataclass
Subscription(*, id: Optional[str] = None, subscription_id: Optional[str] = None, tenant_id: Optional[str] = None, display_name: Optional[str] = None, state: Optional[str] = None, authorization_source: Optional[str] = None)
Definition: Subscription
Attributes
id
class-attribute
instance-attribute
The fully qualified Id. For example, /subscriptions/00000000-0000-0000-0000-000000000000.
subscription_id
class-attribute
instance-attribute
subscription_id: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'subscriptionId'})
The subscription Id.
tenant_id
class-attribute
instance-attribute
tenant_id: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'tenantId'})
The tenant Id.
display_name
class-attribute
instance-attribute
display_name: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'displayName'})
The subscription display name.
state
class-attribute
instance-attribute
The subscription state.
authorization_source
class-attribute
instance-attribute
authorization_source: Optional[str] = dataclass_field(default=None, kw_only=True, metadata={'wire_name': 'authorizationSource'})
The authorization source of the request. Valid values are one or more combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'.
ResourceGroup
dataclass
ResourceGroup(*, id: Optional[str] = None, name: Optional[str] = None, managed_by: Optional[str] = None)
Definition: ResourceGroup
Attributes
id
class-attribute
instance-attribute
The ID of the resource group (e.g. /subscriptions/XXX/resourceGroups/YYY).
name
class-attribute
instance-attribute
The Name of the resource group.
AzureautomationClient
AzureautomationClient(connection_runtime_url: str, credential: AsyncTokenCredential | AzureKeyCredential, *, max_retry_attempts: int = 3, timeout: float = 30.0, use_exponential_backoff: bool = True, initial_retry_delay_seconds: float = 0.5, maximum_retry_delay_seconds: float = 120.0, retry_jitter_factor: float = 0.1, retry_unsafe_http_methods: bool = False, transport: Optional[AsyncHttpTransport] = None, **kwargs: Any)
Bases: ConnectorClientBase
Typed client for azureautomation connector.
Initialize a AzureautomationClient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connection_runtime_url
|
str
|
The connection runtime URL from Azure Portal. |
required |
credential
|
AsyncTokenCredential | AzureKeyCredential
|
Caller-owned Azure Core credential. |
required |
max_retry_attempts
|
int
|
The maximum number of request attempts. |
3
|
timeout
|
float
|
The network timeout in seconds for each request. The value configures Azure Core retry and transport deadlines. Nonpositive values disable SDK and transport deadlines. |
30.0
|
use_exponential_backoff
|
bool
|
Whether retries use exponential backoff. |
True
|
initial_retry_delay_seconds
|
float
|
The initial retry delay in seconds. |
0.5
|
maximum_retry_delay_seconds
|
float
|
The maximum retry delay in seconds. |
120.0
|
retry_jitter_factor
|
float
|
The jitter fraction applied to retry delays. |
0.1
|
retry_unsafe_http_methods
|
bool
|
Whether unsafe HTTP methods may be retried. |
False
|
transport
|
Optional[AsyncHttpTransport]
|
Optional Azure Core async HTTP transport closed by the client through its asynchronous lifecycle. |
None
|
**kwargs
|
Any
|
Optional Azure Core pipeline policy settings. |
{}
|
Methods:
get_job_output
async
get_job_output(subscription_id: str, resource_group_name: str, automation_account: str, job_id: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> bytes
Get job output
Get outputs of an Azure Automation job.
Swagger operation ID: GetJobOutput.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
str
|
The unique identifier for the Microsoft Azure subscription. The subscription ID forms part of the ID for every Azure resource. |
required |
resource_group_name
|
str
|
The name of the Azure Resource Group. |
required |
automation_account
|
str
|
The name of the Azure Automation Account. |
required |
job_id
|
str
|
GUID for the ID of the run. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
bytes |
bytes
|
The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
get_status_of_job
async
get_status_of_job(subscription_id: str, resource_group_name: str, automation_account: str, job_id: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Get status of job
Get Status of a Job
Swagger operation ID: GetStatusOfJob.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
str
|
The unique identifier for the Microsoft Azure subscription. The subscription ID forms part of the ID for every Azure resource. |
required |
resource_group_name
|
str
|
The name of the Azure Resource Group. |
required |
automation_account
|
str
|
The name of the Azure Automation Account. |
required |
job_id
|
str
|
GUID for the ID of the run. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
create_job
async
create_job(input: CreateJobInput | Mapping[str, Any], subscription_id: str, resource_group_name: str, automation_account: str, *, runbook_name: Optional[str] = None, wait: Optional[bool] = None, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Create job
Create Job to run on hybrid worker
Swagger operation ID: CreateJob.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
CreateJobInput | Mapping[str, Any]
|
The request body. Mapping keys use serialized Swagger wire names. |
required |
subscription_id
|
str
|
The unique identifier for the Microsoft Azure subscription. The subscription ID forms part of the ID for every Azure resource. |
required |
resource_group_name
|
str
|
The name of the Azure Resource Group. |
required |
automation_account
|
str
|
The name of the Azure Automation Account. |
required |
runbook_name
|
Optional[str]
|
Name of the runbook to run. |
None
|
wait
|
Optional[bool]
|
Wait for the job to finish before completing the action. |
None
|
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
list_subscriptions
list_subscriptions(*, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> AsyncItemPaged[dict[str, Any]]
List subscriptions
Gets a list of all the subscriptions to which the principal has access.
Returns an Azure Core async pager that follows the connector continuation URL.
Swagger operation ID: Subscriptions_List.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
AsyncItemPaged[dict[str, Any]]
|
AsyncItemPaged[dict[str, Any]]: An Azure Core pager over connector
results. Consume it with |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
list_resource_groups
list_resource_groups(subscription_id: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> AsyncItemPaged[dict[str, Any]]
List resource groups
Lists all the resource groups within the subscription. Paginates at 1,000 records.
Returns an Azure Core async pager that follows the connector continuation URL.
Swagger operation ID: ResourceGroups_List.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
str
|
The unique identifier for the Microsoft Azure subscription. The subscription ID forms part of the ID for every Azure resource. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
AsyncItemPaged[dict[str, Any]]
|
AsyncItemPaged[dict[str, Any]]: An Azure Core pager over connector
results. Consume it with |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
list_automation_accounts
list_automation_accounts(subscription_id: str, resource_group_name: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> AsyncItemPaged[dict[str, Any]]
List Automation accounts
Lists Azure Automation accounts in a resource group.
Returns a single-page Azure Core async collection.
Swagger operation ID: AutomationAccounts_List.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
str
|
The unique identifier for the Microsoft Azure subscription. The subscription ID forms part of the ID for every Azure resource. |
required |
resource_group_name
|
str
|
The name of the Azure Resource Group. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
AsyncItemPaged[dict[str, Any]]
|
AsyncItemPaged[dict[str, Any]]: An Azure Core pager over connector
results. Consume it with |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
list_runbooks
list_runbooks(subscription_id: str, resource_group_name: str, automation_account: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> AsyncItemPaged[dict[str, Any]]
List runbooks
Lists Azure Automation runbooks in an automation account.
Returns a single-page Azure Core async collection.
Swagger operation ID: Runbooks_List.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
str
|
The unique identifier for the Microsoft Azure subscription. The subscription ID forms part of the ID for every Azure resource. |
required |
resource_group_name
|
str
|
The name of the Azure Resource Group. |
required |
automation_account
|
str
|
The name of the Azure Automation Account. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
AsyncItemPaged[dict[str, Any]]
|
AsyncItemPaged[dict[str, Any]]: An Azure Core pager over connector
results. Consume it with |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
list_runbook
list_runbook(subscription_id: str, resource_group_name: str, automation_account: str, runbook_name: str, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> AsyncItemPaged[dict[str, Any]]
Get runbook
Get information on an Azure Automation runbook.
Returns a single-page Azure Core async collection.
Swagger operation ID: GetRunbook.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
str
|
The unique identifier for the Microsoft Azure subscription. The subscription ID forms part of the ID for every Azure resource. |
required |
resource_group_name
|
str
|
The name of the Azure Resource Group. |
required |
automation_account
|
str
|
The name of the Azure Automation Account. |
required |
runbook_name
|
str
|
The name of the Azure Automation runbook. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
AsyncItemPaged[dict[str, Any]]
|
AsyncItemPaged[dict[str, Any]]: An Azure Core pager over connector
results. Consume it with |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |