Skip to content

Commit b684fca

Browse files
jaskisinJaskirat Singh
andauthored
Generation of Code for new api 2024-09-01 for workloads (#8177)
* Code Generation for 2024-09-01 api * remove private and public key from templates * remove fencing id and pass from template * fix issue with linting * update history, setup and linter exclusions * Add _wait import to SAP instance modules and update command options for virtual instance start/stop * Remove preview flag from SAP command registrations and update versioning in workload modules * Remove preview flag from SAP instance commands * Remove read-only identity fields from SAP virtual instance commands and update argument groups for clarity * Changing version from 2.0.0 to 1.1.0 and update metadata for stable release --------- Co-authored-by: Jaskirat Singh <[email protected]>
1 parent edef6a6 commit b684fca

File tree

76 files changed

+57629
-4546
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+57629
-4546
lines changed

src/workloads/HISTORY.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
Release History
44
===============
55

6+
1.1.0
7+
+++++++
8+
* General Availability release for api 2024-09-01
69
1.1.0b3
710
+++++++
811
* Changing of PUT calls to PATCH calls for update
@@ -16,4 +19,4 @@ Release History
1619
* Add custom managed resources for customer
1720
0.1.0-preview
1821
++++++
19-
* Initial release.
22+
* Initial release.

src/workloads/azext_workloads/aaz/latest/workloads/__cmd_group.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command_group(
1515
"workloads",
16-
is_preview=True,
1716
)
1817
class __CMDGroup(AAZCommandGroup):
1918
"""Manage workloads

src/workloads/azext_workloads/aaz/latest/workloads/_sap_availability_zone_detail.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command(
1515
"workloads sap-availability-zone-detail",
16-
is_preview=True,
1716
)
1817
class SapAvailabilityZoneDetail(AAZCommand):
1918
"""Show the recommended SAP Availability Zone Pair Details for your region.
@@ -23,9 +22,9 @@ class SapAvailabilityZoneDetail(AAZCommand):
2322
"""
2423

2524
_aaz_info = {
26-
"version": "2023-10-01-preview",
25+
"version": "2024-09-01",
2726
"resources": [
28-
["mgmt-plane", "/subscriptions/{}/providers/microsoft.workloads/locations/{}/sapvirtualinstancemetadata/default/getavailabilityzonedetails", "2023-10-01-preview"],
27+
["mgmt-plane", "/subscriptions/{}/providers/microsoft.workloads/locations/{}/sapvirtualinstancemetadata/default/getavailabilityzonedetails", "2024-09-01"],
2928
]
3029
}
3130

@@ -50,31 +49,34 @@ def _build_arguments_schema(cls, *args, **kwargs):
5049
id_part="name",
5150
)
5251

53-
# define Arg Group "SAPAvailabilityZoneDetails"
52+
# define Arg Group "Body"
5453

5554
_args_schema = cls._args_schema
5655
_args_schema.app_location = AAZStrArg(
5756
options=["--app-location"],
58-
arg_group="SAPAvailabilityZoneDetails",
57+
arg_group="Body",
5958
help="The geo-location where the SAP resources will be created.",
59+
required=True,
6060
)
6161
_args_schema.database_type = AAZStrArg(
6262
options=["--database-type"],
63-
arg_group="SAPAvailabilityZoneDetails",
63+
arg_group="Body",
6464
help="The database type. Eg: HANA, DB2, etc",
65+
required=True,
6566
enum={"DB2": "DB2", "HANA": "HANA"},
6667
)
6768
_args_schema.sap_product = AAZStrArg(
6869
options=["--sap-product"],
69-
arg_group="SAPAvailabilityZoneDetails",
70+
arg_group="Body",
7071
help="Defines the SAP Product type.",
72+
required=True,
7173
enum={"ECC": "ECC", "Other": "Other", "S4HANA": "S4HANA"},
7274
)
7375
return cls._args_schema
7476

7577
def _execute_operations(self):
7678
self.pre_operations()
77-
self.SAPAvailabilityZoneDetails(ctx=self.ctx)()
79+
self.SapVirtualInstancesInvokeAvailabilityZoneDetails(ctx=self.ctx)()
7880
self.post_operations()
7981

8082
@register_callback
@@ -89,7 +91,7 @@ def _output(self, *args, **kwargs):
8991
result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True)
9092
return result
9193

92-
class SAPAvailabilityZoneDetails(AAZHttpOperation):
94+
class SapVirtualInstancesInvokeAvailabilityZoneDetails(AAZHttpOperation):
9395
CLIENT_TYPE = "MgmtClient"
9496

9597
def __call__(self, *args, **kwargs):
@@ -133,7 +135,7 @@ def url_parameters(self):
133135
def query_parameters(self):
134136
parameters = {
135137
**self.serialize_query_param(
136-
"api-version", "2023-10-01-preview",
138+
"api-version", "2024-09-01",
137139
required=True,
138140
),
139141
}
@@ -156,7 +158,7 @@ def content(self):
156158
_content_value, _builder = self.new_content_builder(
157159
self.ctx.args,
158160
typ=AAZObjectType,
159-
typ_kwargs={"flags": {"client_flatten": True}}
161+
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
160162
)
161163
_builder.set_prop("appLocation", AAZStrType, ".app_location", typ_kwargs={"flags": {"required": True}})
162164
_builder.set_prop("databaseType", AAZStrType, ".database_type", typ_kwargs={"flags": {"required": True}})

src/workloads/azext_workloads/aaz/latest/workloads/_sap_disk_configuration.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command(
1515
"workloads sap-disk-configuration",
16-
is_preview=True,
1716
)
1817
class SapDiskConfiguration(AAZCommand):
1918
"""Show the SAP Disk Configuration Layout prod/non-prod SAP System.
@@ -23,9 +22,9 @@ class SapDiskConfiguration(AAZCommand):
2322
"""
2423

2524
_aaz_info = {
26-
"version": "2023-10-01-preview",
25+
"version": "2024-09-01",
2726
"resources": [
28-
["mgmt-plane", "/subscriptions/{}/providers/microsoft.workloads/locations/{}/sapvirtualinstancemetadata/default/getdiskconfigurations", "2023-10-01-preview"],
27+
["mgmt-plane", "/subscriptions/{}/providers/microsoft.workloads/locations/{}/sapvirtualinstancemetadata/default/getdiskconfigurations", "2024-09-01"],
2928
]
3029
}
3130

@@ -57,41 +56,47 @@ def _build_arguments_schema(cls, *args, **kwargs):
5756
options=["--app-location"],
5857
arg_group="SAPDiskConfigurations",
5958
help="The geo-location where the SAP resources will be created.",
59+
required=True,
6060
)
6161
_args_schema.database_type = AAZStrArg(
6262
options=["--database-type"],
6363
arg_group="SAPDiskConfigurations",
6464
help="The database type. Eg: HANA, DB2, etc",
65+
required=True,
6566
enum={"DB2": "DB2", "HANA": "HANA"},
6667
)
6768
_args_schema.db_vm_sku = AAZStrArg(
6869
options=["--db-vm-sku"],
6970
arg_group="SAPDiskConfigurations",
7071
help="The VM SKU for database instance.",
72+
required=True,
7173
)
7274
_args_schema.deployment_type = AAZStrArg(
7375
options=["--deployment-type"],
7476
arg_group="SAPDiskConfigurations",
7577
help="The deployment type. Eg: SingleServer/ThreeTier",
78+
required=True,
7679
enum={"SingleServer": "SingleServer", "ThreeTier": "ThreeTier"},
7780
)
7881
_args_schema.environment = AAZStrArg(
7982
options=["--environment"],
8083
arg_group="SAPDiskConfigurations",
8184
help="Defines the environment type - Production/Non Production.",
85+
required=True,
8286
enum={"NonProd": "NonProd", "Prod": "Prod"},
8387
)
8488
_args_schema.sap_product = AAZStrArg(
8589
options=["--sap-product"],
8690
arg_group="SAPDiskConfigurations",
8791
help="Defines the SAP Product type.",
92+
required=True,
8893
enum={"ECC": "ECC", "Other": "Other", "S4HANA": "S4HANA"},
8994
)
9095
return cls._args_schema
9196

9297
def _execute_operations(self):
9398
self.pre_operations()
94-
self.SAPDiskConfigurations(ctx=self.ctx)()
99+
self.SapVirtualInstancesInvokeDiskConfigurations(ctx=self.ctx)()
95100
self.post_operations()
96101

97102
@register_callback
@@ -106,7 +111,7 @@ def _output(self, *args, **kwargs):
106111
result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True)
107112
return result
108113

109-
class SAPDiskConfigurations(AAZHttpOperation):
114+
class SapVirtualInstancesInvokeDiskConfigurations(AAZHttpOperation):
110115
CLIENT_TYPE = "MgmtClient"
111116

112117
def __call__(self, *args, **kwargs):
@@ -150,7 +155,7 @@ def url_parameters(self):
150155
def query_parameters(self):
151156
parameters = {
152157
**self.serialize_query_param(
153-
"api-version", "2023-10-01-preview",
158+
"api-version", "2024-09-01",
154159
required=True,
155160
),
156161
}
@@ -173,7 +178,7 @@ def content(self):
173178
_content_value, _builder = self.new_content_builder(
174179
self.ctx.args,
175180
typ=AAZObjectType,
176-
typ_kwargs={"flags": {"client_flatten": True}}
181+
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
177182
)
178183
_builder.set_prop("appLocation", AAZStrType, ".app_location", typ_kwargs={"flags": {"required": True}})
179184
_builder.set_prop("databaseType", AAZStrType, ".database_type", typ_kwargs={"flags": {"required": True}})

src/workloads/azext_workloads/aaz/latest/workloads/_sap_sizing_recommendation.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command(
1515
"workloads sap-sizing-recommendation",
16-
is_preview=True,
1716
)
1817
class SapSizingRecommendation(AAZCommand):
1918
"""Show SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier
@@ -26,9 +25,9 @@ class SapSizingRecommendation(AAZCommand):
2625
"""
2726

2827
_aaz_info = {
29-
"version": "2023-10-01-preview",
28+
"version": "2024-09-01",
3029
"resources": [
31-
["mgmt-plane", "/subscriptions/{}/providers/microsoft.workloads/locations/{}/sapvirtualinstancemetadata/default/getsizingrecommendations", "2023-10-01-preview"],
30+
["mgmt-plane", "/subscriptions/{}/providers/microsoft.workloads/locations/{}/sapvirtualinstancemetadata/default/getsizingrecommendations", "2024-09-01"],
3231
]
3332
}
3433

@@ -60,17 +59,20 @@ def _build_arguments_schema(cls, *args, **kwargs):
6059
options=["--app-location"],
6160
arg_group="SAPSizingRecommendation",
6261
help="The geo-location where the resource is to be created.",
62+
required=True,
6363
)
6464
_args_schema.database_type = AAZStrArg(
6565
options=["--database-type"],
6666
arg_group="SAPSizingRecommendation",
6767
help="The database type.",
68+
required=True,
6869
enum={"DB2": "DB2", "HANA": "HANA"},
6970
)
7071
_args_schema.db_memory = AAZIntArg(
7172
options=["--db-memory"],
7273
arg_group="SAPSizingRecommendation",
7374
help="The database memory configuration.",
75+
required=True,
7476
)
7577
_args_schema.db_scale_method = AAZStrArg(
7678
options=["--db-scale-method"],
@@ -82,12 +84,14 @@ def _build_arguments_schema(cls, *args, **kwargs):
8284
options=["--deployment-type"],
8385
arg_group="SAPSizingRecommendation",
8486
help="The deployment type. Eg: SingleServer/ThreeTier",
87+
required=True,
8588
enum={"SingleServer": "SingleServer", "ThreeTier": "ThreeTier"},
8689
)
8790
_args_schema.environment = AAZStrArg(
8891
options=["--environment"],
8992
arg_group="SAPSizingRecommendation",
9093
help="Defines the environment type - Production/Non Production.",
94+
required=True,
9195
enum={"NonProd": "NonProd", "Prod": "Prod"},
9296
)
9397
_args_schema.high_availability_type = AAZStrArg(
@@ -100,18 +104,20 @@ def _build_arguments_schema(cls, *args, **kwargs):
100104
options=["--sap-product"],
101105
arg_group="SAPSizingRecommendation",
102106
help="Defines the SAP Product type.",
107+
required=True,
103108
enum={"ECC": "ECC", "Other": "Other", "S4HANA": "S4HANA"},
104109
)
105110
_args_schema.saps = AAZIntArg(
106111
options=["--saps"],
107112
arg_group="SAPSizingRecommendation",
108113
help="The SAP Application Performance Standard measurement.",
114+
required=True,
109115
)
110116
return cls._args_schema
111117

112118
def _execute_operations(self):
113119
self.pre_operations()
114-
self.SAPSizingRecommendations(ctx=self.ctx)()
120+
self.SapVirtualInstancesInvokeSizingRecommendations(ctx=self.ctx)()
115121
self.post_operations()
116122

117123
@register_callback
@@ -126,7 +132,7 @@ def _output(self, *args, **kwargs):
126132
result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True)
127133
return result
128134

129-
class SAPSizingRecommendations(AAZHttpOperation):
135+
class SapVirtualInstancesInvokeSizingRecommendations(AAZHttpOperation):
130136
CLIENT_TYPE = "MgmtClient"
131137

132138
def __call__(self, *args, **kwargs):
@@ -170,7 +176,7 @@ def url_parameters(self):
170176
def query_parameters(self):
171177
parameters = {
172178
**self.serialize_query_param(
173-
"api-version", "2023-10-01-preview",
179+
"api-version", "2024-09-01",
174180
required=True,
175181
),
176182
}
@@ -193,7 +199,7 @@ def content(self):
193199
_content_value, _builder = self.new_content_builder(
194200
self.ctx.args,
195201
typ=AAZObjectType,
196-
typ_kwargs={"flags": {"client_flatten": True}}
202+
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
197203
)
198204
_builder.set_prop("appLocation", AAZStrType, ".app_location", typ_kwargs={"flags": {"required": True}})
199205
_builder.set_prop("databaseType", AAZStrType, ".database_type", typ_kwargs={"flags": {"required": True}})

0 commit comments

Comments
 (0)