Skip to content

Commit

Permalink
Release sdk automanage (#13693)
Browse files Browse the repository at this point in the history
* add automanage ci

* auto generated sdk

* add init

Co-authored-by: xichen <xichen@microsoft.com>
  • Loading branch information
shawncx and msxichen committed Sep 11, 2020
1 parent 2774439 commit 26d4871
Show file tree
Hide file tree
Showing 33 changed files with 5,093 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sdk/automanage/azure-mgmt-automanage/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Release History

## 1.0.0b1 (2020-09-10)

* Initial Release
5 changes: 5 additions & 0 deletions sdk/automanage/azure-mgmt-automanage/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
include azure/mgmt/__init__.py

21 changes: 21 additions & 0 deletions sdk/automanage/azure-mgmt-automanage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Microsoft Azure SDK for Python

This is the Microsoft Azure Auto Manage Management Client Library.
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).


# Usage

For code examples, see [Auto Manage Management](https://docs.microsoft.com/python/api/overview/azure/)
on docs.microsoft.com.


# Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in the
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
section of the project.


![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-automanage%2FREADME.png)
1 change: 1 addition & 0 deletions sdk/automanage/azure-mgmt-automanage/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._automanage_client import AutomanageClient
from ._version import VERSION

__version__ = VERSION
__all__ = ['AutomanageClient']

try:
from ._patch import patch_sdk
patch_sdk()
except ImportError:
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING

from azure.mgmt.core import ARMPipelineClient
from msrest import Deserializer, Serializer

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Optional

from azure.core.credentials import TokenCredential

from ._configuration import AutomanageClientConfiguration
from .operations import AccountsOperations
from .operations import ConfigurationProfileAssignmentsOperations
from .operations import ConfigurationProfilePreferencesOperations
from .operations import Operations
from . import models


class AutomanageClient(object):
"""Automanage Client.
:ivar accounts: AccountsOperations operations
:vartype accounts: automanage_client.operations.AccountsOperations
:ivar configuration_profile_assignments: ConfigurationProfileAssignmentsOperations operations
:vartype configuration_profile_assignments: automanage_client.operations.ConfigurationProfileAssignmentsOperations
:ivar configuration_profile_preferences: ConfigurationProfilePreferencesOperations operations
:vartype configuration_profile_preferences: automanage_client.operations.ConfigurationProfilePreferencesOperations
:ivar operations: Operations operations
:vartype operations: automanage_client.operations.Operations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
base_url=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> None
if not base_url:
base_url = 'https://management.azure.com'
self._config = AutomanageClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.accounts = AccountsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.configuration_profile_assignments = ConfigurationProfileAssignmentsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.configuration_profile_preferences = ConfigurationProfilePreferencesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)

def close(self):
# type: () -> None
self._client.close()

def __enter__(self):
# type: () -> AutomanageClient
self._client.__enter__()
return self

def __exit__(self, *exc_details):
# type: (Any) -> None
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies

from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.credentials import TokenCredential


class AutomanageClientConfiguration(Configuration):
"""Configuration for AutomanageClient.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
**kwargs # type: Any
):
# type: (...) -> None
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(AutomanageClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-06-30-preview"
self.credential_scopes = ['https://management.azure.com/.default']
self.credential_scopes.extend(kwargs.pop('credential_scopes', []))
kwargs.setdefault('sdk_moniker', 'mgmt-automanage/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
self,
**kwargs # type: Any
):
# type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"chosen_version": "2020-06-30-preview",
"total_api_version_list": ["2020-06-30-preview"],
"client": {
"name": "AutomanageClient",
"filename": "_automanage_client",
"description": "Automanage Client."
},
"global_parameters": {
"sync_method": {
"credential": {
"method_signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"method_signature": "subscription_id, # type: str",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
},
"async_method": {
"credential": {
"method_signature": "credential, # type: \"AsyncTokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"method_signature": "subscription_id, # type: str",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id"
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"]
},
"operation_groups": {
"accounts": "AccountsOperations",
"configuration_profile_assignments": "ConfigurationProfileAssignmentsOperations",
"configuration_profile_preferences": "ConfigurationProfilePreferencesOperations",
"operations": "Operations"
},
"operation_mixins": {
},
"sync_imports": "None",
"async_imports": "None"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._automanage_client_async import AutomanageClient
__all__ = ['AutomanageClient']
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import Any, Optional, TYPE_CHECKING

from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential

from ._configuration_async import AutomanageClientConfiguration
from .operations_async import AccountsOperations
from .operations_async import ConfigurationProfileAssignmentsOperations
from .operations_async import ConfigurationProfilePreferencesOperations
from .operations_async import Operations
from .. import models


class AutomanageClient(object):
"""Automanage Client.
:ivar accounts: AccountsOperations operations
:vartype accounts: automanage_client.aio.operations_async.AccountsOperations
:ivar configuration_profile_assignments: ConfigurationProfileAssignmentsOperations operations
:vartype configuration_profile_assignments: automanage_client.aio.operations_async.ConfigurationProfileAssignmentsOperations
:ivar configuration_profile_preferences: ConfigurationProfilePreferencesOperations operations
:vartype configuration_profile_preferences: automanage_client.aio.operations_async.ConfigurationProfilePreferencesOperations
:ivar operations: Operations operations
:vartype operations: automanage_client.aio.operations_async.Operations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
base_url: Optional[str] = None,
**kwargs: Any
) -> None:
if not base_url:
base_url = 'https://management.azure.com'
self._config = AutomanageClientConfiguration(credential, subscription_id, **kwargs)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.accounts = AccountsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.configuration_profile_assignments = ConfigurationProfileAssignmentsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.configuration_profile_preferences = ConfigurationProfilePreferencesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)

async def close(self) -> None:
await self._client.close()

async def __aenter__(self) -> "AutomanageClient":
await self._client.__aenter__()
return self

async def __aexit__(self, *exc_details) -> None:
await self._client.__aexit__(*exc_details)

0 comments on commit 26d4871

Please sign in to comment.