Skip to content

Commit d7beb76

Browse files
authored
[Serial Console] Update to 2024 API Version (#8196)
* start using 2024 api version * update tests * update version * use suggested version
1 parent bf3ed0c commit d7beb76

File tree

9 files changed

+3468
-2876
lines changed

9 files changed

+3468
-2876
lines changed

src/serial-console/HISTORY.rst

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Release History
22
===============
3+
1.0.0b2
4+
++++++
5+
* Changed to 2024 API version, fixes Disable API to track "properties". Essentially return to 2018 format
36

47
1.0.0b1
58
++++++

src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VM.yaml

+1,543-1,287
Large diffs are not rendered by default.

src/serial-console/azext_serialconsole/tests/latest/recordings/test_check_resource_VMSS.yaml

+1,901-1,572
Large diffs are not rendered by default.

src/serial-console/azext_serialconsole/tests/latest/recordings/test_enable_disable.yaml

+14-10
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ interactions:
1515
Content-Type:
1616
- application/json
1717
User-Agent:
18-
- AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.10.12 (Linux-6.5.0-35-generic-x86_64-with-glibc2.35)
18+
- AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.12.7 (Windows-11-10.0.26100-SP0)
1919
method: POST
20-
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.SerialConsole/consoleServices/default/disableConsole?api-version=2018-05-01
20+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.SerialConsole/consoleServices/default/disableConsole?api-version=2024-07-01
2121
response:
2222
body:
2323
string: "{\n \"properties\": {\n \"disabled\": true\n }\n}"
@@ -29,7 +29,7 @@ interactions:
2929
content-type:
3030
- application/json; charset=UTF-8
3131
date:
32-
- Fri, 24 May 2024 21:02:49 GMT
32+
- Thu, 21 Nov 2024 16:51:44 GMT
3333
expires:
3434
- '-1'
3535
pragma:
@@ -42,10 +42,12 @@ interactions:
4242
- nosniff
4343
x-frame-options:
4444
- deny
45+
x-ms-ratelimit-remaining-subscription-global-writes:
46+
- '11999'
4547
x-ms-ratelimit-remaining-subscription-writes:
46-
- '1199'
48+
- '799'
4749
x-msedge-ref:
48-
- 'Ref A: A819640BF8B24147B0581814D8B0C3B4 Ref B: SJC211051204021 Ref C: 2024-05-24T21:02:48Z'
50+
- 'Ref A: 467FB350BAF9492C96DFB004512EE7F1 Ref B: MNZ221060609021 Ref C: 2024-11-21T16:51:44Z'
4951
status:
5052
code: 200
5153
message: OK
@@ -65,9 +67,9 @@ interactions:
6567
Content-Type:
6668
- application/json
6769
User-Agent:
68-
- AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.10.12 (Linux-6.5.0-35-generic-x86_64-with-glibc2.35)
70+
- AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.12.7 (Windows-11-10.0.26100-SP0)
6971
method: POST
70-
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.SerialConsole/consoleServices/default/enableConsole?api-version=2018-05-01
72+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.SerialConsole/consoleServices/default/enableConsole?api-version=2024-07-01
7173
response:
7274
body:
7375
string: "{\n \"properties\": {\n \"disabled\": false\n }\n}"
@@ -79,7 +81,7 @@ interactions:
7981
content-type:
8082
- application/json; charset=UTF-8
8183
date:
82-
- Fri, 24 May 2024 21:02:50 GMT
84+
- Thu, 21 Nov 2024 16:51:45 GMT
8385
expires:
8486
- '-1'
8587
pragma:
@@ -92,10 +94,12 @@ interactions:
9294
- nosniff
9395
x-frame-options:
9496
- deny
97+
x-ms-ratelimit-remaining-subscription-global-writes:
98+
- '11999'
9599
x-ms-ratelimit-remaining-subscription-writes:
96-
- '1199'
100+
- '799'
97101
x-msedge-ref:
98-
- 'Ref A: 7FF58852ACCE4ED291941ADDB0AA625A Ref B: SJC211051205029 Ref C: 2024-05-24T21:02:49Z'
102+
- 'Ref A: 01DB380606B146F6B7AA727925F4916A Ref B: MNZ221060618039 Ref C: 2024-11-21T16:51:45Z'
99103
status:
100104
code: 200
101105
message: OK

src/serial-console/azext_serialconsole/tests/latest/test_serialconsole_scenario.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def check_result(self, resource_group_name, vm_vmss_name, vmss_instanceid=None,
206206
connection_url = (f"{ARM_ENDPOINT}/subscriptions/{subscription_id}/resourcegroups/{resource_group_name}"
207207
f"/providers/Microsoft.Compute/{vm_path}"
208208
f"/providers/{RP_PROVIDER}/serialPorts/0"
209-
f"/connect?api-version=2018-05-01")
209+
f"/connect?api-version=2024-07-01")
210210

211211
from azure.cli.core._profile import Profile
212212
token_info, _, _ = Profile().get_raw_token()

src/serial-console/azext_serialconsole/vendored_sdks/serialconsole/_configuration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(
4747

4848
self.credential = credential
4949
self.subscription_id = subscription_id
50-
self.api_version = "2018-05-01"
50+
self.api_version = "2024-07-01"
5151
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5252
kwargs.setdefault('sdk_moniker', 'microsoftserialconsoleclient/{}'.format(VERSION))
5353
self._configure(**kwargs)

src/serial-console/azext_serialconsole/vendored_sdks/serialconsole/operations/_microsoft_serial_console_client_operations.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def get_console_status(
4646
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
4747
}
4848
error_map.update(kwargs.pop('error_map', {}))
49-
api_version = "2018-05-01"
49+
api_version = "2024-07-01"
5050
accept = "application/json"
5151

5252
# Construct URL
@@ -104,7 +104,7 @@ def disable_console(
104104
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
105105
}
106106
error_map.update(kwargs.pop('error_map', {}))
107-
api_version = "2018-05-01"
107+
api_version = "2024-07-01"
108108
accept = "application/json"
109109
content_type = "application/json"
110110

@@ -164,7 +164,7 @@ def enable_console(
164164
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
165165
}
166166
error_map.update(kwargs.pop('error_map', {}))
167-
api_version = "2018-05-01"
167+
api_version = "2024-07-01"
168168
accept = "application/json"
169169
content_type = "application/json"
170170

src/serial-console/azext_serialconsole/vendored_sdks/serialconsole/operations/_serial_ports_operations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def connect(
7878
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
7979
}
8080
error_map.update(kwargs.pop('error_map', {}))
81-
api_version = "2018-05-01"
81+
api_version = "2024-07-01"
8282
accept = "application/json"
8383
accept_language = "en"
8484
content_type = "application/json"

src/serial-console/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# TODO: Confirm this is the right version number you want and it matches your
1818
# HISTORY.rst entry.
19-
VERSION = '1.0.0b1'
19+
VERSION = '1.0.0b2'
2020

2121
# The full list of classifiers is available at
2222
# https://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)