Skip to content

Commit 1cde44b

Browse files
[AutoRelease] t2-selfhelp-2024-04-07-60004(can only be merged by SDK owner) (#35098)
* code and test * Update assets.json --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent fe87184 commit 1cde44b

File tree

56 files changed

+3383
-852
lines changed

Some content is hidden

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

56 files changed

+3383
-852
lines changed

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

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

3+
## 2.0.0b3 (2024-04-22)
4+
5+
### Features Added
6+
7+
- Added operation SolutionOperations.warm_up
8+
- Added operation group DiscoverySolutionNLPSubscriptionScopeOperations
9+
- Added operation group DiscoverySolutionNLPTenantScopeOperations
10+
- Added operation group SimplifiedSolutionsOperations
11+
- Added operation group SolutionSelfHelpOperations
12+
- Model AutomatedCheckResult has a new parameter status
13+
- Model AutomatedCheckResult has a new parameter version
14+
- Model ResponseValidationProperties has a new parameter validation_scope
15+
- Model SolutionsDiagnostic has a new parameter estimated_completion_time
16+
- Model StepInput has a new parameter question_title
17+
18+
### Breaking Changes
19+
20+
- Operation DiscoverySolutionOperations.list no longer has parameter scope
21+
322
## 2.0.0b2 (2023-12-18)
423

524
### Features Added

sdk/selfhelp/azure-mgmt-selfhelp/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 Selfhelp 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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "df4c0dccbfb696b378dfef8c7e451dfa4b82b175",
2+
"commit": "835b124ff8160d23823c0e770b4989ca79e7418c",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.7",
55
"use": [
6-
"@autorest/python@6.7.1",
7-
"@autorest/modelerfour@4.26.2"
6+
"@autorest/python@6.13.7",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/help/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/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
9+
"autorest_command": "autorest specification/help/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/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False",
1010
"readme": "specification/help/resource-manager/readme.md"
1111
}

sdk/selfhelp/azure-mgmt-selfhelp/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/selfhelp/azure-mgmt-selfhelp",
5-
"Tag": "python/selfhelp/azure-mgmt-selfhelp_29e4bf4e7b"
5+
"Tag": "python/selfhelp/azure-mgmt-selfhelp_a64311aadc"
66
}

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

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

99
from typing import Any, TYPE_CHECKING
1010

11-
from azure.core.configuration import Configuration
1211
from azure.core.pipeline import policies
1312
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1413

@@ -19,30 +18,35 @@
1918
from azure.core.credentials import TokenCredential
2019

2120

22-
class SelfHelpMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
21+
class SelfHelpMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2322
"""Configuration for SelfHelpMgmtClient.
2423
2524
Note that all parameters used to create this instance are saved as instance
2625
attributes.
2726
2827
:param credential: Credential needed for the client to connect to Azure. Required.
2928
:type credential: ~azure.core.credentials.TokenCredential
30-
:keyword api_version: Api Version. Default value is "2023-09-01-preview". Note that overriding
29+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
30+
:type subscription_id: str
31+
:keyword api_version: Api Version. Default value is "2024-03-01-preview". Note that overriding
3132
this default value may result in unsupported behavior.
3233
:paramtype api_version: str
3334
"""
3435

35-
def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None:
36-
super(SelfHelpMgmtClientConfiguration, self).__init__(**kwargs)
37-
api_version: str = kwargs.pop("api_version", "2023-09-01-preview")
36+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
37+
api_version: str = kwargs.pop("api_version", "2024-03-01-preview")
3838

3939
if credential is None:
4040
raise ValueError("Parameter 'credential' must not be None.")
41+
if subscription_id is None:
42+
raise ValueError("Parameter 'subscription_id' must not be None.")
4143

4244
self.credential = credential
45+
self.subscription_id = subscription_id
4346
self.api_version = api_version
4447
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4548
kwargs.setdefault("sdk_moniker", "mgmt-selfhelp/{}".format(VERSION))
49+
self.polling_interval = kwargs.get("polling_interval", 30)
4650
self._configure(**kwargs)
4751

