Skip to content

Commit dfd9ccd

Browse files
Azure CLI BotSDKAutoYan Zhang (WICRESOFT NORTH AMERICA LTD)RAY-316
authored
[AutoRelease] t2-serialconsole-2021-05-20-78905(wave4) (Azure#18828)
* CodeGen from PR 14273 in Azure/azure-rest-api-specs serialconsole wave4 (Azure#14273) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) <v-yanzhang@microsoft.com> * version,CHANGELOG * test * changelog config Co-authored-by: SDKAuto <sdkautomation@microsoft.com> Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) <v-yanzhang@microsoft.com> Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: Zed <601306339@qq.com>
1 parent a98297f commit dfd9ccd

File tree

17 files changed

+1558
-215
lines changed

17 files changed

+1558
-215
lines changed

sdk/serialconsole/azure-mgmt-serialconsole/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release History
22

3+
## 1.0.0 (2021-05-20)
4+
5+
**Features**
6+
7+
- Added operation group SerialPortsOperations
8+
39
## 1.0.0b1 (2020-12-10)
410

511
This is beta preview version.

sdk/serialconsole/azure-mgmt-serialconsole/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include _meta.json
12
recursive-include tests *.py *.yaml
23
include *.md
34
include azure/__init__.py
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"autorest": "3.3.0",
3+
"use": "@autorest/python@5.6.6",
4+
"commit": "7f3fdacba501b8639f1ac6a38058d219f5c5395e",
5+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
6+
"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",
7+
"readme": "specification/serialconsole/resource-manager/readme.md"
8+
}
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
{
2+
"chosen_version": "2018-05-01",
3+
"total_api_version_list": ["2018-05-01"],
4+
"client": {
5+
"name": "MicrosoftSerialConsoleClient",
6+
"filename": "_microsoft_serial_console_client",
7+
"description": "The Azure Serial Console allows you to access the serial console of a Virtual Machine or VM scale set instance.",
8+
"base_url": "\u0027https://management.azure.com\u0027",
9+
"custom_base_url": null,
10+
"azure_arm": true,
11+
"has_lro_operations": false,
12+
"client_side_validation": false,
13+
"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\"]}}}",
14+
"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\"]}}}"
15+
},
16+
"global_parameters": {
17+
"sync": {
18+
"credential": {
19+
"signature": "credential, # type: \"TokenCredential\"",
20+
"description": "Credential needed for the client to connect to Azure.",
21+
"docstring_type": "~azure.core.credentials.TokenCredential",
22+
"required": true
23+
},
24+
"subscription_id": {
25+
"signature": "subscription_id, # type: str",
26+
"description": "Subscription ID which uniquely identifies the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call requiring it.",
27+
"docstring_type": "str",
28+
"required": true
29+
}
30+
},
31+
"async": {
32+
"credential": {
33+
"signature": "credential: \"AsyncTokenCredential\",",
34+
"description": "Credential needed for the client to connect to Azure.",
35+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
36+
"required": true
37+
},
38+
"subscription_id": {
39+
"signature": "subscription_id: str,",
40+
"description": "Subscription ID which uniquely identifies the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call requiring it.",
41+
"docstring_type": "str",
42+
"required": true
43+
}
44+
},
45+
"constant": {
46+
},
47+
"call": "credential, subscription_id",
48+
"service_client_specific": {
49+
"sync": {
50+
"api_version": {
51+
"signature": "api_version=None, # type: Optional[str]",
52+
"description": "API version to use if no profile is provided, or if missing in profile.",
53+
"docstring_type": "str",
54+
"required": false
55+
},
56+
"base_url": {
57+
"signature": "base_url=None, # type: Optional[str]",
58+
"description": "Service URL",
59+
"docstring_type": "str",
60+
"required": false
61+
},
62+
"profile": {
63+
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
64+
"description": "A profile definition, from KnownProfiles to dict.",
65+
"docstring_type": "azure.profiles.KnownProfiles",
66+
"required": false
67+
}
68+
},
69+
"async": {
70+
"api_version": {
71+
"signature": "api_version: Optional[str] = None,",
72+
"description": "API version to use if no profile is provided, or if missing in profile.",
73+
"docstring_type": "str",
74+
"required": false
75+
},
76+
"base_url": {
77+
"signature": "base_url: Optional[str] = None,",
78+
"description": "Service URL",
79+
"docstring_type": "str",
80+
"required": false
81+
},
82+
"profile": {
83+
"signature": "profile: KnownProfiles = KnownProfiles.default,",
84+
"description": "A profile definition, from KnownProfiles to dict.",
85+
"docstring_type": "azure.profiles.KnownProfiles",
86+
"required": false
87+
}
88+
}
89+
}
90+
},
91+
"config": {
92+
"credential": true,
93+
"credential_scopes": ["https://management.azure.com/.default"],
94+
"credential_default_policy_type": "BearerTokenCredentialPolicy",
95+
"credential_default_policy_type_has_async_version": true,
96+
"credential_key_header_name": null,
97+
"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\"]}}}",
98+
"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\"]}}}"
99+
},
100+
"operation_groups": {
101+
"serial_ports": "SerialPortsOperations"
102+
},
103+
"operation_mixins": {
104+
"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\"]}}}",
105+
"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\"]}}}",
106+
"operations": {
107+
"list_operations" : {
108+
"sync": {
109+
"signature": "def list_operations(\n self,\n **kwargs # type: Any\n):\n",
110+
"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\"\"\""
111+
},
112+
"async": {
113+
"coroutine": true,
114+
"signature": "async def list_operations(\n self,\n **kwargs\n) -\u003e \"_models.SerialConsoleOperations\":\n",
115+
"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\"\"\""
116+
},
117+
"call": ""
118+
},
119+
"get_console_status" : {
120+
"sync": {
121+
"signature": "def get_console_status(\n self,\n default, # type: str\n **kwargs # type: Any\n):\n",
122+
"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\"\"\""
123+
},
124+
"async": {
125+
"coroutine": true,
126+
"signature": "async def get_console_status(\n self,\n default: str,\n **kwargs\n) -\u003e Union[\"_models.SerialConsoleStatus\", \"_models.GetSerialConsoleSubscriptionNotFound\"]:\n",
127+
"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\"\"\""
128+
},
129+
"call": "default"
130+
},
131+
"disable_console" : {
132+
"sync": {
133+
"signature": "def disable_console(\n self,\n default, # type: str\n **kwargs # type: Any\n):\n",
134+
"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\"\"\""
135+
},
136+
"async": {
137+
"coroutine": true,
138+
"signature": "async def disable_console(\n self,\n default: str,\n **kwargs\n) -\u003e Union[\"_models.DisableSerialConsoleResult\", \"_models.GetSerialConsoleSubscriptionNotFound\"]:\n",
139+
"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\"\"\""
140+
},
141+
"call": "default"
142+
},
143+
"enable_console" : {
144+
"sync": {
145+
"signature": "def enable_console(\n self,\n default, # type: str\n **kwargs # type: Any\n):\n",
146+
"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\"\"\""
147+
},
148+
"async": {
149+
"coroutine": true,
150+
"signature": "async def enable_console(\n self,\n default: str,\n **kwargs\n) -\u003e Union[\"_models.EnableSerialConsoleResult\", \"_models.GetSerialConsoleSubscriptionNotFound\"]:\n",
151+
"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\"\"\""
152+
},
153+
"call": "default"
154+
}
155+
}
156+
}
157+
}

sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/_microsoft_serial_console_client.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,19 @@
1616
from typing import Any, Optional
1717

1818
from azure.core.credentials import TokenCredential
19+
from azure.core.pipeline.transport import HttpRequest, HttpResponse
1920

2021
from ._configuration import MicrosoftSerialConsoleClientConfiguration
2122
from .operations import MicrosoftSerialConsoleClientOperationsMixin
23+
from .operations import SerialPortsOperations
2224
from . import models
2325

2426

2527
class MicrosoftSerialConsoleClient(MicrosoftSerialConsoleClientOperationsMixin):
2628
"""The Azure Serial Console allows you to access the serial console of a Virtual Machine or VM scale set instance.
2729
30+
:ivar serial_ports: SerialPortsOperations operations
31+
:vartype serial_ports: azure.mgmt.serialconsole.operations.SerialPortsOperations
2832
:param credential: Credential needed for the client to connect to Azure.
2933
:type credential: ~azure.core.credentials.TokenCredential
3034
: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.
@@ -50,6 +54,26 @@ def __init__(
5054
self._serialize.client_side_validation = False
5155
self._deserialize = Deserializer(client_models)
5256

57+
self.serial_ports = SerialPortsOperations(
58+
self._client, self._config, self._serialize, self._deserialize)
59+
60+
def _send_request(self, http_request, **kwargs):
61+
# type: (HttpRequest, Any) -> HttpResponse
62+
"""Runs the network request through the client's chained policies.
63+
64+
:param http_request: The network request you want to make. Required.
65+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
66+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
67+
:return: The response of your network call. Does not do error handling on your response.
68+
:rtype: ~azure.core.pipeline.transport.HttpResponse
69+
"""
70+
path_format_arguments = {
71+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
72+
}
73+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
74+
stream = kwargs.pop("stream", True)
75+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
76+
return pipeline_response.http_response
5377

5478
def close(self):
5579
# type: () -> None

sdk/serialconsole/azure-mgmt-serialconsole/azure/mgmt/serialconsole/_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "1.0.0b1"
10-
9+
VERSION = "1.0.0"

0 commit comments

Comments
 (0)