Skip to content
Merged
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
3 changes: 3 additions & 0 deletions src/palo-alto-networks/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Release History
===============
1.1.0
Copy link
Member

@jsntcy jsntcy Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the new version (1.1.0) is not correct as 1.0.0 has not been released yet. It's better to use 1.0.0b2 instead.

++++++
* Fix #27401 `az palo-alto cloudngfw local-rulestack commit` command failing.

1.0.0b1
++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Commit(AAZCommand):

def _handler(self, command_args):
super()._handler(command_args)
return self.build_lro_poller(self._execute_operations, None)
return self.build_lro_poller(self._execute_operations, self._output)

_args_schema = None

Expand Down Expand Up @@ -66,6 +66,10 @@ def pre_operations(self):
def post_operations(self):
pass

def _output(self, *args, **kwargs):
result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True)
return result

class LocalRulestacksCommit(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

Expand All @@ -76,7 +80,16 @@ def __call__(self, *args, **kwargs):
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
None,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200, 201]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
Expand Down Expand Up @@ -127,9 +140,137 @@ def query_parameters(self):
}
return parameters

@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters

def on_200_201(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200_201
)

_schema_on_200_201 = None

@classmethod
def _build_schema_on_200_201(cls):
if cls._schema_on_200_201 is not None:
return cls._schema_on_200_201

cls._schema_on_200_201 = AAZObjectType()
_CommitHelper._build_schema_operation_status_result_read(cls._schema_on_200_201)

return cls._schema_on_200_201


class _CommitHelper:
"""Helper class for Commit"""

_schema_error_detail_read = None

@classmethod
def _build_schema_error_detail_read(cls, _schema):
if cls._schema_error_detail_read is not None:
_schema.additional_info = cls._schema_error_detail_read.additional_info
_schema.code = cls._schema_error_detail_read.code
_schema.details = cls._schema_error_detail_read.details
_schema.message = cls._schema_error_detail_read.message
_schema.target = cls._schema_error_detail_read.target
return

cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType()

error_detail_read = _schema_error_detail_read
error_detail_read.additional_info = AAZListType(
serialized_name="additionalInfo",
flags={"read_only": True},
)
error_detail_read.code = AAZStrType(
flags={"read_only": True},
)
error_detail_read.details = AAZListType(
flags={"read_only": True},
)
error_detail_read.message = AAZStrType(
flags={"read_only": True},
)
error_detail_read.target = AAZStrType(
flags={"read_only": True},
)

additional_info = _schema_error_detail_read.additional_info
additional_info.Element = AAZObjectType()

_element = _schema_error_detail_read.additional_info.Element
_element.type = AAZStrType(
flags={"read_only": True},
)

details = _schema_error_detail_read.details
details.Element = AAZObjectType()
cls._build_schema_error_detail_read(details.Element)

_schema.additional_info = cls._schema_error_detail_read.additional_info
_schema.code = cls._schema_error_detail_read.code
_schema.details = cls._schema_error_detail_read.details
_schema.message = cls._schema_error_detail_read.message
_schema.target = cls._schema_error_detail_read.target

_schema_operation_status_result_read = None

@classmethod
def _build_schema_operation_status_result_read(cls, _schema):
if cls._schema_operation_status_result_read is not None:
_schema.end_time = cls._schema_operation_status_result_read.end_time
_schema.error = cls._schema_operation_status_result_read.error
_schema.id = cls._schema_operation_status_result_read.id
_schema.name = cls._schema_operation_status_result_read.name
_schema.operations = cls._schema_operation_status_result_read.operations
_schema.percent_complete = cls._schema_operation_status_result_read.percent_complete
_schema.start_time = cls._schema_operation_status_result_read.start_time
_schema.status = cls._schema_operation_status_result_read.status
return

cls._schema_operation_status_result_read = _schema_operation_status_result_read = AAZObjectType()

operation_status_result_read = _schema_operation_status_result_read
operation_status_result_read.end_time = AAZStrType(
serialized_name="endTime",
)
operation_status_result_read.error = AAZObjectType()
cls._build_schema_error_detail_read(operation_status_result_read.error)
operation_status_result_read.id = AAZStrType()
operation_status_result_read.name = AAZStrType()
operation_status_result_read.operations = AAZListType()
operation_status_result_read.percent_complete = AAZFloatType(
serialized_name="percentComplete",
)
operation_status_result_read.start_time = AAZStrType(
serialized_name="startTime",
)
operation_status_result_read.status = AAZStrType(
flags={"required": True},
)

operations = _schema_operation_status_result_read.operations
operations.Element = AAZObjectType()
cls._build_schema_operation_status_result_read(operations.Element)

_schema.end_time = cls._schema_operation_status_result_read.end_time
_schema.error = cls._schema_operation_status_result_read.error
_schema.id = cls._schema_operation_status_result_read.id
_schema.name = cls._schema_operation_status_result_read.name
_schema.operations = cls._schema_operation_status_result_read.operations
_schema.percent_complete = cls._schema_operation_status_result_read.percent_complete
_schema.start_time = cls._schema_operation_status_result_read.start_time
_schema.status = cls._schema_operation_status_result_read.status


__all__ = ["Commit"]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.50.0"
"azext.minCliCoreVersion": "2.51.0"
}
Loading