4852
def _configure(self, **kwargs: Any) -> None:
@@ -51,9 +55,9 @@ def _configure(self, **kwargs: Any) -> None:
5155
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5256
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5357
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
54-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
5558
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
5659
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
60+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
5761
self.authentication_policy = kwargs.get("authentication_policy")
5862
if self.credential and not self.authentication_policy:
5963
self.authentication_policy = ARMChallengeAuthenticationPolicy(

sdk/selfhelp/azure-mgmt-selfhelp/azure/mgmt/selfhelp/_self_help_mgmt_client.py

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,24 @@
99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
1111

12+
from azure.core.pipeline import policies
1213
from azure.core.rest import HttpRequest, HttpResponse
1314
from azure.mgmt.core import ARMPipelineClient
15+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1416

1517
from . import models as _models
1618
from ._configuration import SelfHelpMgmtClientConfiguration
1719
from ._serialization import Deserializer, Serializer
1820
from .operations import (
1921
CheckNameAvailabilityOperations,
2022
DiagnosticsOperations,
23+
DiscoverySolutionNLPSubscriptionScopeOperations,
24+
DiscoverySolutionNLPTenantScopeOperations,
2125
DiscoverySolutionOperations,
2226
Operations,
27+
SimplifiedSolutionsOperations,
2328
SolutionOperations,
29+
SolutionSelfHelpOperations,
2430
TroubleshootersOperations,
2531
)
2632

@@ -29,7 +35,7 @@
2935
from azure.core.credentials import TokenCredential
3036

3137

32-
class SelfHelpMgmtClient: # pylint: disable=client-accepts-api-version-keyword
38+
class SelfHelpMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
3339
"""Help RP provider.
3440
3541
:ivar operations: Operations operations
@@ -43,24 +49,59 @@ class SelfHelpMgmtClient: # pylint: disable=client-accepts-api-version-keyword
4349
:vartype discovery_solution: azure.mgmt.selfhelp.operations.DiscoverySolutionOperations
4450
:ivar solution: SolutionOperations operations
4551
:vartype solution: azure.mgmt.selfhelp.operations.SolutionOperations
52+
:ivar simplified_solutions: SimplifiedSolutionsOperations operations
53+
:vartype simplified_solutions: azure.mgmt.selfhelp.operations.SimplifiedSolutionsOperations
4654
:ivar troubleshooters: TroubleshootersOperations operations
4755
:vartype troubleshooters: azure.mgmt.selfhelp.operations.TroubleshootersOperations
56+
:ivar solution_self_help: SolutionSelfHelpOperations operations
57+
:vartype solution_self_help: azure.mgmt.selfhelp.operations.SolutionSelfHelpOperations
58+
:ivar discovery_solution_nlp_tenant_scope: DiscoverySolutionNLPTenantScopeOperations operations
59+
:vartype discovery_solution_nlp_tenant_scope:
60+
azure.mgmt.selfhelp.operations.DiscoverySolutionNLPTenantScopeOperations
61+
:ivar discovery_solution_nlp_subscription_scope:
62+
DiscoverySolutionNLPSubscriptionScopeOperations operations
63+
:vartype discovery_solution_nlp_subscription_scope:
64+
azure.mgmt.selfhelp.operations.DiscoverySolutionNLPSubscriptionScopeOperations
4865
:param credential: Credential needed for the client to connect to Azure. Required.
4966
:type credential: ~azure.core.credentials.TokenCredential
67+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
68+
:type subscription_id: str
5069
:param base_url: Service URL. Default value is "https://management.azure.com".
5170
:type base_url: str
52-
:keyword api_version: Api Version. Default value is "2023-09-01-preview". Note that overriding
71+
:keyword api_version: Api Version. Default value is "2024-03-01-preview". Note that overriding
5372
this default value may result in unsupported behavior.
5473
:paramtype api_version: str
5574
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
5675
Retry-After header is present.
5776
"""
5877

5978
def __init__(
60-
self, credential: "TokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any
79+
self,
80+
credential: "TokenCredential",
81+
subscription_id: str,
82+
base_url: str = "https://management.azure.com",
83+
**kwargs: Any
6184
) -> None:
62-
self._config = SelfHelpMgmtClientConfiguration(credential=credential, **kwargs)
63-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
85+
self._config = SelfHelpMgmtClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
86+
_policies = kwargs.pop("policies", None)
87+
if _policies is None:
88+
_policies = [
89+
policies.RequestIdPolicy(**kwargs),
90+
self._config.headers_policy,
91+
self._config.user_agent_policy,
92+
self._config.proxy_policy,
93+
policies.ContentDecodePolicy(**kwargs),
94+
ARMAutoResourceProviderRegistrationPolicy(),
95+
self._config.redirect_policy,
96+
self._config.retry_policy,
97+
self._config.authentication_policy,
98+
self._config.custom_hook_policy,
99+
self._config.logging_policy,
100+
policies.DistributedTracingPolicy(**kwargs),
101+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
102+
self._config.http_logging_policy,
103+
]
104+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
64105

65106
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
66107
self._serialize = Serializer(client_models)
@@ -75,9 +116,21 @@ def __init__(
75116
self._client, self._config, self._serialize, self._deserialize
76117
)
77118
self.solution = SolutionOperations(self._client, self._config, self._serialize, self._deserialize)
119+
self.simplified_solutions = SimplifiedSolutionsOperations(
120+
self._client, self._config, self._serialize, self._deserialize
121+
)
78122
self.troubleshooters = TroubleshootersOperations(self._client, self._config, self._serialize, self._deserialize)
123+
self.solution_self_help = SolutionSelfHelpOperations(
124+
self._client, self._config, self._serialize, self._deserialize
125+
)
126+
self.discovery_solution_nlp_tenant_scope = DiscoverySolutionNLPTenantScopeOperations(
127+
self._client, self._config, self._serialize, self._deserialize
128+
)
129+
self.discovery_solution_nlp_subscription_scope = DiscoverySolutionNLPSubscriptionScopeOperations(
130+
self._client, self._config, self._serialize, self._deserialize
131+
)
79132

80-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
133+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
81134
"""Runs the network request through the client's chained policies.
82135
83136
>>> from azure.core.rest import HttpRequest
@@ -97,7 +150,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
97150

98151
request_copy = deepcopy(request)
99152
request_copy.url = self._client.format_url(request_copy.url)
100-
return self._client.send_request(request_copy, **kwargs)
153+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
101154

102155
def close(self) -> None:
103156
self._client.close()

0 commit comments

Comments
 (0)