Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-mgmt-applicationinsights] Adding API to support generating access token for ApplicationInsights Profiler #2622

Open
wants to merge 1 commit into
base: release/v3
Choose a base branch
from
Open
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
33 changes: 12 additions & 21 deletions sdk/applicationinsights/azure-mgmt-applicationinsights/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
## Microsoft Azure SDK for Python
# Microsoft Azure SDK for Python

This is the Microsoft Azure Application Insights Management Client
Library.
This is the Microsoft Azure Application Insights 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).

Azure Resource Manager (ARM) is the next generation of management APIs
that replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.
# Usage

For the older Azure Service Management (ASM) libraries, see
[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy)
library.
For code examples, see [Application Insights Management](https://docs.microsoft.com/python/api/overview/azure/)
on docs.microsoft.com.

For a more complete set of Azure libraries, see the
[azure sdk python release](https://aka.ms/azsdk/python/all).

## Usage
# Provide Feedback

For code examples, see [Application Insights
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)
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.

![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-applicationinsights%2FREADME.png)

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-applicationinsights%2FREADME.png)
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, SDKClient):
'ea_subscription_rollback_to_legacy_pricing_model': '2017-10-01',
'export_configurations': '2015-05-01',
'favorites': '2015-05-01',
'operations': '2015-05-01',
'my_workbooks': '2015-05-01',
'operations': '2019-09-01-preview',
'proactive_detection_configurations': '2018-05-01-preview',
'queries': '2019-09-01-preview',
'query_packs': '2019-09-01-preview',
Expand Down Expand Up @@ -331,15 +332,31 @@ def favorites(self):
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def my_workbooks(self):
"""Instance depends on the API version:

* 2015-05-01: :class:`MyWorkbooksOperations<azure.mgmt.applicationinsights.v2015_05_01.operations.MyWorkbooksOperations>`
"""
api_version = self._get_api_version('my_workbooks')
if api_version == '2015-05-01':
from .v2015_05_01.operations import MyWorkbooksOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def operations(self):
"""Instance depends on the API version:

* 2015-05-01: :class:`Operations<azure.mgmt.applicationinsights.v2015_05_01.operations.Operations>`
* 2019-09-01-preview: :class:`Operations<azure.mgmt.applicationinsights.v2019_09_01_preview.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2015-05-01':
from .v2015_05_01.operations import Operations as OperationClass
elif api_version == '2019-09-01-preview':
from .v2019_09_01_preview.operations import Operations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from .operations import WebTestsOperations
from .operations import AnalyticsItemsOperations
from .operations import WorkbooksOperations
from .operations import MyWorkbooksOperations
from . import models


Expand Down Expand Up @@ -70,6 +71,8 @@ class ApplicationInsightsManagementClient(SDKClient):
:vartype analytics_items: azure.mgmt.applicationinsights.v2015_05_01.operations.AnalyticsItemsOperations
:ivar workbooks: Workbooks operations
:vartype workbooks: azure.mgmt.applicationinsights.v2015_05_01.operations.WorkbooksOperations
:ivar my_workbooks: MyWorkbooks operations
:vartype my_workbooks: azure.mgmt.applicationinsights.v2015_05_01.operations.MyWorkbooksOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
Expand Down Expand Up @@ -122,3 +125,5 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.workbooks = WorkbooksOperations(
self._client, self.config, self._serialize, self._deserialize)
self.my_workbooks = MyWorkbooksOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
from ._models_py3 import ErrorResponse, ErrorResponseException
from ._models_py3 import InnerError
from ._models_py3 import LinkProperties
from ._models_py3 import MyWorkbook
from ._models_py3 import MyWorkbookError, MyWorkbookErrorException
from ._models_py3 import MyWorkbookResource
from ._models_py3 import Operation
from ._models_py3 import OperationDisplay
from ._models_py3 import PrivateLinkScopedResource
Expand Down Expand Up @@ -83,6 +86,9 @@
from ._models import ErrorResponse, ErrorResponseException
from ._models import InnerError
from ._models import LinkProperties
from ._models import MyWorkbook
from ._models import MyWorkbookError, MyWorkbookErrorException
from ._models import MyWorkbookResource
from ._models import Operation
from ._models import OperationDisplay
from ._models import PrivateLinkScopedResource
Expand All @@ -101,6 +107,7 @@
from ._paged_models import ApplicationInsightsComponentAPIKeyPaged
from ._paged_models import ApplicationInsightsComponentPaged
from ._paged_models import ApplicationInsightsComponentWebTestLocationPaged
from ._paged_models import MyWorkbookPaged
from ._paged_models import OperationPaged
from ._paged_models import WebTestPaged
from ._paged_models import WorkbookPaged
Expand All @@ -109,6 +116,7 @@
ApplicationType,
FlowType,
RequestSource,
IngestionMode,
PurgeState,
FavoriteType,
WebTestKind,
Expand Down Expand Up @@ -151,6 +159,9 @@
'ErrorResponse', 'ErrorResponseException',
'InnerError',
'LinkProperties',
'MyWorkbook',
'MyWorkbookError', 'MyWorkbookErrorException',
'MyWorkbookResource',
'Operation',
'OperationDisplay',
'PrivateLinkScopedResource',
Expand All @@ -173,9 +184,11 @@
'ApplicationInsightsComponentWebTestLocationPaged',
'WebTestPaged',
'WorkbookPaged',
'MyWorkbookPaged',
'ApplicationType',
'FlowType',
'RequestSource',
'IngestionMode',
'PurgeState',
'FavoriteType',
'WebTestKind',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ class RequestSource(str, Enum):
rest = "rest"


class IngestionMode(str, Enum):

application_insights = "ApplicationInsights"
application_insights_with_diagnostic_settings = "ApplicationInsightsWithDiagnosticSettings"
log_analytics = "LogAnalytics"


class PurgeState(str, Enum):

pending = "pending"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ class ApplicationInsightsComponent(ComponentsResource):
resources.
:vartype private_link_scoped_resources:
list[~azure.mgmt.applicationinsights.v2015_05_01.models.PrivateLinkScopedResource]
:param ingestion_mode: Indicates the flow of the ingestion. Possible
values include: 'ApplicationInsights',
'ApplicationInsightsWithDiagnosticSettings', 'LogAnalytics'. Default
value: "ApplicationInsights" .
:type ingestion_mode: str or
~azure.mgmt.applicationinsights.v2015_05_01.models.IngestionMode
"""

