Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/serialconsole/azure-mgmt-serialconsole/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
8 changes: 8 additions & 0 deletions sdk/serialconsole/azure-mgmt-serialconsole/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"autorest": "3.3.0",
"use": "@autorest/python@5.6.6",
"commit": "c5778f6fc0d6679b10e78ee56ac2206afaf689eb",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/serialconsole/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.6 --version=3.3.0",
"readme": "specification/serialconsole/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
{
"chosen_version": "2018-05-01",
"total_api_version_list": ["2018-05-01"],
"client": {
"name": "MicrosoftSerialConsoleClient",
"filename": "_microsoft_serial_console_client",
"description": "The Azure Serial Console allows you to access the serial console of a Virtual Machine or VM scale set instance.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": false,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MicrosoftSerialConsoleClientConfiguration\"], \"._operations_mixin\": [\"MicrosoftSerialConsoleClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MicrosoftSerialConsoleClientConfiguration\"], \"._operations_mixin\": [\"MicrosoftSerialConsoleClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "Subscription ID which uniquely identifies the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call requiring it.",
"docstring_type": "str",
"required": true
}
},
"async": {
"credential": {
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "Subscription ID which uniquely identifies the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call requiring it.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version=None, # type: Optional[str]",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url=None, # type: Optional[str]",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url: Optional[str] = None,",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
}
}
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null,
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"serial_ports": "SerialPortsOperations"
},
"operation_mixins": {
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}",
"operations": {
"list_operations" : {
"sync": {
"signature": "def list_operations(\n self,\n **kwargs # type: Any\n):\n",
"doc": "\"\"\"Gets a list of Serial Console API operations.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SerialConsoleOperations, or the result of cls(response)\n:rtype: ~azure.mgmt.serialconsole.models.SerialConsoleOperations\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"async": {
"coroutine": true,
"signature": "async def list_operations(\n self,\n **kwargs\n) -\u003e \"_models.SerialConsoleOperations\":\n",
"doc": "\"\"\"Gets a list of Serial Console API operations.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SerialConsoleOperations, or the result of cls(response)\n:rtype: ~azure.mgmt.serialconsole.models.SerialConsoleOperations\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"call": ""
},
"get_console_status" : {
"sync": {
"signature": "def get_console_status(\n self,\n default, # type: str\n **kwargs # type: Any\n):\n",
"doc": "\"\"\"Get the disabled status for a subscription.\n\nGets whether or not Serial Console is disabled for a given subscription.\n\n:param default: Default parameter. Leave the value as \"default\".\n:type default: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SerialConsoleStatus or GetSerialConsoleSubscriptionNotFound, or the result of cls(response)\n:rtype: ~azure.mgmt.serialconsole.models.SerialConsoleStatus or ~azure.mgmt.serialconsole.models.GetSerialConsoleSubscriptionNotFound\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"async": {
"coroutine": true,
"signature": "async def get_console_status(\n self,\n default: str,\n **kwargs\n) -\u003e Union[\"_models.SerialConsoleStatus\", \"_models.GetSerialConsoleSubscriptionNotFound\"]:\n",
"doc": "\"\"\"Get the disabled status for a subscription.\n\nGets whether or not Serial Console is disabled for a given subscription.\n\n:param default: Default parameter. Leave the value as \"default\".\n:type default: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SerialConsoleStatus or GetSerialConsoleSubscriptionNotFound, or the result of cls(response)\n:rtype: ~azure.mgmt.serialconsole.models.SerialConsoleStatus or ~azure.mgmt.serialconsole.models.GetSerialConsoleSubscriptionNotFound\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"call": "default"
},
"disable_console" : {
"sync": {
"signature": "def disable_console(\n self,\n default, # type: str\n **kwargs # type: Any\n):\n",
"doc": "\"\"\"Disable Serial Console for a subscription.\n\nDisables the Serial Console service for all VMs and VM scale sets in the provided subscription.\n\n:param default: Default parameter. Leave the value as \"default\".\n:type default: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DisableSerialConsoleResult or GetSerialConsoleSubscriptionNotFound, or the result of cls(response)\n:rtype: ~azure.mgmt.serialconsole.models.DisableSerialConsoleResult or ~azure.mgmt.serialconsole.models.GetSerialConsoleSubscriptionNotFound\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"async": {
"coroutine": true,
"signature": "async def disable_console(\n self,\n default: str,\n **kwargs\n) -\u003e Union[\"_models.DisableSerialConsoleResult\", \"_models.GetSerialConsoleSubscriptionNotFound\"]:\n",
"doc": "\"\"\"Disable Serial Console for a subscription.\n\nDisables the Serial Console service for all VMs and VM scale sets in the provided subscription.\n\n:param default: Default parameter. Leave the value as \"default\".\n:type default: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DisableSerialConsoleResult or GetSerialConsoleSubscriptionNotFound, or the result of cls(response)\n:rtype: ~azure.mgmt.serialconsole.models.DisableSerialConsoleResult or ~azure.mgmt.serialconsole.models.GetSerialConsoleSubscriptionNotFound\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"call": "default"
},
"enable_console" : {
"sync": {
"signature": "def enable_console(\n self,\n default, # type: str\n **kwargs # type: Any\n):\n",
"doc": "\"\"\"Enable Serial Console for a subscription.\n\nEnables the Serial Console service for all VMs and VM scale sets in the provided subscription.\n\n:param default: Default parameter. Leave the value as \"default\".\n:type default: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EnableSerialConsoleResult or GetSerialConsoleSubscriptionNotFound, or the result of cls(response)\n:rtype: ~azure.mgmt.serialconsole.models.EnableSerialConsoleResult or ~azure.mgmt.serialconsole.models.GetSerialConsoleSubscriptionNotFound\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"async": {
"coroutine": true,
"signature": "async def enable_console(\n self,\n default: str,\n **kwargs\n) -\u003e Union[\"_models.EnableSerialConsoleResult\", \"_models.GetSerialConsoleSubscriptionNotFound\"]:\n",
"doc": "\"\"\"Enable Serial Console for a subscription.\n\nEnables the Serial Console service for all VMs and VM scale sets in the provided subscription.\n\n:param default: Default parameter. Leave the value as \"default\".\n:type default: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: EnableSerialConsoleResult or GetSerialConsoleSubscriptionNotFound, or the result of cls(response)\n:rtype: ~azure.mgmt.serialconsole.models.EnableSerialConsoleResult or ~azure.mgmt.serialconsole.models.GetSerialConsoleSubscriptionNotFound\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"call": "default"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,19 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import MicrosoftSerialConsoleClientConfiguration
from .operations import MicrosoftSerialConsoleClientOperationsMixin
from .operations import SerialPortsOperations
from . import models


class MicrosoftSerialConsoleClient(MicrosoftSerialConsoleClientOperationsMixin):
"""The Azure Serial Console allows you to access the serial console of a Virtual Machine or VM scale set instance.

:ivar serial_ports: SerialPortsOperations operations
:vartype serial_ports: azure.mgmt.serialconsole.operations.SerialPortsOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Subscription ID which uniquely identifies the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call requiring it.
Expand All @@ -50,6 +54,26 @@ def __init__(
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.serial_ports = SerialPortsOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.

:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

def close(self):
# type: () -> None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0b1"

VERSION = "0.1.0"
Loading