Skip to content

Commit e15cd80

Browse files
eatkimcheeMike Kennedy (from Dev Box)
andauthored
Add new version for firmwareanalysis for 2025-08-02 swagger (#9161)
* Updating firmwareanalysis extension for GA release - updated models for latest swagger version 2025-08-02 - updated tests - removed sas url generation test * fixed broken cli commands and tests added back upload url test, but with redacted sasurl * updating version to 2.0.0 * updated changelog - removed deprecated command - fixed test to reference all test values * update examples to make linter happy --------- Co-authored-by: Mike Kennedy (from Dev Box) <mikekennedy@microsoft.com>
1 parent 25db525 commit e15cd80

35 files changed

+3197
-7248
lines changed

src/firmwareanalysis/HISTORY.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
Release History
44
===============
55

6+
2.0.0
7+
+++++
8+
* Updating version for 2025-08-02 swagger release
9+
* Added workspace usage-metric command
10+
* Deprecated generate filesystem download url command
11+
612
1.0.0
713
++++++
814
* Initial release.

src/firmwareanalysis/azext_firmwareanalysis/aaz/latest/firmwareanalysis/firmware/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
from ._crypto_key import *
1616
from ._cve import *
1717
from ._delete import *
18-
from ._generate_filesystem_download_url import *
1918
from ._list import *
2019
from ._password_hash import *
2120
from ._sbom_component import *
2221
from ._show import *
2322
from ._summary import *
23+
from ._update import *

src/firmwareanalysis/azext_firmwareanalysis/aaz/latest/firmwareanalysis/firmware/_binary_hardening.py

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class BinaryHardening(AAZCommand):
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2024-01-10",
25+
"version": "2025-08-02",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.iotfirmwaredefense/workspaces/{}/firmwares/{}/binaryhardeningresults", "2024-01-10"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.iotfirmwaredefense/workspaces/{}/firmwares/{}/binaryhardeningresults", "2025-08-02"],
2828
]
2929
}
3030

@@ -49,6 +49,9 @@ def _build_arguments_schema(cls, *args, **kwargs):
4949
options=["--firmware-id"],
5050
help="The id of the firmware.",
5151
required=True,
52+
fmt=AAZStrArgFormat(
53+
pattern="^[a-zA-Z0-9][a-zA-Z0-9_.-]*$",
54+
),
5255
)
5356
_args_schema.resource_group = AAZResourceGroupNameArg(
5457
required=True,
@@ -133,7 +136,7 @@ def url_parameters(self):
133136
def query_parameters(self):
134137
parameters = {
135138
**self.serialize_query_param(
136-
"api-version", "2024-01-10",
139+
"api-version", "2025-08-02",
137140
required=True,
138141
),
139142
}
@@ -170,7 +173,7 @@ def _build_schema_on_200(cls):
170173
serialized_name="nextLink",
171174
)
172175
_schema_on_200.value = AAZListType(
173-
flags={"read_only": True},
176+
flags={"required": True},
174177
)
175178

176179
value = cls._schema_on_200.value
@@ -183,9 +186,7 @@ def _build_schema_on_200(cls):
183186
_element.name = AAZStrType(
184187
flags={"read_only": True},
185188
)
186-
_element.properties = AAZObjectType(
187-
flags={"client_flatten": True},
188-
)
189+
_element.properties = AAZObjectType()
189190
_element.system_data = AAZObjectType(
190191
serialized_name="systemData",
191192
flags={"read_only": True},
@@ -195,36 +196,40 @@ def _build_schema_on_200(cls):
195196
)
196197