_validation = {
Expand Down Expand Up @@ -280,6 +286,7 @@ class ApplicationInsightsComponent(ComponentsResource):
'disable_ip_masking': {'key': 'properties.DisableIpMasking', 'type': 'bool'},
'immediate_purge_data_on30_days': {'key': 'properties.ImmediatePurgeDataOn30Days', 'type': 'bool'},
'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'},
'ingestion_mode': {'key': 'properties.IngestionMode', 'type': 'str'},
}

def __init__(self, **kwargs):
Expand All @@ -302,6 +309,7 @@ def __init__(self, **kwargs):
self.disable_ip_masking = kwargs.get('disable_ip_masking', None)
self.immediate_purge_data_on30_days = kwargs.get('immediate_purge_data_on30_days', None)
self.private_link_scoped_resources = None
self.ingestion_mode = kwargs.get('ingestion_mode', "ApplicationInsights")


class ApplicationInsightsComponentAnalyticsItem(Model):
Expand Down Expand Up @@ -1381,6 +1389,162 @@ def __init__(self, **kwargs):
self.category = kwargs.get('category', None)


class MyWorkbookResource(Model):
"""An azure resource object.

:param id: Azure resource Id
:type id: str
:param name: Azure resource name
:type name: str
:param type: Azure resource type
:type type: str
:param location: Resource location
:type location: str
:param tags: Resource tags
:type tags: dict[str, str]
"""

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
}

