Skip to content

Commit 9556fa3

Browse files
[AutoRelease] t2-nginx-2024-03-01-05314(can only be merged by SDK owner) (#34550)
* code and test * Update CHANGELOG.md * Update README.md * Update CHANGELOG.md * update-testcase * Update assets.json --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent f59a585 commit 9556fa3

40 files changed

+1141
-106
lines changed

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

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

3+
## 3.1.0b1 (2024-03-18)
4+
5+
### Features Added
6+
7+
- Added operation ConfigurationsOperations.analysis
8+
- Model NginxCertificateProperties has a new parameter certificate_error
9+
- Model NginxCertificateProperties has a new parameter key_vault_secret_created
10+
- Model NginxCertificateProperties has a new parameter key_vault_secret_version
11+
- Model NginxCertificateProperties has a new parameter sha1_thumbprint
12+
- Model NginxDeploymentProperties has a new parameter auto_upgrade_profile
13+
- Model NginxDeploymentScalingProperties has a new parameter profiles
14+
- Model NginxDeploymentUpdateProperties has a new parameter auto_upgrade_profile
15+
316
## 3.0.0 (2023-11-20)
417

518
### Features Added

sdk/nginx/azure-mgmt-nginx/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Nginx Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.8+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.7+ is required to use this package.
15+
- Python 3.8+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "11bbc2b1df2e915a2227a6a1a48a27b9e67c3311",
2+
"commit": "cf5ad1932d00c7d15497705ad6b71171d3d68b1e",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.7",
55
"use": [
66
"@autorest/[email protected]",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/nginx/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
9+
"autorest_command": "autorest specification/nginx/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --tag=package-2024-01-01-preview --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
1010
"readme": "specification/nginx/resource-manager/readme.md"
1111
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"AssetsRepo": "Azure/azure-sdk-assets",
3+
"AssetsRepoPrefixPath": "python",
4+
"TagPrefix": "python/nginx/azure-mgmt-nginx",
5+
"Tag": "python/nginx/azure-mgmt-nginx_7deb46f428"
6+
}

sdk/nginx/azure-mgmt-nginx/azure/mgmt/nginx/_configuration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class NginxManagementClientConfiguration(Configuration): # pylint: disable=too-
2929
:type credential: ~azure.core.credentials.TokenCredential
3030
:param subscription_id: The ID of the target subscription. Required.
3131
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-04-01". Note that overriding this
33-
default value may result in unsupported behavior.
32+
:keyword api_version: Api Version. Default value is "2024-01-01-preview". Note that overriding
33+
this default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
"""
3636

3737
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
3838
super(NginxManagementClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-04-01")
39+
api_version: str = kwargs.pop("api_version", "2024-01-01-preview")
4040

4141
if credential is None:
4242
raise ValueError("Parameter 'credential' must not be None.")

sdk/nginx/azure-mgmt-nginx/azure/mgmt/nginx/_nginx_management_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class NginxManagementClient: # pylint: disable=client-accepts-api-version-keywo
3939
:type subscription_id: str
4040
:param base_url: Service URL. Default value is "https://management.azure.com".
4141
:type base_url: str
42-
:keyword api_version: Api Version. Default value is "2023-04-01". Note that overriding this
43-
default value may result in unsupported behavior.
42+
:keyword api_version: Api Version. Default value is "2024-01-01-preview". Note that overriding
43+
this default value may result in unsupported behavior.
4444
:paramtype api_version: str
4545
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4646
Retry-After header is present.

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

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

9-
VERSION = "3.0.0"
9+
VERSION = "3.1.0b1"

sdk/nginx/azure-mgmt-nginx/azure/mgmt/nginx/aio/_configuration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class NginxManagementClientConfiguration(Configuration): # pylint: disable=too-
2929
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
3030
:param subscription_id: The ID of the target subscription. Required.
3131
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-04-01". Note that overriding this
33-
default value may result in unsupported behavior.
32+
:keyword api_version: Api Version. Default value is "2024-01-01-preview". Note that overriding
33+
this default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
"""
3636

3737
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
3838
super(NginxManagementClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-04-01")
39+
api_version: str = kwargs.pop("api_version", "2024-01-01-preview")
4040

4141
if credential is None:
4242
raise ValueError("Parameter 'credential' must not be None.")

sdk/nginx/azure-mgmt-nginx/azure/mgmt/nginx/aio/_nginx_management_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class NginxManagementClient: # pylint: disable=client-accepts-api-version-keywo
3939
:type subscription_id: str
4040
:param base_url: Service URL. Default value is "https://management.azure.com".
4141
:type base_url: str
42-
:keyword api_version: Api Version. Default value is "2023-04-01". Note that overriding this
43-
default value may result in unsupported behavior.
42+
:keyword api_version: Api Version. Default value is "2024-01-01-preview". Note that overriding
43+
this default value may result in unsupported behavior.
4444
:paramtype api_version: str
4545
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4646
Retry-After header is present.

sdk/nginx/azure-mgmt-nginx/azure/mgmt/nginx/aio/operations/_configurations_operations.py

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from ... import models as _models
3333
from ..._vendor import _convert_request
3434
from ...operations._configurations_operations import (
35+
build_analysis_request,
3536
build_create_or_update_request,
3637
build_delete_request,
3738
build_get_request,
@@ -607,3 +608,170 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
607608
begin_delete.metadata = {
608609
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}"
609610
}
611+
612+
@overload
613+
async def analysis(
614+
self,
615+
resource_group_name: str,
616+
deployment_name: str,
617+
configuration_name: str,
618+
body: Optional[_models.AnalysisCreate] = None,
619+
*,
620+
content_type: str = "application/json",
621+
**kwargs: Any
622+
) -> _models.AnalysisResult:
623+
"""Analyze an NGINX configuration without applying it to the NGINXaaS deployment.
624+
625+
Analyze an NGINX configuration without applying it to the NGINXaaS deployment.
626+
627+
:param resource_group_name: The name of the resource group. The name is case insensitive.
628+
Required.
629+
:type resource_group_name: str
630+
:param deployment_name: The name of targeted NGINX deployment. Required.
631+
:type deployment_name: str
632+
:param configuration_name: The name of configuration, only 'default' is supported value due to
633+
the singleton of NGINX conf. Required.
634+
:type configuration_name: str
635+
:param body: The NGINX configuration to analyze. Default value is None.
636+
:type body: ~azure.mgmt.nginx.models.AnalysisCreate
637+
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
638+
Default value is "application/json".
639+
:paramtype content_type: str
640+
:keyword callable cls: A custom type or function that will be passed the direct response
641+
:return: AnalysisResult or the result of cls(response)
642+
:rtype: ~azure.mgmt.nginx.models.AnalysisResult
643+
:raises ~azure.core.exceptions.HttpResponseError:
644+
"""
645+
646+
@overload
647+
async def analysis(
648+
self,
649+
resource_group_name: str,
650+
deployment_name: str,
651+
configuration_name: str,
652+
body: Optional[IO] = None,
653+
*,
654+
content_type: str = "application/json",
655+
**kwargs: Any
656+
) -> _models.AnalysisResult:
657+
"""Analyze an NGINX configuration without applying it to the NGINXaaS deployment.
658+
659+
Analyze an NGINX configuration without applying it to the NGINXaaS deployment.
660+
661+
:param resource_group_name: The name of the resource group. The name is case insensitive.
662+
Required.
663+
:type resource_group_name: str
664+
:param deployment_name: The name of targeted NGINX deployment. Required.
665+
:type deployment_name: str
666+
:param configuration_name: The name of configuration, only 'default' is supported value due to
667+
the singleton of NGINX conf. Required.
668+
:type configuration_name: str
669+
:param body: The NGINX configuration to analyze. Default value is None.
670+
:type body: IO
671+
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
672+
Default value is "application/json".
673+
:paramtype content_type: str
674+
:keyword callable cls: A custom type or function that will be passed the direct response
675+
:return: AnalysisResult or the result of cls(response)
676+
:rtype: ~azure.mgmt.nginx.models.AnalysisResult
677+
:raises ~azure.core.exceptions.HttpResponseError:
678+
"""
679+
680+
@distributed_trace_async
681+
async def analysis(
682+
self,
683+
resource_group_name: str,
684+
deployment_name: str,
685+
configuration_name: str,
686+
body: Optional[Union[_models.AnalysisCreate, IO]] = None,
687+
**kwargs: Any
688+
) -> _models.AnalysisResult:
689+
"""Analyze an NGINX configuration without applying it to the NGINXaaS deployment.
690+
691+
Analyze an NGINX configuration without applying it to the NGINXaaS deployment.
692+
693+
:param resource_group_name: The name of the resource group. The name is case insensitive.
694+
Required.
695+
:type resource_group_name: str
696+
:param deployment_name: The name of targeted NGINX deployment. Required.
697+
:type deployment_name: str
698+
:param configuration_name: The name of configuration, only 'default' is supported value due to
699+
the singleton of NGINX conf. Required.
700+
:type configuration_name: str
701+
:param body: The NGINX configuration to analyze. Is either a AnalysisCreate type or a IO type.
702+
Default value is None.
703+
:type body: ~azure.mgmt.nginx.models.AnalysisCreate or IO
704+
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
705+
Default value is None.
706+
:paramtype content_type: str
707+
:keyword callable cls: A custom type or function that will be passed the direct response
708+
:return: AnalysisResult or the result of cls(response)
709+
:rtype: ~azure.mgmt.nginx.models.AnalysisResult
710+
:raises ~azure.core.exceptions.HttpResponseError:
711+
"""
712+
error_map = {
713+
401: ClientAuthenticationError,
714+
404: ResourceNotFoundError,
715+
409: ResourceExistsError,
716+
304: ResourceNotModifiedError,
717+
}
718+
error_map.update(kwargs.pop("error_map", {}) or {})
719+
720+
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
721+
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
722+
723+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
724+
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
725+
cls: ClsType[_models.AnalysisResult] = kwargs.pop("cls", None)
726+
727+
content_type = content_type or "application/json"
728+
_json = None
729+
_content = None
730+
if isinstance(body, (IOBase, bytes)):
731+
_content = body
732+
else:
733+
if body is not None:
734+
_json = self._serialize.body(body, "AnalysisCreate")
735+
else:
736+
_json = None
737+
738+
request = build_analysis_request(
739+
resource_group_name=resource_group_name,
740+
deployment_name=deployment_name,
741+
configuration_name=configuration_name,
742+
subscription_id=self._config.subscription_id,
743+
api_version=api_version,
744+
content_type=content_type,
745+
json=_json,
746+
content=_content,
747+
template_url=self.analysis.metadata["url"],
748+
headers=_headers,
749+
params=_params,
750+
)
751+
request = _convert_request(request)
752+
request.url = self._client.format_url(request.url)
753+
754+
_stream = False
755+
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
756+
request, stream=_stream, **kwargs
757+
)
758+
759+
response = pipeline_response.http_response
760+
761+
if response.status_code not in [200]:
762+
map_error(status_code=response.status_code, response=response, error_map=error_map)
763+
error = self._deserialize.failsafe_deserialize(
764+
_models.ResourceProviderDefaultErrorResponse, pipeline_response
765+
)
766+
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
767+
768+
deserialized = self._deserialize("AnalysisResult", pipeline_response)
769+
770+
if cls:
771+
return cls(pipeline_response, deserialized, {})
772+
773+
return deserialized
774+
775+
analysis.metadata = {
776+
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}/analyze"
777+
}

0 commit comments

Comments
 (0)