197198
properties = cls._schema_on_200.value.Element.properties
198-
properties.architecture = AAZStrType(
199-
nullable=True,
200-
)
201199
properties.binary_hardening_id = AAZStrType(
202200
serialized_name="binaryHardeningId",
203-
nullable=True,
204201
)
205-
properties["class"] = AAZStrType(
206-
nullable=True,
202+
properties.executable_architecture = AAZStrType(
203+
serialized_name="executableArchitecture",
207204
)
208-
properties.features = AAZObjectType(
209-
flags={"client_flatten": True},
205+
properties.executable_class = AAZStrType(
206+
serialized_name="executableClass",
210207
)
211208
properties.file_path = AAZStrType(
212209
serialized_name="filePath",
213-
nullable=True,
214210
)
215-
properties.rpath = AAZStrType(
216-
nullable=True,
211+
properties.provisioning_state = AAZStrType(
212+
serialized_name="provisioningState",
213+
flags={"read_only": True},
217214
)
218-
properties.runpath = AAZStrType(
219-
nullable=True,
215+
properties.rpath = AAZStrType()
216+
properties.runpath = AAZStrType()
217+
properties.security_hardening_features = AAZObjectType(
218+
serialized_name="securityHardeningFeatures",
220219
)
221220

222-
features = cls._schema_on_200.value.Element.properties.features
223-
features.canary = AAZBoolType()
224-
features.nx = AAZBoolType()
225-
features.pie = AAZBoolType()
226-
features.relro = AAZBoolType()
227-
features.stripped = AAZBoolType()
221+
security_hardening_features = cls._schema_on_200.value.Element.properties.security_hardening_features
222+
security_hardening_features.canary = AAZBoolType()
223+
security_hardening_features.no_execute = AAZBoolType(
224+
serialized_name="noExecute",
225+
)
226+
security_hardening_features.position_independent_executable = AAZBoolType(
227+
serialized_name="positionIndependentExecutable",
228+
)
229+
security_hardening_features.relocation_read_only = AAZBoolType(
230+
serialized_name="relocationReadOnly",
231+
)
232+
security_hardening_features.stripped = AAZBoolType()
228233

229234
system_data = cls._schema_on_200.value.Element.system_data
230235
system_data.created_at = AAZStrType(

src/firmwareanalysis/azext_firmwareanalysis/aaz/latest/firmwareanalysis/firmware/_create.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
# flake8: noqa
1010

1111
from azure.cli.core.aaz import *
12-
import uuid
1312

1413

1514
@register_command(
@@ -19,13 +18,13 @@ class Create(AAZCommand):
1918
"""Create a new firmware.
2019
2120
:example: Create a new firmware.
22-
az firmwareanalysis firmware create --resource-group {resourceGroupName} --workspace-name {workspaceName} --description {description} --file-name {fileName} --file-size {fileSize} --vendor {vendorName} --model {model} --version {version} --status {status} --status-messages ['hi','message']
21+
az firmwareanalysis firmware create --resource-group {resourceGroupName} --workspace-name {workspaceName} --description {description} --file-name {fileName} --file-size {fileSize} --vendor {vendorName} --model {model} --version {version} --status {status}
2322
"""
2423

2524
_aaz_info = {
26-
"version": "2024-01-10",
25+
"version": "2025-08-02",
2726
"resources": [
28-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.iotfirmwaredefense/workspaces/{}/firmwares/{}", "2024-01-10"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.iotfirmwaredefense/workspaces/{}/firmwares/{}", "2025-08-02"],
2928
]
3029
}
3130

@@ -48,8 +47,10 @@ def _build_arguments_schema(cls, *args, **kwargs):
4847
_args_schema.firmware_id = AAZStrArg(
4948
options=["-n", "--name", "--firmware-id"],
5049
help="The id of the firmware.",
51-
default=str(uuid.uuid4()),
52-
required=False,
50+
required=True,
51+
fmt=AAZStrArgFormat(
52+
pattern="^[a-zA-Z0-9][a-zA-Z0-9_.-]*$",
53+
),
5354
)
5455
_args_schema.resource_group = AAZResourceGroupNameArg(
5556
required=True,
@@ -80,7 +81,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
8081
options=["--file-size"],
8182
arg_group="Properties",
8283
help="File size of the uploaded firmware image.",
83-
nullable=True,
8484
)
8585
_args_schema.model = AAZStrArg(
8686
options=["--model"],
@@ -91,7 +91,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
9191
options=["--status"],
9292
arg_group="Properties",
9393
help="The status of firmware scan.",
94-
default="Pending",
9594
enum={"Analyzing": "Analyzing", "Error": "Error", "Extracting": "Extracting", "Pending": "Pending", "Ready": "Ready"},
9695
)
9796
_args_schema.status_messages = AAZListArg(
@@ -172,7 +171,7 @@ def url_parameters(self):
172171
parameters = {
173172
**self.serialize_url_param(
174173
"firmwareId", self.ctx.args.firmware_id,
175-
required=False,
174+
required=True,
176175
),
177176
**self.serialize_url_param(
178177
"resourceGroupName", self.ctx.args.resource_group,
@@ -193,7 +192,7 @@ def url_parameters(self):
193192
def query_parameters(self):
194193
parameters = {
195194
**self.serialize_query_param(
196-
"api-version", "2024-01-10",
195+
"api-version", "2025-08-02",
197196
required=True,
198197
),
199198
}
@@ -218,13 +217,13 @@ def content(self):
218217
typ=AAZObjectType,
219218
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
220219
)
221-
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
220+
_builder.set_prop("properties", AAZObjectType)
222221

223222
properties = _builder.get(".properties")
224223
if properties is not None:
225224
properties.set_prop("description", AAZStrType, ".description")
226225
properties.set_prop("fileName", AAZStrType, ".file_name")
227-
properties.set_prop("fileSize", AAZIntType, ".file_size", typ_kwargs={"nullable": True})
226+
properties.set_prop("fileSize", AAZIntType, ".file_size")
228227
properties.set_prop("model", AAZStrType, ".model")
229228
properties.set_prop("status", AAZStrType, ".status")
230229
properties.set_prop("statusMessages", AAZListType, ".status_messages")
@@ -266,9 +265,7 @@ def _build_schema_on_200_201(cls):
266265
_schema_on_200_201.name = AAZStrType(
267266
flags={"read_only": True},
268267
)
269-
_schema_on_200_201.properties = AAZObjectType(
270-
flags={"client_flatten": True},
271-
)
268+
_schema_on_200_201.properties = AAZObjectType()
272269
_schema_on_200_201.system_data = AAZObjectType(
273270
serialized_name="systemData",
274271
flags={"read_only": True},
@@ -284,7 +281,6 @@ def _build_schema_on_200_201(cls):
284281
)
285282
properties.file_size = AAZIntType(
286283
serialized_name="fileSize",
287-
nullable=True,
288284
)
289285
properties.model = AAZStrType()
290286
properties.provisioning_state = AAZStrType(

0 commit comments

Comments
 (0)