def __init__(self, **kwargs):
super(MyWorkbookResource, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.name = kwargs.get('name', None)
self.type = kwargs.get('type', None)
self.location = kwargs.get('location', None)
self.tags = kwargs.get('tags', None)


class MyWorkbook(MyWorkbookResource):
"""An Application Insights private workbook definition.

Variables are only populated by the server, and will be ignored when
sending a request.

All required parameters must be populated in order to send to Azure.

:param id: Azure resource Id
:type id: str
:param name: Azure resource name
:type name: str
:param type: Azure resource type
:type type: str
:param location: Resource location
:type location: str
:param tags: Resource tags
:type tags: dict[str, str]
:param kind: The kind of workbook. Choices are user and shared. Possible
values include: 'user', 'shared'
:type kind: str or
~azure.mgmt.applicationinsights.v2015_05_01.models.SharedTypeKind
:param display_name: Required. The user-defined name of the private
workbook.
:type display_name: str
:param serialized_data: Required. Configuration of this particular private
workbook. Configuration data is a string containing valid JSON
:type serialized_data: str
:param version: This instance's version of the data model. This can change
as new features are added that can be marked private workbook.
:type version: str
:ivar time_modified: Date and time in UTC of the last modification that
was made to this private workbook definition.
:vartype time_modified: str
:param category: Required. Workbook category, as defined by the user at
creation time.
:type category: str
:param my_workbook_tags: A list of 0 or more tags that are associated with
this private workbook definition
:type my_workbook_tags: list[str]
:ivar user_id: Unique user id of the specific user that owns this private
workbook.
:vartype user_id: str
:param source_id: Optional resourceId for a source resource.
:type source_id: str
"""

_validation = {
'display_name': {'required': True},
'serialized_data': {'required': True},
'time_modified': {'readonly': True},
'category': {'required': True},
'user_id': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'kind': {'key': 'kind', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'serialized_data': {'key': 'properties.serializedData', 'type': 'str'},
'version': {'key': 'properties.version', 'type': 'str'},
'time_modified': {'key': 'properties.timeModified', 'type': 'str'},
'category': {'key': 'properties.category', 'type': 'str'},
'my_workbook_tags': {'key': 'properties.tags', 'type': '[str]'},
'user_id': {'key': 'properties.userId', 'type': 'str'},
'source_id': {'key': 'properties.sourceId', 'type': 'str'},
}

def __init__(self, **kwargs):
super(MyWorkbook, self).__init__(**kwargs)
self.kind = kwargs.get('kind', None)
self.display_name = kwargs.get('display_name', None)
self.serialized_data = kwargs.get('serialized_data', None)
self.version = kwargs.get('version', None)
self.time_modified = None
self.category = kwargs.get('category', None)
self.my_workbook_tags = kwargs.get('my_workbook_tags', None)
self.user_id = None
self.source_id = kwargs.get('source_id', None)


class MyWorkbookError(Model):
"""Error message body that will indicate why the operation failed.

:param code: Service-defined error code. This code serves as a sub-status
for the HTTP error code specified in the response.
:type code: str
:param message: Human-readable representation of the error.
:type message: str
:param details: The list of invalid fields send in request, in case of
validation error.
:type details:
list[~azure.mgmt.applicationinsights.v2015_05_01.models.ErrorFieldContract]
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorFieldContract]'},
}

def __init__(self, **kwargs):
super(MyWorkbookError, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.message = kwargs.get('message', None)
self.details = kwargs.get('details', None)


class MyWorkbookErrorException(HttpOperationError):
"""Server responsed with exception of type: 'MyWorkbookError'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(MyWorkbookErrorException, self).__init__(deserialize, response, 'MyWorkbookError', *args)


class Operation(Model):
"""CDN REST API operation.

Expand Down
Loading