id
int64 0
843k
| repository_name
stringlengths 7
55
| file_path
stringlengths 9
332
| class_name
stringlengths 3
290
| human_written_code
stringlengths 12
4.36M
| class_skeleton
stringlengths 19
2.2M
| total_program_units
int64 1
9.57k
| total_doc_str
int64 0
4.2k
| AvgCountLine
float64 0
7.89k
| AvgCountLineBlank
float64 0
300
| AvgCountLineCode
float64 0
7.89k
| AvgCountLineComment
float64 0
7.89k
| AvgCyclomatic
float64 0
130
| CommentToCodeRatio
float64 0
176
| CountClassBase
float64 0
48
| CountClassCoupled
float64 0
589
| CountClassCoupledModified
float64 0
581
| CountClassDerived
float64 0
5.37k
| CountDeclInstanceMethod
float64 0
4.2k
| CountDeclInstanceVariable
float64 0
299
| CountDeclMethod
float64 0
4.2k
| CountDeclMethodAll
float64 0
4.2k
| CountLine
float64 1
115k
| CountLineBlank
float64 0
9.01k
| CountLineCode
float64 0
94.4k
| CountLineCodeDecl
float64 0
46.1k
| CountLineCodeExe
float64 0
91.3k
| CountLineComment
float64 0
27k
| CountStmt
float64 1
93.2k
| CountStmtDecl
float64 0
46.1k
| CountStmtExe
float64 0
90.2k
| MaxCyclomatic
float64 0
759
| MaxInheritanceTree
float64 0
16
| MaxNesting
float64 0
34
| SumCyclomatic
float64 0
6k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10,600 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableMongodbCollectionGetResult
|
class RestorableMongodbCollectionGetResult(_serialization.Model):
"""An Azure Cosmos DB MongoDB collection event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource Identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar resource: The resource of an Azure Cosmos DB MongoDB collection event.
:vartype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbCollectionPropertiesResource
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"resource": {"key": "properties.resource", "type": "RestorableMongodbCollectionPropertiesResource"},
}
def __init__(
self, *, resource: Optional["_models.RestorableMongodbCollectionPropertiesResource"] = None, **kwargs: Any
) -> None:
"""
:keyword resource: The resource of an Azure Cosmos DB MongoDB collection event.
:paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbCollectionPropertiesResource
"""
super().__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.resource = resource
|
class RestorableMongodbCollectionGetResult(_serialization.Model):
'''An Azure Cosmos DB MongoDB collection event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource Identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar resource: The resource of an Azure Cosmos DB MongoDB collection event.
:vartype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbCollectionPropertiesResource
'''
def __init__(
self, *, resource: Optional["_models.RestorableMongodbCollectionPropertiesResource"] = None, **kwargs: Any
) -> None:
'''
:keyword resource: The resource of an Azure Cosmos DB MongoDB collection event.
:paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbCollectionPropertiesResource
'''
pass
| 2 | 2 | 12 | 0 | 8 | 4 | 1 | 0.75 | 1 | 2 | 0 | 0 | 1 | 4 | 1 | 16 | 40 | 5 | 20 | 10 | 16 | 15 | 9 | 8 | 7 | 1 | 2 | 0 | 1 |
10,601 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RedistributeThroughputPropertiesResource
|
class RedistributeThroughputPropertiesResource(_serialization.Model):
"""Resource to redistribute throughput for Azure Cosmos DB resource.
All required parameters must be populated in order to send to server.
:ivar throughput_policy: ThroughputPolicy to apply for throughput redistribution. Required.
Known values are: "none", "equal", and "custom".
:vartype throughput_policy: str or ~azure.mgmt.cosmosdb.models.ThroughputPolicyType
:ivar target_physical_partition_throughput_info: Array of
PhysicalPartitionThroughputInfoResource objects. Required.
:vartype target_physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
:ivar source_physical_partition_throughput_info: Array of
PhysicalPartitionThroughputInfoResource objects. Required.
:vartype source_physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
"""
_validation = {
"throughput_policy": {"required": True},
"target_physical_partition_throughput_info": {"required": True},
"source_physical_partition_throughput_info": {"required": True},
}
_attribute_map = {
"throughput_policy": {"key": "throughputPolicy", "type": "str"},
"target_physical_partition_throughput_info": {
"key": "targetPhysicalPartitionThroughputInfo",
"type": "[PhysicalPartitionThroughputInfoResource]",
},
"source_physical_partition_throughput_info": {
"key": "sourcePhysicalPartitionThroughputInfo",
"type": "[PhysicalPartitionThroughputInfoResource]",
},
}
def __init__(
self,
*,
throughput_policy: Union[str, "_models.ThroughputPolicyType"],
target_physical_partition_throughput_info: List["_models.PhysicalPartitionThroughputInfoResource"],
source_physical_partition_throughput_info: List["_models.PhysicalPartitionThroughputInfoResource"],
**kwargs: Any
) -> None:
"""
:keyword throughput_policy: ThroughputPolicy to apply for throughput redistribution. Required.
Known values are: "none", "equal", and "custom".
:paramtype throughput_policy: str or ~azure.mgmt.cosmosdb.models.ThroughputPolicyType
:keyword target_physical_partition_throughput_info: Array of
PhysicalPartitionThroughputInfoResource objects. Required.
:paramtype target_physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
:keyword source_physical_partition_throughput_info: Array of
PhysicalPartitionThroughputInfoResource objects. Required.
:paramtype source_physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
"""
super().__init__(**kwargs)
self.throughput_policy = throughput_policy
self.target_physical_partition_throughput_info = target_physical_partition_throughput_info
self.source_physical_partition_throughput_info = source_physical_partition_throughput_info
|
class RedistributeThroughputPropertiesResource(_serialization.Model):
'''Resource to redistribute throughput for Azure Cosmos DB resource.
All required parameters must be populated in order to send to server.
:ivar throughput_policy: ThroughputPolicy to apply for throughput redistribution. Required.
Known values are: "none", "equal", and "custom".
:vartype throughput_policy: str or ~azure.mgmt.cosmosdb.models.ThroughputPolicyType
:ivar target_physical_partition_throughput_info: Array of
PhysicalPartitionThroughputInfoResource objects. Required.
:vartype target_physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
:ivar source_physical_partition_throughput_info: Array of
PhysicalPartitionThroughputInfoResource objects. Required.
:vartype source_physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
'''
def __init__(
self,
*,
throughput_policy: Union[str, "_models.ThroughputPolicyType"],
target_physical_partition_throughput_info: List["_models.PhysicalPartitionThroughputInfoResource"],
source_physical_partition_throughput_info: List["_models.PhysicalPartitionThroughputInfoResource"],
**kwargs: Any
) -> None:
'''
:keyword throughput_policy: ThroughputPolicy to apply for throughput redistribution. Required.
Known values are: "none", "equal", and "custom".
:paramtype throughput_policy: str or ~azure.mgmt.cosmosdb.models.ThroughputPolicyType
:keyword target_physical_partition_throughput_info: Array of
PhysicalPartitionThroughputInfoResource objects. Required.
:paramtype target_physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
:keyword source_physical_partition_throughput_info: Array of
PhysicalPartitionThroughputInfoResource objects. Required.
:paramtype source_physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
'''
pass
| 2 | 2 | 25 | 0 | 12 | 13 | 1 | 0.93 | 1 | 3 | 0 | 0 | 1 | 3 | 1 | 16 | 61 | 5 | 29 | 14 | 20 | 27 | 8 | 7 | 6 | 1 | 2 | 0 | 1 |
10,602 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableMongodbCollectionPropertiesResource
|
class RestorableMongodbCollectionPropertiesResource(_serialization.Model): # pylint: disable=name-too-long
"""The resource of an Azure Cosmos DB MongoDB collection event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar operation_type: The operation type of this collection event. Known values are: "Create",
"Replace", "Delete", "Recreate", and "SystemOperation".
:vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType
:ivar can_undelete: A state of this collection to identify if this container is restorable in
same account.
:vartype can_undelete: str
:ivar can_undelete_reason: The reason why this collection can not be restored in same account.
:vartype can_undelete_reason: str
:ivar event_timestamp: The time when this collection event happened.
:vartype event_timestamp: str
:ivar owner_id: The name of this MongoDB collection.
:vartype owner_id: str
:ivar owner_resource_id: The resource ID of this MongoDB collection.
:vartype owner_resource_id: str
"""
_validation = {
"rid": {"readonly": True},
"operation_type": {"readonly": True},
"can_undelete": {"readonly": True},
"can_undelete_reason": {"readonly": True},
"event_timestamp": {"readonly": True},
"owner_id": {"readonly": True},
"owner_resource_id": {"readonly": True},
}
_attribute_map = {
"rid": {"key": "_rid", "type": "str"},
"operation_type": {"key": "operationType", "type": "str"},
"can_undelete": {"key": "canUndelete", "type": "str"},
"can_undelete_reason": {"key": "canUndeleteReason", "type": "str"},
"event_timestamp": {"key": "eventTimestamp", "type": "str"},
"owner_id": {"key": "ownerId", "type": "str"},
"owner_resource_id": {"key": "ownerResourceId", "type": "str"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.rid = None
self.operation_type = None
self.can_undelete = None
self.can_undelete_reason = None
self.event_timestamp = None
self.owner_id = None
self.owner_resource_id = None
|
class RestorableMongodbCollectionPropertiesResource(_serialization.Model):
'''The resource of an Azure Cosmos DB MongoDB collection event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar operation_type: The operation type of this collection event. Known values are: "Create",
"Replace", "Delete", "Recreate", and "SystemOperation".
:vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType
:ivar can_undelete: A state of this collection to identify if this container is restorable in
same account.
:vartype can_undelete: str
:ivar can_undelete_reason: The reason why this collection can not be restored in same account.
:vartype can_undelete_reason: str
:ivar event_timestamp: The time when this collection event happened.
:vartype event_timestamp: str
:ivar owner_id: The name of this MongoDB collection.
:vartype owner_id: str
:ivar owner_resource_id: The resource ID of this MongoDB collection.
:vartype owner_resource_id: str
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 10 | 0 | 9 | 1 | 1 | 0.75 | 1 | 2 | 0 | 0 | 1 | 7 | 1 | 16 | 53 | 5 | 28 | 11 | 26 | 21 | 12 | 11 | 10 | 1 | 2 | 0 | 1 |
10,603 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RedistributeThroughputParameters
|
class RedistributeThroughputParameters(ARMResourceProperties):
"""Cosmos DB redistribute throughput parameters object.
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 server.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar location: The location of the resource group to which the resource belongs.
:vartype location: str
:ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:vartype tags: dict[str, str]
:ivar identity: Identity for the resource.
:vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:ivar resource: The standard JSON format of a resource throughput. Required.
:vartype resource: ~azure.mgmt.cosmosdb.models.RedistributeThroughputPropertiesResource
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"resource": {"required": 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}"},
"identity": {"key": "identity", "type": "ManagedServiceIdentity"},
"resource": {"key": "properties.resource", "type": "RedistributeThroughputPropertiesResource"},
}
def __init__(
self,
*,
resource: "_models.RedistributeThroughputPropertiesResource",
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
identity: Optional["_models.ManagedServiceIdentity"] = None,
**kwargs: Any
) -> None:
"""
:keyword location: The location of the resource group to which the resource belongs.
:paramtype location: str
:keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:paramtype tags: dict[str, str]
:keyword identity: Identity for the resource.
:paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:keyword resource: The standard JSON format of a resource throughput. Required.
:paramtype resource: ~azure.mgmt.cosmosdb.models.RedistributeThroughputPropertiesResource
"""
super().__init__(location=location, tags=tags, identity=identity, **kwargs)
self.resource = resource
|
class RedistributeThroughputParameters(ARMResourceProperties):
'''Cosmos DB redistribute throughput parameters object.
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 server.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar location: The location of the resource group to which the resource belongs.
:vartype location: str
:ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:vartype tags: dict[str, str]
:ivar identity: Identity for the resource.
:vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:ivar resource: The standard JSON format of a resource throughput. Required.
:vartype resource: ~azure.mgmt.cosmosdb.models.RedistributeThroughputPropertiesResource
'''
def __init__(
self,
*,
resource: "_models.RedistributeThroughputPropertiesResource",
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
identity: Optional["_models.ManagedServiceIdentity"] = None,
**kwargs: Any
) -> None:
'''
:keyword location: The location of the resource group to which the resource belongs.
:paramtype location: str
:keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:paramtype tags: dict[str, str]
:keyword identity: Identity for the resource.
:paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:keyword resource: The standard JSON format of a resource throughput. Required.
:paramtype resource: ~azure.mgmt.cosmosdb.models.RedistributeThroughputPropertiesResource
'''
pass
| 2 | 2 | 26 | 0 | 11 | 15 | 1 | 1.41 | 1 | 3 | 0 | 0 | 1 | 1 | 1 | 17 | 71 | 6 | 27 | 13 | 17 | 38 | 6 | 5 | 4 | 1 | 3 | 0 | 1 |
10,604 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ProvisioningIssueProperties
|
class ProvisioningIssueProperties(_serialization.Model):
"""Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource
providers should generate separate provisioning issue elements for each separate issue
detected, and include a meaningful and distinctive description, as well as any appropriate
suggestedResourceIds and suggestedAccessRules.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar issue_type: Type of issue. Known values are: "Unknown",
"ConfigurationPropagationFailure", "MissingPerimeterConfiguration", and
"MissingIdentityConfiguration".
:vartype issue_type: str or ~azure.mgmt.cosmosdb.models.IssueType
:ivar severity: Severity of the issue. Known values are: "Warning" and "Error".
:vartype severity: str or ~azure.mgmt.cosmosdb.models.Severity
:ivar description: Description of the issue.
:vartype description: str
:ivar suggested_resource_ids: Fully qualified resource IDs of suggested resources that can be
associated to the network security perimeter (NSP) to remediate the issue.
:vartype suggested_resource_ids: list[str]
:ivar suggested_access_rules: Access rules that can be added to the network security profile
(NSP) to remediate the issue.
:vartype suggested_access_rules: list[~azure.mgmt.cosmosdb.models.AccessRule]
"""
_validation = {
"issue_type": {"readonly": True},
"severity": {"readonly": True},
"description": {"readonly": True},
"suggested_resource_ids": {"readonly": True},
"suggested_access_rules": {"readonly": True},
}
_attribute_map = {
"issue_type": {"key": "issueType", "type": "str"},
"severity": {"key": "severity", "type": "str"},
"description": {"key": "description", "type": "str"},
"suggested_resource_ids": {"key": "suggestedResourceIds", "type": "[str]"},
"suggested_access_rules": {"key": "suggestedAccessRules", "type": "[AccessRule]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.issue_type = None
self.severity = None
self.description = None
self.suggested_resource_ids = None
self.suggested_access_rules = None
|
class ProvisioningIssueProperties(_serialization.Model):
'''Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource
providers should generate separate provisioning issue elements for each separate issue
detected, and include a meaningful and distinctive description, as well as any appropriate
suggestedResourceIds and suggestedAccessRules.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar issue_type: Type of issue. Known values are: "Unknown",
"ConfigurationPropagationFailure", "MissingPerimeterConfiguration", and
"MissingIdentityConfiguration".
:vartype issue_type: str or ~azure.mgmt.cosmosdb.models.IssueType
:ivar severity: Severity of the issue. Known values are: "Warning" and "Error".
:vartype severity: str or ~azure.mgmt.cosmosdb.models.Severity
:ivar description: Description of the issue.
:vartype description: str
:ivar suggested_resource_ids: Fully qualified resource IDs of suggested resources that can be
associated to the network security perimeter (NSP) to remediate the issue.
:vartype suggested_resource_ids: list[str]
:ivar suggested_access_rules: Access rules that can be added to the network security profile
(NSP) to remediate the issue.
:vartype suggested_access_rules: list[~azure.mgmt.cosmosdb.models.AccessRule]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 8 | 0 | 7 | 1 | 1 | 0.95 | 1 | 2 | 0 | 0 | 1 | 5 | 1 | 16 | 48 | 5 | 22 | 9 | 20 | 21 | 10 | 9 | 8 | 1 | 2 | 0 | 1 |
10,605 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.PermissionAutoGenerated
|
class PermissionAutoGenerated(_serialization.Model):
"""The set of data plane operations permitted through this Role Definition.
:ivar id: The id for the permission.
:vartype id: str
:ivar data_actions: An array of data actions that are allowed.
:vartype data_actions: list[str]
:ivar not_data_actions: An array of data actions that are denied.
:vartype not_data_actions: list[str]
"""
_attribute_map = {
"id": {"key": "id", "type": "str"},
"data_actions": {"key": "dataActions", "type": "[str]"},
"not_data_actions": {"key": "notDataActions", "type": "[str]"},
}
def __init__(
self,
*,
id: Optional[str] = None, # pylint: disable=redefined-builtin
data_actions: Optional[List[str]] = None,
not_data_actions: Optional[List[str]] = None,
**kwargs: Any
) -> None:
"""
:keyword id: The id for the permission.
:paramtype id: str
:keyword data_actions: An array of data actions that are allowed.
:paramtype data_actions: list[str]
:keyword not_data_actions: An array of data actions that are denied.
:paramtype not_data_actions: list[str]
"""
super().__init__(**kwargs)
self.id = id
self.data_actions = data_actions
self.not_data_actions = not_data_actions
|
class PermissionAutoGenerated(_serialization.Model):
'''The set of data plane operations permitted through this Role Definition.
:ivar id: The id for the permission.
:vartype id: str
:ivar data_actions: An array of data actions that are allowed.
:vartype data_actions: list[str]
:ivar not_data_actions: An array of data actions that are denied.
:vartype not_data_actions: list[str]
'''
def __init__(
self,
*,
id: Optional[str] = None, # pylint: disable=redefined-builtin
data_actions: Optional[List[str]] = None,
not_data_actions: Optional[List[str]] = None,
**kwargs: Any
) -> None:
'''
:keyword id: The id for the permission.
:paramtype id: str
:keyword data_actions: An array of data actions that are allowed.
:paramtype data_actions: list[str]
:keyword not_data_actions: An array of data actions that are denied.
:paramtype not_data_actions: list[str]
'''
pass
| 2 | 2 | 20 | 0 | 12 | 9 | 1 | 0.94 | 1 | 3 | 0 | 0 | 1 | 3 | 1 | 16 | 37 | 3 | 18 | 13 | 9 | 17 | 7 | 6 | 5 | 1 | 2 | 0 | 1 |
10,606 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.PhysicalPartitionId
|
class PhysicalPartitionId(_serialization.Model):
"""PhysicalPartitionId object.
All required parameters must be populated in order to send to server.
:ivar id: Id of a physical partition. Required.
:vartype id: str
"""
_validation = {
"id": {"required": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
}
def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin
"""
:keyword id: Id of a physical partition. Required.
:paramtype id: str
"""
super().__init__(**kwargs)
self.id = id
|
class PhysicalPartitionId(_serialization.Model):
'''PhysicalPartitionId object.
All required parameters must be populated in order to send to server.
:ivar id: Id of a physical partition. Required.
:vartype id: str
'''
def __init__(self, *, id: str, **kwargs: Any) -> None:
'''
:keyword id: Id of a physical partition. Required.
:paramtype id: str
'''
pass
| 2 | 2 | 7 | 0 | 3 | 5 | 1 | 1 | 1 | 3 | 0 | 0 | 1 | 1 | 1 | 16 | 24 | 5 | 10 | 5 | 8 | 10 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,607 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.PhysicalPartitionStorageInfo
|
class PhysicalPartitionStorageInfo(_serialization.Model):
"""The storage of a physical partition.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique identifier of the partition.
:vartype id: str
:ivar storage_in_kb: The storage in KB for the physical partition.
:vartype storage_in_kb: float
"""
_validation = {
"id": {"readonly": True},
"storage_in_kb": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"storage_in_kb": {"key": "storageInKB", "type": "float"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.id = None
self.storage_in_kb = None
|
class PhysicalPartitionStorageInfo(_serialization.Model):
'''The storage of a physical partition.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique identifier of the partition.
:vartype id: str
:ivar storage_in_kb: The storage in KB for the physical partition.
:vartype storage_in_kb: float
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 5 | 0 | 4 | 1 | 1 | 0.62 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 16 | 26 | 5 | 13 | 6 | 11 | 8 | 7 | 6 | 5 | 1 | 2 | 0 | 1 |
10,608 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.PhysicalPartitionStorageInfoCollection
|
class PhysicalPartitionStorageInfoCollection(_serialization.Model):
"""List of physical partitions and their properties returned by a merge operation.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar physical_partition_storage_info_collection: List of physical partitions and their
properties.
:vartype physical_partition_storage_info_collection:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfo]
"""
_validation = {
"physical_partition_storage_info_collection": {"readonly": True},
}
_attribute_map = {
"physical_partition_storage_info_collection": {
"key": "physicalPartitionStorageInfoCollection",
"type": "[PhysicalPartitionStorageInfo]",
},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.physical_partition_storage_info_collection = None
|
class PhysicalPartitionStorageInfoCollection(_serialization.Model):
'''List of physical partitions and their properties returned by a merge operation.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar physical_partition_storage_info_collection: List of physical partitions and their
properties.
:vartype physical_partition_storage_info_collection:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfo]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 4 | 0 | 3 | 1 | 1 | 0.62 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 26 | 5 | 13 | 5 | 11 | 8 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,609 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.PhysicalPartitionThroughputInfoProperties
|
class PhysicalPartitionThroughputInfoProperties(_serialization.Model): # pylint: disable=name-too-long
"""The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoProperties object.
:ivar physical_partition_throughput_info: Array of physical partition throughput info objects.
:vartype physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
"""
_attribute_map = {
"physical_partition_throughput_info": {
"key": "physicalPartitionThroughputInfo",
"type": "[PhysicalPartitionThroughputInfoResource]",
},
}
def __init__(
self,
*,
physical_partition_throughput_info: Optional[List["_models.PhysicalPartitionThroughputInfoResource"]] = None,
**kwargs: Any
) -> None:
"""
:keyword physical_partition_throughput_info: Array of physical partition throughput info
objects.
:paramtype physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
"""
super().__init__(**kwargs)
self.physical_partition_throughput_info = physical_partition_throughput_info
|
class PhysicalPartitionThroughputInfoProperties(_serialization.Model):
'''The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoProperties object.
:ivar physical_partition_throughput_info: Array of physical partition throughput info objects.
:vartype physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
'''
def __init__(
self,
*,
physical_partition_throughput_info: Optional[List["_models.PhysicalPartitionThroughputInfoResource"]] = None,
**kwargs: Any
) -> None:
'''
:keyword physical_partition_throughput_info: Array of physical partition throughput info
objects.
:paramtype physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
'''
pass
| 2 | 2 | 14 | 0 | 8 | 6 | 1 | 0.8 | 1 | 2 | 0 | 1 | 1 | 1 | 1 | 16 | 29 | 3 | 15 | 9 | 8 | 12 | 5 | 4 | 3 | 1 | 2 | 0 | 1 |
10,610 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.PhysicalPartitionThroughputInfoResource
|
class PhysicalPartitionThroughputInfoResource(_serialization.Model):
"""PhysicalPartitionThroughputInfo object.
All required parameters must be populated in order to send to server.
:ivar id: Id of a physical partition. Required.
:vartype id: str
:ivar throughput: Throughput of a physical partition.
:vartype throughput: float
"""
_validation = {
"id": {"required": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"throughput": {"key": "throughput", "type": "float"},
}
def __init__(
self, *, id: str, throughput: Optional[float] = None, **kwargs: Any # pylint: disable=redefined-builtin
) -> None:
"""
:keyword id: Id of a physical partition. Required.
:paramtype id: str
:keyword throughput: Throughput of a physical partition.
:paramtype throughput: float
"""
super().__init__(**kwargs)
self.id = id
self.throughput = throughput
|
class PhysicalPartitionThroughputInfoResource(_serialization.Model):
'''PhysicalPartitionThroughputInfo object.
All required parameters must be populated in order to send to server.
:ivar id: Id of a physical partition. Required.
:vartype id: str
:ivar throughput: Throughput of a physical partition.
:vartype throughput: float
'''
def __init__(
self, *, id: str, throughput: Optional[float] = None, **kwargs: Any # pylint: disable=redefined-builtin
) -> None:
'''
:keyword id: Id of a physical partition. Required.
:paramtype id: str
:keyword throughput: Throughput of a physical partition.
:paramtype throughput: float
'''
pass
| 2 | 2 | 12 | 0 | 6 | 7 | 1 | 1 | 1 | 4 | 0 | 0 | 1 | 2 | 1 | 16 | 32 | 5 | 14 | 8 | 10 | 14 | 7 | 6 | 5 | 1 | 2 | 0 | 1 |
10,611 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.PhysicalPartitionThroughputInfoResult
|
class PhysicalPartitionThroughputInfoResult(ARMResourceProperties):
"""An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar location: The location of the resource group to which the resource belongs.
:vartype location: str
:ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:vartype tags: dict[str, str]
:ivar identity: Identity for the resource.
:vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:ivar resource: properties of physical partition throughput info.
:vartype resource:
~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResultPropertiesResource
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"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}"},
"identity": {"key": "identity", "type": "ManagedServiceIdentity"},
"resource": {"key": "properties.resource", "type": "PhysicalPartitionThroughputInfoResultPropertiesResource"},
}
def __init__(
self,
*,
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
identity: Optional["_models.ManagedServiceIdentity"] = None,
resource: Optional["_models.PhysicalPartitionThroughputInfoResultPropertiesResource"] = None,
**kwargs: Any
) -> None:
"""
:keyword location: The location of the resource group to which the resource belongs.
:paramtype location: str
:keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:paramtype tags: dict[str, str]
:keyword identity: Identity for the resource.
:paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:keyword resource: properties of physical partition throughput info.
:paramtype resource:
~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResultPropertiesResource
"""
super().__init__(location=location, tags=tags, identity=identity, **kwargs)
self.resource = resource
|
class PhysicalPartitionThroughputInfoResult(ARMResourceProperties):
'''An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar location: The location of the resource group to which the resource belongs.
:vartype location: str
:ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:vartype tags: dict[str, str]
:ivar identity: Identity for the resource.
:vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:ivar resource: properties of physical partition throughput info.
:vartype resource:
~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResultPropertiesResource
'''
def __init__(
self,
*,
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
identity: Optional["_models.ManagedServiceIdentity"] = None,
resource: Optional["_models.PhysicalPartitionThroughputInfoResultPropertiesResource"] = None,
**kwargs: Any
) -> None:
'''
:keyword location: The location of the resource group to which the resource belongs.
:paramtype location: str
:keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:paramtype tags: dict[str, str]
:keyword identity: Identity for the resource.
:paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:keyword resource: properties of physical partition throughput info.
:paramtype resource:
~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResultPropertiesResource
'''
pass
| 2 | 2 | 27 | 0 | 11 | 16 | 1 | 1.5 | 1 | 3 | 0 | 0 | 1 | 1 | 1 | 17 | 70 | 5 | 26 | 13 | 16 | 39 | 6 | 5 | 4 | 1 | 3 | 0 | 1 |
10,612 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.PhysicalPartitionThroughputInfoResultPropertiesResource
|
class PhysicalPartitionThroughputInfoResultPropertiesResource(
PhysicalPartitionThroughputInfoProperties
): # pylint: disable=name-too-long
"""properties of physical partition throughput info.
:ivar physical_partition_throughput_info: Array of physical partition throughput info objects.
:vartype physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
"""
|
class PhysicalPartitionThroughputInfoResultPropertiesResource(
PhysicalPartitionThroughputInfoProperties
):
'''properties of physical partition throughput info.
:ivar physical_partition_throughput_info: Array of physical partition throughput info objects.
:vartype physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 9 | 1 | 3 | 3 | 0 | 6 | 1 | 1 | 0 | 0 | 3 | 0 | 0 |
10,613 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.PrivateEndpointConnection
|
class PrivateEndpointConnection(ProxyResource):
"""A private endpoint connection.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. E.g.
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData
:ivar private_endpoint: Private endpoint which the connection belongs to.
:vartype private_endpoint: ~azure.mgmt.cosmosdb.models.PrivateEndpointProperty
:ivar private_link_service_connection_state: Connection State of the Private Endpoint
Connection.
:vartype private_link_service_connection_state:
~azure.mgmt.cosmosdb.models.PrivateLinkServiceConnectionStateProperty
:ivar group_id: Group id of the private endpoint.
:vartype group_id: str
:ivar provisioning_state: Provisioning state of the private endpoint.
:vartype provisioning_state: str
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
"private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpointProperty"},
"private_link_service_connection_state": {
"key": "properties.privateLinkServiceConnectionState",
"type": "PrivateLinkServiceConnectionStateProperty",
},
"group_id": {"key": "properties.groupId", "type": "str"},
"provisioning_state": {"key": "properties.provisioningState", "type": "str"},
}
def __init__(
self,
*,
private_endpoint: Optional["_models.PrivateEndpointProperty"] = None,
private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionStateProperty"] = None,
group_id: Optional[str] = None,
provisioning_state: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword private_endpoint: Private endpoint which the connection belongs to.
:paramtype private_endpoint: ~azure.mgmt.cosmosdb.models.PrivateEndpointProperty
:keyword private_link_service_connection_state: Connection State of the Private Endpoint
Connection.
:paramtype private_link_service_connection_state:
~azure.mgmt.cosmosdb.models.PrivateLinkServiceConnectionStateProperty
:keyword group_id: Group id of the private endpoint.
:paramtype group_id: str
:keyword provisioning_state: Provisioning state of the private endpoint.
:paramtype provisioning_state: str
"""
super().__init__(**kwargs)
self.private_endpoint = private_endpoint
self.private_link_service_connection_state = private_link_service_connection_state
self.group_id = group_id
self.provisioning_state = provisioning_state
|
class PrivateEndpointConnection(ProxyResource):
'''A private endpoint connection.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. E.g.
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData
:ivar private_endpoint: Private endpoint which the connection belongs to.
:vartype private_endpoint: ~azure.mgmt.cosmosdb.models.PrivateEndpointProperty
:ivar private_link_service_connection_state: Connection State of the Private Endpoint
Connection.
:vartype private_link_service_connection_state:
~azure.mgmt.cosmosdb.models.PrivateLinkServiceConnectionStateProperty
:ivar group_id: Group id of the private endpoint.
:vartype group_id: str
:ivar provisioning_state: Provisioning state of the private endpoint.
:vartype provisioning_state: str
'''
def __init__(
self,
*,
private_endpoint: Optional["_models.PrivateEndpointProperty"] = None,
private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionStateProperty"] = None,
group_id: Optional[str] = None,
provisioning_state: Optional[str] = None,
**kwargs: Any
) -> None:
'''
:keyword private_endpoint: Private endpoint which the connection belongs to.
:paramtype private_endpoint: ~azure.mgmt.cosmosdb.models.PrivateEndpointProperty
:keyword private_link_service_connection_state: Connection State of the Private Endpoint
Connection.
:paramtype private_link_service_connection_state:
~azure.mgmt.cosmosdb.models.PrivateLinkServiceConnectionStateProperty
:keyword group_id: Group id of the private endpoint.
:paramtype group_id: str
:keyword provisioning_state: Provisioning state of the private endpoint.
:paramtype provisioning_state: str
'''
pass
| 2 | 2 | 26 | 0 | 14 | 12 | 1 | 1.06 | 1 | 3 | 0 | 0 | 1 | 4 | 1 | 17 | 75 | 5 | 34 | 16 | 24 | 36 | 9 | 8 | 7 | 1 | 4 | 0 | 1 |
10,614 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.PrivateEndpointConnectionListResult
|
class PrivateEndpointConnectionListResult(_serialization.Model):
"""A list of private endpoint connections.
:ivar value: Array of private endpoint connections.
:vartype value: list[~azure.mgmt.cosmosdb.models.PrivateEndpointConnection]
"""
_attribute_map = {
"value": {"key": "value", "type": "[PrivateEndpointConnection]"},
}
def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None:
"""
:keyword value: Array of private endpoint connections.
:paramtype value: list[~azure.mgmt.cosmosdb.models.PrivateEndpointConnection]
"""
super().__init__(**kwargs)
self.value = value
|
class PrivateEndpointConnectionListResult(_serialization.Model):
'''A list of private endpoint connections.
:ivar value: Array of private endpoint connections.
:vartype value: list[~azure.mgmt.cosmosdb.models.PrivateEndpointConnection]
'''
def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None:
'''
:keyword value: Array of private endpoint connections.
:paramtype value: list[~azure.mgmt.cosmosdb.models.PrivateEndpointConnection]
'''
pass
| 2 | 2 | 7 | 0 | 3 | 4 | 1 | 1.14 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 18 | 3 | 7 | 4 | 5 | 8 | 5 | 4 | 3 | 1 | 2 | 0 | 1 |
10,615 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.PrivateEndpointProperty
|
class PrivateEndpointProperty(_serialization.Model):
"""Private endpoint which the connection belongs to.
:ivar id: Resource id of the private endpoint.
:vartype id: str
"""
_attribute_map = {
"id": {"key": "id", "type": "str"},
}
def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin
"""
:keyword id: Resource id of the private endpoint.
:paramtype id: str
"""
super().__init__(**kwargs)
self.id = id
|
class PrivateEndpointProperty(_serialization.Model):
'''Private endpoint which the connection belongs to.
:ivar id: Resource id of the private endpoint.
:vartype id: str
'''
def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None:
'''
:keyword id: Resource id of the private endpoint.
:paramtype id: str
'''
pass
| 2 | 2 | 7 | 0 | 3 | 5 | 1 | 1.29 | 1 | 3 | 0 | 0 | 1 | 1 | 1 | 16 | 18 | 3 | 7 | 4 | 5 | 9 | 5 | 4 | 3 | 1 | 2 | 0 | 1 |
10,616 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.PrivateLinkResource
|
class PrivateLinkResource(ARMProxyResource):
"""A private link resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the database account.
:vartype id: str
:ivar name: The name of the database account.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar group_id: The private link resource group id.
:vartype group_id: str
:ivar required_members: The private link resource required member names.
:vartype required_members: list[str]
:ivar required_zone_names: The private link resource required zone names.
:vartype required_zone_names: list[str]
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"group_id": {"readonly": True},
"required_members": {"readonly": True},
"required_zone_names": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"group_id": {"key": "properties.groupId", "type": "str"},
"required_members": {"key": "properties.requiredMembers", "type": "[str]"},
"required_zone_names": {"key": "properties.requiredZoneNames", "type": "[str]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.group_id = None
self.required_members = None
self.required_zone_names = None
|
class PrivateLinkResource(ARMProxyResource):
'''A private link resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the database account.
:vartype id: str
:ivar name: The name of the database account.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar group_id: The private link resource group id.
:vartype group_id: str
:ivar required_members: The private link resource required member names.
:vartype required_members: list[str]
:ivar required_zone_names: The private link resource required zone names.
:vartype required_zone_names: list[str]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 6 | 0 | 5 | 1 | 1 | 0.73 | 1 | 2 | 0 | 0 | 1 | 3 | 1 | 17 | 43 | 5 | 22 | 7 | 20 | 16 | 8 | 7 | 6 | 1 | 3 | 0 | 1 |
10,617 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.PrivateLinkResourceListResult
|
class PrivateLinkResourceListResult(_serialization.Model):
"""A list of private link resources.
:ivar value: Array of private link resources.
:vartype value: list[~azure.mgmt.cosmosdb.models.PrivateLinkResource]
"""
_attribute_map = {
"value": {"key": "value", "type": "[PrivateLinkResource]"},
}
def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = None, **kwargs: Any) -> None:
"""
:keyword value: Array of private link resources.
:paramtype value: list[~azure.mgmt.cosmosdb.models.PrivateLinkResource]
"""
super().__init__(**kwargs)
self.value = value
|
class PrivateLinkResourceListResult(_serialization.Model):
'''A list of private link resources.
:ivar value: Array of private link resources.
:vartype value: list[~azure.mgmt.cosmosdb.models.PrivateLinkResource]
'''
def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = None, **kwargs: Any) -> None:
'''
:keyword value: Array of private link resources.
:paramtype value: list[~azure.mgmt.cosmosdb.models.PrivateLinkResource]
'''
pass
| 2 | 2 | 7 | 0 | 3 | 4 | 1 | 1.14 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 18 | 3 | 7 | 4 | 5 | 8 | 5 | 4 | 3 | 1 | 2 | 0 | 1 |
10,618 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.PrivateLinkServiceConnectionStateProperty
|
class PrivateLinkServiceConnectionStateProperty(_serialization.Model): # pylint: disable=name-too-long
"""Connection State of the Private Endpoint Connection.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar status: The private link service connection status.
:vartype status: str
:ivar description: The private link service connection description.
:vartype description: str
:ivar actions_required: Any action that is required beyond basic workflow (approve/ reject/
disconnect).
:vartype actions_required: str
"""
_validation = {
"actions_required": {"readonly": True},
}
_attribute_map = {
"status": {"key": "status", "type": "str"},
"description": {"key": "description", "type": "str"},
"actions_required": {"key": "actionsRequired", "type": "str"},
}
def __init__(self, *, status: Optional[str] = None, description: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword status: The private link service connection status.
:paramtype status: str
:keyword description: The private link service connection description.
:paramtype description: str
"""
super().__init__(**kwargs)
self.status = status
self.description = description
self.actions_required = None
|
class PrivateLinkServiceConnectionStateProperty(_serialization.Model):
'''Connection State of the Private Endpoint Connection.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar status: The private link service connection status.
:vartype status: str
:ivar description: The private link service connection description.
:vartype description: str
:ivar actions_required: Any action that is required beyond basic workflow (approve/ reject/
disconnect).
:vartype actions_required: str
'''
def __init__(self, *, status: Optional[str] = None, description: Optional[str] = None, **kwargs: Any) -> None:
'''
:keyword status: The private link service connection status.
:paramtype status: str
:keyword description: The private link service connection description.
:paramtype description: str
'''
pass
| 2 | 2 | 11 | 0 | 5 | 6 | 1 | 1.21 | 1 | 3 | 0 | 0 | 1 | 3 | 1 | 16 | 35 | 5 | 14 | 7 | 12 | 17 | 8 | 7 | 6 | 1 | 2 | 0 | 1 |
10,619 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.Privilege
|
class Privilege(_serialization.Model):
"""The set of data plane operations permitted through this Role Definition.
:ivar resource: An Azure Cosmos DB Mongo DB Resource.
:vartype resource: ~azure.mgmt.cosmosdb.models.PrivilegeResource
:ivar actions: An array of actions that are allowed.
:vartype actions: list[str]
"""
_attribute_map = {
"resource": {"key": "resource", "type": "PrivilegeResource"},
"actions": {"key": "actions", "type": "[str]"},
}
def __init__(
self,
*,
resource: Optional["_models.PrivilegeResource"] = None,
actions: Optional[List[str]] = None,
**kwargs: Any
) -> None:
"""
:keyword resource: An Azure Cosmos DB Mongo DB Resource.
:paramtype resource: ~azure.mgmt.cosmosdb.models.PrivilegeResource
:keyword actions: An array of actions that are allowed.
:paramtype actions: list[str]
"""
super().__init__(**kwargs)
self.resource = resource
self.actions = actions
|
class Privilege(_serialization.Model):
'''The set of data plane operations permitted through this Role Definition.
:ivar resource: An Azure Cosmos DB Mongo DB Resource.
:vartype resource: ~azure.mgmt.cosmosdb.models.PrivilegeResource
:ivar actions: An array of actions that are allowed.
:vartype actions: list[str]
'''
def __init__(
self,
*,
resource: Optional["_models.PrivilegeResource"] = None,
actions: Optional[List[str]] = None,
**kwargs: Any
) -> None:
'''
:keyword resource: An Azure Cosmos DB Mongo DB Resource.
:paramtype resource: ~azure.mgmt.cosmosdb.models.PrivilegeResource
:keyword actions: An array of actions that are allowed.
:paramtype actions: list[str]
'''
pass
| 2 | 2 | 16 | 0 | 10 | 6 | 1 | 0.8 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 16 | 30 | 3 | 15 | 11 | 7 | 12 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,620 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.PrivilegeResource
|
class PrivilegeResource(_serialization.Model):
"""An Azure Cosmos DB Mongo DB Resource.
:ivar db: The database name the role is applied.
:vartype db: str
:ivar collection: The collection name the role is applied.
:vartype collection: str
"""
_attribute_map = {
"db": {"key": "db", "type": "str"},
"collection": {"key": "collection", "type": "str"},
}
def __init__(self, *, db: Optional[str] = None, collection: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword db: The database name the role is applied.
:paramtype db: str
:keyword collection: The collection name the role is applied.
:paramtype collection: str
"""
super().__init__(**kwargs)
self.db = db
self.collection = collection
|
class PrivilegeResource(_serialization.Model):
'''An Azure Cosmos DB Mongo DB Resource.
:ivar db: The database name the role is applied.
:vartype db: str
:ivar collection: The collection name the role is applied.
:vartype collection: str
'''
def __init__(self, *, db: Optional[str] = None, collection: Optional[str] = None, **kwargs: Any) -> None:
'''
:keyword db: The database name the role is applied.
:paramtype db: str
:keyword collection: The collection name the role is applied.
:paramtype collection: str
'''
pass
| 2 | 2 | 10 | 0 | 4 | 6 | 1 | 1.33 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 16 | 24 | 3 | 9 | 5 | 7 | 12 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,621 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ProvisioningIssue
|
class ProvisioningIssue(_serialization.Model):
"""Describes a provisioning issue for a network security perimeter configuration.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar name: Name of the issue.
:vartype name: str
:ivar properties: Details of a provisioning issue for a network security perimeter (NSP)
configuration. Resource providers should generate separate provisioning issue elements for each
separate issue detected, and include a meaningful and distinctive description, as well as any
appropriate suggestedResourceIds and suggestedAccessRules.
:vartype properties: ~azure.mgmt.cosmosdb.models.ProvisioningIssueProperties
"""
_validation = {
"name": {"readonly": True},
"properties": {"readonly": True},
}
_attribute_map = {
"name": {"key": "name", "type": "str"},
"properties": {"key": "properties", "type": "ProvisioningIssueProperties"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.name = None
self.properties = None
|
class ProvisioningIssue(_serialization.Model):
'''Describes a provisioning issue for a network security perimeter configuration.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar name: Name of the issue.
:vartype name: str
:ivar properties: Details of a provisioning issue for a network security perimeter (NSP)
configuration. Resource providers should generate separate provisioning issue elements for each
separate issue detected, and include a meaningful and distinctive description, as well as any
appropriate suggestedResourceIds and suggestedAccessRules.
:vartype properties: ~azure.mgmt.cosmosdb.models.ProvisioningIssueProperties
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 5 | 0 | 4 | 1 | 1 | 0.85 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 16 | 29 | 5 | 13 | 6 | 11 | 11 | 7 | 6 | 5 | 1 | 2 | 0 | 1 |
10,622 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ProxyResource
|
class ProxyResource(Resource):
"""The resource model definition for a Azure Resource Manager proxy resource. It will not have
tags and a location.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. E.g.
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData
"""
|
class ProxyResource(Resource):
'''The resource model definition for a Azure Resource Manager proxy resource. It will not have
tags and a location.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. E.g.
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData
'''
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 15 | 1 | 0 | 0 | 6 | 0 | 0 | 0 | 16 | 18 | 2 | 1 | 1 | 0 | 15 | 1 | 1 | 0 | 0 | 3 | 0 | 0 |
10,623 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableMongodbCollectionsListResult
|
class RestorableMongodbCollectionsListResult(_serialization.Model):
"""The List operation response, that contains the MongoDB collection events and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of MongoDB collection events and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableMongodbCollectionGetResult]
"""
_validation = {
"value": {"readonly": True},
}
_attribute_map = {
"value": {"key": "value", "type": "[RestorableMongodbCollectionGetResult]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.value = None
|
class RestorableMongodbCollectionsListResult(_serialization.Model):
'''The List operation response, that contains the MongoDB collection events and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of MongoDB collection events and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableMongodbCollectionGetResult]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 4 | 0 | 3 | 1 | 1 | 0.6 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 21 | 5 | 10 | 5 | 8 | 6 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,624 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableMongodbDatabaseGetResult
|
class RestorableMongodbDatabaseGetResult(_serialization.Model):
"""An Azure Cosmos DB MongoDB database event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource Identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar resource: The resource of an Azure Cosmos DB MongoDB database event.
:vartype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbDatabasePropertiesResource
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"resource": {"key": "properties.resource", "type": "RestorableMongodbDatabasePropertiesResource"},
}
def __init__(
self, *, resource: Optional["_models.RestorableMongodbDatabasePropertiesResource"] = None, **kwargs: Any
) -> None:
"""
:keyword resource: The resource of an Azure Cosmos DB MongoDB database event.
:paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbDatabasePropertiesResource
"""
super().__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.resource = resource
|
class RestorableMongodbDatabaseGetResult(_serialization.Model):
'''An Azure Cosmos DB MongoDB database event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource Identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar resource: The resource of an Azure Cosmos DB MongoDB database event.
:vartype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbDatabasePropertiesResource
'''
def __init__(
self, *, resource: Optional["_models.RestorableMongodbDatabasePropertiesResource"] = None, **kwargs: Any
) -> None:
'''
:keyword resource: The resource of an Azure Cosmos DB MongoDB database event.
:paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbDatabasePropertiesResource
'''
pass
| 2 | 2 | 12 | 0 | 8 | 4 | 1 | 0.75 | 1 | 2 | 0 | 0 | 1 | 4 | 1 | 16 | 40 | 5 | 20 | 10 | 16 | 15 | 9 | 8 | 7 | 1 | 2 | 0 | 1 |
10,625 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableMongodbDatabasePropertiesResource
|
class RestorableMongodbDatabasePropertiesResource(_serialization.Model): # pylint: disable=name-too-long
"""The resource of an Azure Cosmos DB MongoDB database event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar operation_type: The operation type of this database event. Known values are: "Create",
"Replace", "Delete", "Recreate", and "SystemOperation".
:vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType
:ivar can_undelete: A state of this database to identify if this database is restorable in same
account.
:vartype can_undelete: str
:ivar can_undelete_reason: The reason why this database can not be restored in same account.
:vartype can_undelete_reason: str
:ivar event_timestamp: The time when this database event happened.
:vartype event_timestamp: str
:ivar owner_id: The name of this MongoDB database.
:vartype owner_id: str
:ivar owner_resource_id: The resource ID of this MongoDB database.
:vartype owner_resource_id: str
"""
_validation = {
"rid": {"readonly": True},
"operation_type": {"readonly": True},
"can_undelete": {"readonly": True},
"can_undelete_reason": {"readonly": True},
"event_timestamp": {"readonly": True},
"owner_id": {"readonly": True},
"owner_resource_id": {"readonly": True},
}
_attribute_map = {
"rid": {"key": "_rid", "type": "str"},
"operation_type": {"key": "operationType", "type": "str"},
"can_undelete": {"key": "canUndelete", "type": "str"},
"can_undelete_reason": {"key": "canUndeleteReason", "type": "str"},
"event_timestamp": {"key": "eventTimestamp", "type": "str"},
"owner_id": {"key": "ownerId", "type": "str"},
"owner_resource_id": {"key": "ownerResourceId", "type": "str"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.rid = None
self.operation_type = None
self.can_undelete = None
self.can_undelete_reason = None
self.event_timestamp = None
self.owner_id = None
self.owner_resource_id = None
|
class RestorableMongodbDatabasePropertiesResource(_serialization.Model):
'''The resource of an Azure Cosmos DB MongoDB database event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar operation_type: The operation type of this database event. Known values are: "Create",
"Replace", "Delete", "Recreate", and "SystemOperation".
:vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType
:ivar can_undelete: A state of this database to identify if this database is restorable in same
account.
:vartype can_undelete: str
:ivar can_undelete_reason: The reason why this database can not be restored in same account.
:vartype can_undelete_reason: str
:ivar event_timestamp: The time when this database event happened.
:vartype event_timestamp: str
:ivar owner_id: The name of this MongoDB database.
:vartype owner_id: str
:ivar owner_resource_id: The resource ID of this MongoDB database.
:vartype owner_resource_id: str
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 10 | 0 | 9 | 1 | 1 | 0.75 | 1 | 2 | 0 | 0 | 1 | 7 | 1 | 16 | 53 | 5 | 28 | 11 | 26 | 21 | 12 | 11 | 10 | 1 | 2 | 0 | 1 |
10,626 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.Role
|
class Role(_serialization.Model):
"""The set of roles permitted through this Role Definition.
:ivar db: The database name the role is applied.
:vartype db: str
:ivar role: The role name.
:vartype role: str
"""
_attribute_map = {
"db": {"key": "db", "type": "str"},
"role": {"key": "role", "type": "str"},
}
def __init__(self, *, db: Optional[str] = None, role: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword db: The database name the role is applied.
:paramtype db: str
:keyword role: The role name.
:paramtype role: str
"""
super().__init__(**kwargs)
self.db = db
self.role = role
|
class Role(_serialization.Model):
'''The set of roles permitted through this Role Definition.
:ivar db: The database name the role is applied.
:vartype db: str
:ivar role: The role name.
:vartype role: str
'''
def __init__(self, *, db: Optional[str] = None, role: Optional[str] = None, **kwargs: Any) -> None:
'''
:keyword db: The database name the role is applied.
:paramtype db: str
:keyword role: The role name.
:paramtype role: str
'''
pass
| 2 | 2 | 10 | 0 | 4 | 6 | 1 | 1.33 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 16 | 24 | 3 | 9 | 5 | 7 | 12 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,627 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.SeedNode
|
class SeedNode(_serialization.Model):
"""SeedNode.
:ivar ip_address: IP address of this seed node.
:vartype ip_address: str
"""
_attribute_map = {
"ip_address": {"key": "ipAddress", "type": "str"},
}
def __init__(self, *, ip_address: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword ip_address: IP address of this seed node.
:paramtype ip_address: str
"""
super().__init__(**kwargs)
self.ip_address = ip_address
|
class SeedNode(_serialization.Model):
'''SeedNode.
:ivar ip_address: IP address of this seed node.
:vartype ip_address: str
'''
def __init__(self, *, ip_address: Optional[str] = None, **kwargs: Any) -> None:
'''
:keyword ip_address: IP address of this seed node.
:paramtype ip_address: str
'''
pass
| 2 | 2 | 7 | 0 | 3 | 4 | 1 | 1.14 | 1 | 3 | 0 | 0 | 1 | 1 | 1 | 16 | 18 | 3 | 7 | 4 | 5 | 8 | 5 | 4 | 3 | 1 | 2 | 0 | 1 |
10,628 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ServiceResource
|
class ServiceResource(ARMProxyResource):
"""Properties for the database account.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the database account.
:vartype id: str
:ivar name: The name of the database account.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar properties: Services response resource.
:vartype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceProperties
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"properties": {"key": "properties", "type": "ServiceResourceProperties"},
}
def __init__(self, *, properties: Optional["_models.ServiceResourceProperties"] = None, **kwargs: Any) -> None:
"""
:keyword properties: Services response resource.
:paramtype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceProperties
"""
super().__init__(**kwargs)
self.properties = properties
|
class ServiceResource(ARMProxyResource):
'''Properties for the database account.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the database account.
:vartype id: str
:ivar name: The name of the database account.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar properties: Services response resource.
:vartype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceProperties
'''
def __init__(self, *, properties: Optional["_models.ServiceResourceProperties"] = None, **kwargs: Any) -> None:
'''
:keyword properties: Services response resource.
:paramtype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceProperties
'''
pass
| 2 | 2 | 7 | 0 | 3 | 4 | 1 | 1 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 17 | 35 | 5 | 15 | 5 | 13 | 15 | 6 | 5 | 4 | 1 | 3 | 0 | 1 |
10,629 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ServiceResourceCreateUpdateParameters
|
class ServiceResourceCreateUpdateParameters(_serialization.Model):
"""Parameters for Create or Update request for ServiceResource.
:ivar properties: Properties in ServiceResourceCreateUpdateParameters.
:vartype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceCreateUpdateProperties
"""
_attribute_map = {
"properties": {"key": "properties", "type": "ServiceResourceCreateUpdateProperties"},
}
def __init__(
self, *, properties: Optional["_models.ServiceResourceCreateUpdateProperties"] = None, **kwargs: Any
) -> None:
"""
:keyword properties: Properties in ServiceResourceCreateUpdateParameters.
:paramtype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceCreateUpdateProperties
"""
super().__init__(**kwargs)
self.properties = properties
|
class ServiceResourceCreateUpdateParameters(_serialization.Model):
'''Parameters for Create or Update request for ServiceResource.
:ivar properties: Properties in ServiceResourceCreateUpdateParameters.
:vartype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceCreateUpdateProperties
'''
def __init__(
self, *, properties: Optional["_models.ServiceResourceCreateUpdateProperties"] = None, **kwargs: Any
) -> None:
'''
:keyword properties: Properties in ServiceResourceCreateUpdateParameters.
:paramtype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceCreateUpdateProperties
'''
pass
| 2 | 2 | 9 | 0 | 5 | 4 | 1 | 0.89 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 20 | 3 | 9 | 6 | 5 | 8 | 5 | 4 | 3 | 1 | 2 | 0 | 1 |
10,630 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ServiceResourceCreateUpdateProperties
|
class ServiceResourceCreateUpdateProperties(_serialization.Model):
"""Properties in ServiceResourceCreateUpdateParameters.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
DataTransferServiceResourceCreateUpdateProperties,
GraphAPIComputeServiceResourceCreateUpdateProperties,
MaterializedViewsBuilderServiceResourceCreateUpdateProperties,
SqlDedicatedGatewayServiceResourceCreateUpdateProperties
All required parameters must be populated in order to send to server.
:ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s",
"Cosmos.D8s", and "Cosmos.D16s".
:vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize
:ivar instance_count: Instance count for the service.
:vartype instance_count: int
:ivar service_type: ServiceType for the service. Required. Known values are:
"SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder".
:vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType
"""
_validation = {
"instance_count": {"minimum": 0},
"service_type": {"required": True},
}
_attribute_map = {
"instance_size": {"key": "instanceSize", "type": "str"},
"instance_count": {"key": "instanceCount", "type": "int"},
"service_type": {"key": "serviceType", "type": "str"},
}
_subtype_map = {
"service_type": {
"DataTransfer": "DataTransferServiceResourceCreateUpdateProperties",
"GraphAPICompute": "GraphAPIComputeServiceResourceCreateUpdateProperties",
"MaterializedViewsBuilder": "MaterializedViewsBuilderServiceResourceCreateUpdateProperties",
"SqlDedicatedGateway": "SqlDedicatedGatewayServiceResourceCreateUpdateProperties",
}
}
def __init__(
self,
*,
instance_size: Optional[Union[str, "_models.ServiceSize"]] = None,
instance_count: Optional[int] = None,
**kwargs: Any
) -> None:
"""
:keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s",
"Cosmos.D8s", and "Cosmos.D16s".
:paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize
:keyword instance_count: Instance count for the service.
:paramtype instance_count: int
"""
super().__init__(**kwargs)
self.instance_size = instance_size
self.instance_count = instance_count
self.service_type: Optional[str] = None
|
class ServiceResourceCreateUpdateProperties(_serialization.Model):
'''Properties in ServiceResourceCreateUpdateParameters.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
DataTransferServiceResourceCreateUpdateProperties,
GraphAPIComputeServiceResourceCreateUpdateProperties,
MaterializedViewsBuilderServiceResourceCreateUpdateProperties,
SqlDedicatedGatewayServiceResourceCreateUpdateProperties
All required parameters must be populated in order to send to server.
:ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s",
"Cosmos.D8s", and "Cosmos.D16s".
:vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize
:ivar instance_count: Instance count for the service.
:vartype instance_count: int
:ivar service_type: ServiceType for the service. Required. Known values are:
"SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder".
:vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType
'''
def __init__(
self,
*,
instance_size: Optional[Union[str, "_models.ServiceSize"]] = None,
instance_count: Optional[int] = None,
**kwargs: Any
) -> None:
'''
:keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s",
"Cosmos.D8s", and "Cosmos.D16s".
:paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize
:keyword instance_count: Instance count for the service.
:paramtype instance_count: int
'''
pass
| 2 | 2 | 18 | 0 | 11 | 7 | 1 | 0.79 | 1 | 4 | 0 | 4 | 1 | 3 | 1 | 16 | 59 | 7 | 29 | 14 | 21 | 23 | 9 | 8 | 7 | 1 | 2 | 0 | 1 |
10,631 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ServiceResourceListResult
|
class ServiceResourceListResult(_serialization.Model):
"""The List operation response, that contains the Service Resource and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of Service Resource and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.ServiceResource]
"""
_validation = {
"value": {"readonly": True},
}
_attribute_map = {
"value": {"key": "value", "type": "[ServiceResource]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.value = None
|
class ServiceResourceListResult(_serialization.Model):
'''The List operation response, that contains the Service Resource and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of Service Resource and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.ServiceResource]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 4 | 0 | 3 | 1 | 1 | 0.6 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 21 | 5 | 10 | 5 | 8 | 6 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,632 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ServiceResourceProperties
|
class ServiceResourceProperties(_serialization.Model):
"""Services response resource.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
DataTransferServiceResourceProperties, GraphAPIComputeServiceResourceProperties,
MaterializedViewsBuilderServiceResourceProperties, SqlDedicatedGatewayServiceResourceProperties
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 server.
:ivar additional_properties: Unmatched properties from the message are deserialized to this
collection.
:vartype additional_properties: dict[str, any]
:ivar creation_time: Time of the last state change (ISO-8601 format).
:vartype creation_time: ~datetime.datetime
:ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s",
"Cosmos.D8s", and "Cosmos.D16s".
:vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize
:ivar instance_count: Instance count for the service.
:vartype instance_count: int
:ivar service_type: ServiceType for the service. Required. Known values are:
"SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder".
:vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType
:ivar status: Describes the status of a service. Known values are: "Creating", "Running",
"Updating", "Deleting", "Error", and "Stopped".
:vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus
"""
_validation = {
"creation_time": {"readonly": True},
"instance_count": {"minimum": 0},
"service_type": {"required": True},
"status": {"readonly": True},
}
_attribute_map = {
"additional_properties": {"key": "", "type": "{object}"},
"creation_time": {"key": "creationTime", "type": "iso-8601"},
"instance_size": {"key": "instanceSize", "type": "str"},
"instance_count": {"key": "instanceCount", "type": "int"},
"service_type": {"key": "serviceType", "type": "str"},
"status": {"key": "status", "type": "str"},
}
_subtype_map = {
"service_type": {
"DataTransfer": "DataTransferServiceResourceProperties",
"GraphAPICompute": "GraphAPIComputeServiceResourceProperties",
"MaterializedViewsBuilder": "MaterializedViewsBuilderServiceResourceProperties",
"SqlDedicatedGateway": "SqlDedicatedGatewayServiceResourceProperties",
}
}
def __init__(
self,
*,
additional_properties: Optional[Dict[str, Any]] = None,
instance_size: Optional[Union[str, "_models.ServiceSize"]] = None,
instance_count: Optional[int] = None,
**kwargs: Any
) -> None:
"""
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, any]
:keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s",
"Cosmos.D8s", and "Cosmos.D16s".
:paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize
:keyword instance_count: Instance count for the service.
:paramtype instance_count: int
"""
super().__init__(**kwargs)
self.additional_properties = additional_properties
self.creation_time = None
self.instance_size = instance_size
self.instance_count = instance_count
self.service_type: Optional[str] = None
self.status = None
|
class ServiceResourceProperties(_serialization.Model):
'''Services response resource.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
DataTransferServiceResourceProperties, GraphAPIComputeServiceResourceProperties,
MaterializedViewsBuilderServiceResourceProperties, SqlDedicatedGatewayServiceResourceProperties
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 server.
:ivar additional_properties: Unmatched properties from the message are deserialized to this
collection.
:vartype additional_properties: dict[str, any]
:ivar creation_time: Time of the last state change (ISO-8601 format).
:vartype creation_time: ~datetime.datetime
:ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s",
"Cosmos.D8s", and "Cosmos.D16s".
:vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize
:ivar instance_count: Instance count for the service.
:vartype instance_count: int
:ivar service_type: ServiceType for the service. Required. Known values are:
"SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder".
:vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType
:ivar status: Describes the status of a service. Known values are: "Creating", "Running",
"Updating", "Deleting", "Error", and "Stopped".
:vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus
'''
def __init__(
self,
*,
additional_properties: Optional[Dict[str, Any]] = None,
instance_size: Optional[Union[str, "_models.ServiceSize"]] = None,
instance_count: Optional[int] = None,
**kwargs: Any
) -> None:
'''
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, any]
:keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s",
"Cosmos.D8s", and "Cosmos.D16s".
:paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize
:keyword instance_count: Instance count for the service.
:paramtype instance_count: int
'''
pass
| 2 | 2 | 25 | 0 | 15 | 10 | 1 | 0.87 | 1 | 4 | 0 | 4 | 1 | 6 | 1 | 16 | 79 | 8 | 38 | 18 | 29 | 33 | 12 | 11 | 10 | 1 | 2 | 0 | 1 |
10,633 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.SpatialSpec
|
class SpatialSpec(_serialization.Model):
"""SpatialSpec.
:ivar path: The path for which the indexing behavior applies to. Index paths typically start
with root and end with wildcard (/path/*).
:vartype path: str
:ivar types: List of path's spatial type.
:vartype types: list[str or ~azure.mgmt.cosmosdb.models.SpatialType]
"""
_attribute_map = {
"path": {"key": "path", "type": "str"},
"types": {"key": "types", "type": "[str]"},
}
def __init__(
self,
*,
path: Optional[str] = None,
types: Optional[List[Union[str, "_models.SpatialType"]]] = None,
**kwargs: Any
) -> None:
"""
:keyword path: The path for which the indexing behavior applies to. Index paths typically start
with root and end with wildcard (/path/*).
:paramtype path: str
:keyword types: List of path's spatial type.
:paramtype types: list[str or ~azure.mgmt.cosmosdb.models.SpatialType]
"""
super().__init__(**kwargs)
self.path = path
self.types = types
|
class SpatialSpec(_serialization.Model):
'''SpatialSpec.
:ivar path: The path for which the indexing behavior applies to. Index paths typically start
with root and end with wildcard (/path/*).
:vartype path: str
:ivar types: List of path's spatial type.
:vartype types: list[str or ~azure.mgmt.cosmosdb.models.SpatialType]
'''
def __init__(
self,
*,
path: Optional[str] = None,
types: Optional[List[Union[str, "_models.SpatialType"]]] = None,
**kwargs: Any
) -> None:
'''
:keyword path: The path for which the indexing behavior applies to. Index paths typically start
with root and end with wildcard (/path/*).
:paramtype path: str
:keyword types: List of path's spatial type.
:paramtype types: list[str or ~azure.mgmt.cosmosdb.models.SpatialType]
'''
pass
| 2 | 2 | 17 | 0 | 10 | 7 | 1 | 0.93 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 16 | 32 | 3 | 15 | 11 | 7 | 14 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,634 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.SqlContainerCreateUpdateParameters
|
class SqlContainerCreateUpdateParameters(ARMResourceProperties):
"""Parameters to create and update Cosmos DB container.
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 server.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar location: The location of the resource group to which the resource belongs.
:vartype location: str
:ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:vartype tags: dict[str, str]
:ivar identity: Identity for the resource.
:vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:ivar resource: The standard JSON format of a container. Required.
:vartype resource: ~azure.mgmt.cosmosdb.models.SqlContainerResource
:ivar options: A key-value pair of options to be applied for the request. This corresponds to
the headers sent with the request.
:vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"resource": {"required": 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}"},
"identity": {"key": "identity", "type": "ManagedServiceIdentity"},
"resource": {"key": "properties.resource", "type": "SqlContainerResource"},
"options": {"key": "properties.options", "type": "CreateUpdateOptions"},
}
def __init__(
self,
*,
resource: "_models.SqlContainerResource",
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
identity: Optional["_models.ManagedServiceIdentity"] = None,
options: Optional["_models.CreateUpdateOptions"] = None,
**kwargs: Any
) -> None:
"""
:keyword location: The location of the resource group to which the resource belongs.
:paramtype location: str
:keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:paramtype tags: dict[str, str]
:keyword identity: Identity for the resource.
:paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:keyword resource: The standard JSON format of a container. Required.
:paramtype resource: ~azure.mgmt.cosmosdb.models.SqlContainerResource
:keyword options: A key-value pair of options to be applied for the request. This corresponds
to the headers sent with the request.
:paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions
"""
super().__init__(location=location, tags=tags, identity=identity, **kwargs)
self.resource = resource
self.options = options
|
class SqlContainerCreateUpdateParameters(ARMResourceProperties):
'''Parameters to create and update Cosmos DB container.
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 server.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar location: The location of the resource group to which the resource belongs.
:vartype location: str
:ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:vartype tags: dict[str, str]
:ivar identity: Identity for the resource.
:vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:ivar resource: The standard JSON format of a container. Required.
:vartype resource: ~azure.mgmt.cosmosdb.models.SqlContainerResource
:ivar options: A key-value pair of options to be applied for the request. This corresponds to
the headers sent with the request.
:vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions
'''
def __init__(
self,
*,
resource: "_models.SqlContainerResource",
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
identity: Optional["_models.ManagedServiceIdentity"] = None,
options: Optional["_models.CreateUpdateOptions"] = None,
**kwargs: Any
) -> None:
'''
:keyword location: The location of the resource group to which the resource belongs.
:paramtype location: str
:keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:paramtype tags: dict[str, str]
:keyword identity: Identity for the resource.
:paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:keyword resource: The standard JSON format of a container. Required.
:paramtype resource: ~azure.mgmt.cosmosdb.models.SqlContainerResource
:keyword options: A key-value pair of options to be applied for the request. This corresponds
to the headers sent with the request.
:paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions
'''
pass
| 2 | 2 | 31 | 0 | 13 | 18 | 1 | 1.47 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 17 | 80 | 6 | 30 | 15 | 19 | 44 | 7 | 6 | 5 | 1 | 3 | 0 | 1 |
10,635 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.SqlContainerGetPropertiesOptions
|
class SqlContainerGetPropertiesOptions(OptionsResource):
"""SqlContainerGetPropertiesOptions.
:ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the
ThroughputSetting resource when retrieving offer details.
:vartype throughput: int
:ivar autoscale_settings: Specifies the Autoscale settings.
:vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings
"""
|
class SqlContainerGetPropertiesOptions(OptionsResource):
'''SqlContainerGetPropertiesOptions.
:ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the
ThroughputSetting resource when retrieving offer details.
:vartype throughput: int
:ivar autoscale_settings: Specifies the Autoscale settings.
:vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 7 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 9 | 1 | 1 | 1 | 0 | 7 | 1 | 1 | 0 | 0 | 3 | 0 | 0 |
10,636 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.SqlContainerGetPropertiesResource
|
class SqlContainerGetPropertiesResource(SqlContainerResource, ExtendedResourceProperties):
"""SqlContainerGetPropertiesResource.
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 server.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar ts: A system generated property that denotes the last updated timestamp of the resource.
:vartype ts: float
:ivar etag: A system generated property representing the resource etag required for optimistic
concurrency control.
:vartype etag: str
:ivar id: Name of the Cosmos DB SQL container. Required.
:vartype id: str
:ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is
automatic for all document paths within the container.
:vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy
:ivar partition_key: The configuration of the partition key to be used for partitioning data
into multiple partitions.
:vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey
:ivar default_ttl: Default time to live.
:vartype default_ttl: int
:ivar unique_key_policy: The unique key policy configuration for specifying uniqueness
constraints on documents in the collection in the Azure Cosmos DB service.
:vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy
:ivar conflict_resolution_policy: The conflict resolution policy for the container.
:vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy
:ivar client_encryption_policy: The client encryption policy for the container.
:vartype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy
:ivar analytical_storage_ttl: Analytical TTL.
:vartype analytical_storage_ttl: int
:ivar restore_parameters: Parameters to indicate the information about the restore.
:vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default"
and "Restore".
:vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:ivar materialized_view_definition: The configuration for defining Materialized Views. This
must be specified only for creating a Materialized View container.
:vartype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition
:ivar computed_properties: List of computed properties.
:vartype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty]
:ivar vector_embedding_policy: The vector embedding policy for the container.
:vartype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy
"""
_validation = {
"rid": {"readonly": True},
"ts": {"readonly": True},
"etag": {"readonly": True},
"id": {"required": True},
}
_attribute_map = {
"rid": {"key": "_rid", "type": "str"},
"ts": {"key": "_ts", "type": "float"},
"etag": {"key": "_etag", "type": "str"},
"id": {"key": "id", "type": "str"},
"indexing_policy": {"key": "indexingPolicy", "type": "IndexingPolicy"},
"partition_key": {"key": "partitionKey", "type": "ContainerPartitionKey"},
"default_ttl": {"key": "defaultTtl", "type": "int"},
"unique_key_policy": {"key": "uniqueKeyPolicy", "type": "UniqueKeyPolicy"},
"conflict_resolution_policy": {"key": "conflictResolutionPolicy", "type": "ConflictResolutionPolicy"},
"client_encryption_policy": {"key": "clientEncryptionPolicy", "type": "ClientEncryptionPolicy"},
"analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"},
"restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"},
"create_mode": {"key": "createMode", "type": "str"},
"materialized_view_definition": {"key": "materializedViewDefinition", "type": "MaterializedViewDefinition"},
"computed_properties": {"key": "computedProperties", "type": "[ComputedProperty]"},
"vector_embedding_policy": {"key": "vectorEmbeddingPolicy", "type": "VectorEmbeddingPolicy"},
}
def __init__(
self,
*,
id: str, # pylint: disable=redefined-builtin
indexing_policy: Optional["_models.IndexingPolicy"] = None,
partition_key: Optional["_models.ContainerPartitionKey"] = None,
default_ttl: Optional[int] = None,
unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None,
conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None,
client_encryption_policy: Optional["_models.ClientEncryptionPolicy"] = None,
analytical_storage_ttl: Optional[int] = None,
restore_parameters: Optional["_models.ResourceRestoreParameters"] = None,
create_mode: Union[str, "_models.CreateMode"] = "Default",
materialized_view_definition: Optional["_models.MaterializedViewDefinition"] = None,
computed_properties: Optional[List["_models.ComputedProperty"]] = None,
vector_embedding_policy: Optional["_models.VectorEmbeddingPolicy"] = None,
**kwargs: Any
) -> None:
"""
:keyword id: Name of the Cosmos DB SQL container. Required.
:paramtype id: str
:keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is
automatic for all document paths within the container.
:paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy
:keyword partition_key: The configuration of the partition key to be used for partitioning data
into multiple partitions.
:paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey
:keyword default_ttl: Default time to live.
:paramtype default_ttl: int
:keyword unique_key_policy: The unique key policy configuration for specifying uniqueness
constraints on documents in the collection in the Azure Cosmos DB service.
:paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy
:keyword conflict_resolution_policy: The conflict resolution policy for the container.
:paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy
:keyword client_encryption_policy: The client encryption policy for the container.
:paramtype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy
:keyword analytical_storage_ttl: Analytical TTL.
:paramtype analytical_storage_ttl: int
:keyword restore_parameters: Parameters to indicate the information about the restore.
:paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:keyword create_mode: Enum to indicate the mode of resource creation. Known values are:
"Default" and "Restore".
:paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:keyword materialized_view_definition: The configuration for defining Materialized Views. This
must be specified only for creating a Materialized View container.
:paramtype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition
:keyword computed_properties: List of computed properties.
:paramtype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty]
:keyword vector_embedding_policy: The vector embedding policy for the container.
:paramtype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy
"""
super().__init__(
id=id,
indexing_policy=indexing_policy,
partition_key=partition_key,
default_ttl=default_ttl,
unique_key_policy=unique_key_policy,
conflict_resolution_policy=conflict_resolution_policy,
client_encryption_policy=client_encryption_policy,
analytical_storage_ttl=analytical_storage_ttl,
restore_parameters=restore_parameters,
create_mode=create_mode,
materialized_view_definition=materialized_view_definition,
computed_properties=computed_properties,
vector_embedding_policy=vector_embedding_policy,
**kwargs
)
self.rid = None
self.ts = None
self.etag = None
self.id = id
self.indexing_policy = indexing_policy
self.partition_key = partition_key
self.default_ttl = default_ttl
self.unique_key_policy = unique_key_policy
self.conflict_resolution_policy = conflict_resolution_policy
self.client_encryption_policy = client_encryption_policy
self.analytical_storage_ttl = analytical_storage_ttl
self.restore_parameters = restore_parameters
self.create_mode = create_mode
self.materialized_view_definition = materialized_view_definition
self.computed_properties = computed_properties
self.vector_embedding_policy = vector_embedding_policy
|
class SqlContainerGetPropertiesResource(SqlContainerResource, ExtendedResourceProperties):
'''SqlContainerGetPropertiesResource.
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 server.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar ts: A system generated property that denotes the last updated timestamp of the resource.
:vartype ts: float
:ivar etag: A system generated property representing the resource etag required for optimistic
concurrency control.
:vartype etag: str
:ivar id: Name of the Cosmos DB SQL container. Required.
:vartype id: str
:ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is
automatic for all document paths within the container.
:vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy
:ivar partition_key: The configuration of the partition key to be used for partitioning data
into multiple partitions.
:vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey
:ivar default_ttl: Default time to live.
:vartype default_ttl: int
:ivar unique_key_policy: The unique key policy configuration for specifying uniqueness
constraints on documents in the collection in the Azure Cosmos DB service.
:vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy
:ivar conflict_resolution_policy: The conflict resolution policy for the container.
:vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy
:ivar client_encryption_policy: The client encryption policy for the container.
:vartype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy
:ivar analytical_storage_ttl: Analytical TTL.
:vartype analytical_storage_ttl: int
:ivar restore_parameters: Parameters to indicate the information about the restore.
:vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default"
and "Restore".
:vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:ivar materialized_view_definition: The configuration for defining Materialized Views. This
must be specified only for creating a Materialized View container.
:vartype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition
:ivar computed_properties: List of computed properties.
:vartype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty]
:ivar vector_embedding_policy: The vector embedding policy for the container.
:vartype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy
'''
def __init__(
self,
*,
id: str, # pylint: disable=redefined-builtin
indexing_policy: Optional["_models.IndexingPolicy"] = None,
partition_key: Optional["_models.ContainerPartitionKey"] = None,
default_ttl: Optional[int] = None,
unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None,
conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None,
client_encryption_policy: Optional["_models.ClientEncryptionPolicy"] = None,
analytical_storage_ttl: Optional[int] = None,
restore_parameters: Optional["_models.ResourceRestoreParameters"] = None,
create_mode: Union[str, "_models.CreateMode"] = "Default",
materialized_view_definition: Optional["_models.MaterializedViewDefinition"] = None,
computed_properties: Optional[List["_models.ComputedProperty"]] = None,
vector_embedding_policy: Optional["_models.VectorEmbeddingPolicy"] = None,
**kwargs: Any
) -> None:
'''
:keyword id: Name of the Cosmos DB SQL container. Required.
:paramtype id: str
:keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is
automatic for all document paths within the container.
:paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy
:keyword partition_key: The configuration of the partition key to be used for partitioning data
into multiple partitions.
:paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey
:keyword default_ttl: Default time to live.
:paramtype default_ttl: int
:keyword unique_key_policy: The unique key policy configuration for specifying uniqueness
constraints on documents in the collection in the Azure Cosmos DB service.
:paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy
:keyword conflict_resolution_policy: The conflict resolution policy for the container.
:paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy
:keyword client_encryption_policy: The client encryption policy for the container.
:paramtype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy
:keyword analytical_storage_ttl: Analytical TTL.
:paramtype analytical_storage_ttl: int
:keyword restore_parameters: Parameters to indicate the information about the restore.
:paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:keyword create_mode: Enum to indicate the mode of resource creation. Known values are:
"Default" and "Restore".
:paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:keyword materialized_view_definition: The configuration for defining Materialized Views. This
must be specified only for creating a Materialized View container.
:paramtype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition
:keyword computed_properties: List of computed properties.
:paramtype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty]
:keyword vector_embedding_policy: The vector embedding policy for the container.
:paramtype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy
'''
pass
| 2 | 2 | 83 | 0 | 50 | 34 | 1 | 1.01 | 2 | 4 | 0 | 0 | 1 | 16 | 1 | 18 | 156 | 6 | 75 | 37 | 56 | 76 | 21 | 20 | 19 | 1 | 3 | 0 | 1 |
10,637 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.SqlContainerGetResults
|
class SqlContainerGetResults(ARMResourceProperties):
"""An Azure Cosmos DB container.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar location: The location of the resource group to which the resource belongs.
:vartype location: str
:ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:vartype tags: dict[str, str]
:ivar identity: Identity for the resource.
:vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:ivar resource:
:vartype resource: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource
:ivar options:
:vartype options: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesOptions
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"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}"},
"identity": {"key": "identity", "type": "ManagedServiceIdentity"},
"resource": {"key": "properties.resource", "type": "SqlContainerGetPropertiesResource"},
"options": {"key": "properties.options", "type": "SqlContainerGetPropertiesOptions"},
}
def __init__(
self,
*,
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
identity: Optional["_models.ManagedServiceIdentity"] = None,
resource: Optional["_models.SqlContainerGetPropertiesResource"] = None,
options: Optional["_models.SqlContainerGetPropertiesOptions"] = None,
**kwargs: Any
) -> None:
"""
:keyword location: The location of the resource group to which the resource belongs.
:paramtype location: str
:keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:paramtype tags: dict[str, str]
:keyword identity: Identity for the resource.
:paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:keyword resource:
:paramtype resource: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource
:keyword options:
:paramtype options: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesOptions
"""
super().__init__(location=location, tags=tags, identity=identity, **kwargs)
self.resource = resource
self.options = options
|
class SqlContainerGetResults(ARMResourceProperties):
'''An Azure Cosmos DB container.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar location: The location of the resource group to which the resource belongs.
:vartype location: str
:ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:vartype tags: dict[str, str]
:ivar identity: Identity for the resource.
:vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:ivar resource:
:vartype resource: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource
:ivar options:
:vartype options: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesOptions
'''
def __init__(
self,
*,
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
identity: Optional["_models.ManagedServiceIdentity"] = None,
resource: Optional["_models.SqlContainerGetPropertiesResource"] = None,
options: Optional["_models.SqlContainerGetPropertiesOptions"] = None,
**kwargs: Any
) -> None:
'''
:keyword location: The location of the resource group to which the resource belongs.
:paramtype location: str
:keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:paramtype tags: dict[str, str]
:keyword identity: Identity for the resource.
:paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:keyword resource:
:paramtype resource: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource
:keyword options:
:paramtype options: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesOptions
'''
pass
| 2 | 2 | 30 | 0 | 13 | 17 | 1 | 1.41 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 17 | 75 | 5 | 29 | 15 | 18 | 41 | 7 | 6 | 5 | 1 | 3 | 0 | 1 |
10,638 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.SqlContainerListResult
|
class SqlContainerListResult(_serialization.Model):
"""The List operation response, that contains the containers and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of containers and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.SqlContainerGetResults]
"""
_validation = {
"value": {"readonly": True},
}
_attribute_map = {
"value": {"key": "value", "type": "[SqlContainerGetResults]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.value = None
|
class SqlContainerListResult(_serialization.Model):
'''The List operation response, that contains the containers and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of containers and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.SqlContainerGetResults]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 4 | 0 | 3 | 1 | 1 | 0.6 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 21 | 5 | 10 | 5 | 8 | 6 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,639 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.SqlContainerResource
|
class SqlContainerResource(_serialization.Model):
"""Cosmos DB SQL container resource object.
All required parameters must be populated in order to send to server.
:ivar id: Name of the Cosmos DB SQL container. Required.
:vartype id: str
:ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is
automatic for all document paths within the container.
:vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy
:ivar partition_key: The configuration of the partition key to be used for partitioning data
into multiple partitions.
:vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey
:ivar default_ttl: Default time to live.
:vartype default_ttl: int
:ivar unique_key_policy: The unique key policy configuration for specifying uniqueness
constraints on documents in the collection in the Azure Cosmos DB service.
:vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy
:ivar conflict_resolution_policy: The conflict resolution policy for the container.
:vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy
:ivar client_encryption_policy: The client encryption policy for the container.
:vartype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy
:ivar analytical_storage_ttl: Analytical TTL.
:vartype analytical_storage_ttl: int
:ivar restore_parameters: Parameters to indicate the information about the restore.
:vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default"
and "Restore".
:vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:ivar materialized_view_definition: The configuration for defining Materialized Views. This
must be specified only for creating a Materialized View container.
:vartype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition
:ivar computed_properties: List of computed properties.
:vartype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty]
:ivar vector_embedding_policy: The vector embedding policy for the container.
:vartype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy
"""
_validation = {
"id": {"required": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"indexing_policy": {"key": "indexingPolicy", "type": "IndexingPolicy"},
"partition_key": {"key": "partitionKey", "type": "ContainerPartitionKey"},
"default_ttl": {"key": "defaultTtl", "type": "int"},
"unique_key_policy": {"key": "uniqueKeyPolicy", "type": "UniqueKeyPolicy"},
"conflict_resolution_policy": {"key": "conflictResolutionPolicy", "type": "ConflictResolutionPolicy"},
"client_encryption_policy": {"key": "clientEncryptionPolicy", "type": "ClientEncryptionPolicy"},
"analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"},
"restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"},
"create_mode": {"key": "createMode", "type": "str"},
"materialized_view_definition": {"key": "materializedViewDefinition", "type": "MaterializedViewDefinition"},
"computed_properties": {"key": "computedProperties", "type": "[ComputedProperty]"},
"vector_embedding_policy": {"key": "vectorEmbeddingPolicy", "type": "VectorEmbeddingPolicy"},
}
def __init__(
self,
*,
id: str, # pylint: disable=redefined-builtin
indexing_policy: Optional["_models.IndexingPolicy"] = None,
partition_key: Optional["_models.ContainerPartitionKey"] = None,
default_ttl: Optional[int] = None,
unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None,
conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None,
client_encryption_policy: Optional["_models.ClientEncryptionPolicy"] = None,
analytical_storage_ttl: Optional[int] = None,
restore_parameters: Optional["_models.ResourceRestoreParameters"] = None,
create_mode: Union[str, "_models.CreateMode"] = "Default",
materialized_view_definition: Optional["_models.MaterializedViewDefinition"] = None,
computed_properties: Optional[List["_models.ComputedProperty"]] = None,
vector_embedding_policy: Optional["_models.VectorEmbeddingPolicy"] = None,
**kwargs: Any
) -> None:
"""
:keyword id: Name of the Cosmos DB SQL container. Required.
:paramtype id: str
:keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is
automatic for all document paths within the container.
:paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy
:keyword partition_key: The configuration of the partition key to be used for partitioning data
into multiple partitions.
:paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey
:keyword default_ttl: Default time to live.
:paramtype default_ttl: int
:keyword unique_key_policy: The unique key policy configuration for specifying uniqueness
constraints on documents in the collection in the Azure Cosmos DB service.
:paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy
:keyword conflict_resolution_policy: The conflict resolution policy for the container.
:paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy
:keyword client_encryption_policy: The client encryption policy for the container.
:paramtype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy
:keyword analytical_storage_ttl: Analytical TTL.
:paramtype analytical_storage_ttl: int
:keyword restore_parameters: Parameters to indicate the information about the restore.
:paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:keyword create_mode: Enum to indicate the mode of resource creation. Known values are:
"Default" and "Restore".
:paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:keyword materialized_view_definition: The configuration for defining Materialized Views. This
must be specified only for creating a Materialized View container.
:paramtype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition
:keyword computed_properties: List of computed properties.
:paramtype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty]
:keyword vector_embedding_policy: The vector embedding policy for the container.
:paramtype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy
"""
super().__init__(**kwargs)
self.id = id
self.indexing_policy = indexing_policy
self.partition_key = partition_key
self.default_ttl = default_ttl
self.unique_key_policy = unique_key_policy
self.conflict_resolution_policy = conflict_resolution_policy
self.client_encryption_policy = client_encryption_policy
self.analytical_storage_ttl = analytical_storage_ttl
self.restore_parameters = restore_parameters
self.create_mode = create_mode
self.materialized_view_definition = materialized_view_definition
self.computed_properties = computed_properties
self.vector_embedding_policy = vector_embedding_policy
|
class SqlContainerResource(_serialization.Model):
'''Cosmos DB SQL container resource object.
All required parameters must be populated in order to send to server.
:ivar id: Name of the Cosmos DB SQL container. Required.
:vartype id: str
:ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is
automatic for all document paths within the container.
:vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy
:ivar partition_key: The configuration of the partition key to be used for partitioning data
into multiple partitions.
:vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey
:ivar default_ttl: Default time to live.
:vartype default_ttl: int
:ivar unique_key_policy: The unique key policy configuration for specifying uniqueness
constraints on documents in the collection in the Azure Cosmos DB service.
:vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy
:ivar conflict_resolution_policy: The conflict resolution policy for the container.
:vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy
:ivar client_encryption_policy: The client encryption policy for the container.
:vartype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy
:ivar analytical_storage_ttl: Analytical TTL.
:vartype analytical_storage_ttl: int
:ivar restore_parameters: Parameters to indicate the information about the restore.
:vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default"
and "Restore".
:vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:ivar materialized_view_definition: The configuration for defining Materialized Views. This
must be specified only for creating a Materialized View container.
:vartype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition
:ivar computed_properties: List of computed properties.
:vartype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty]
:ivar vector_embedding_policy: The vector embedding policy for the container.
:vartype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy
'''
def __init__(
self,
*,
id: str, # pylint: disable=redefined-builtin
indexing_policy: Optional["_models.IndexingPolicy"] = None,
partition_key: Optional["_models.ContainerPartitionKey"] = None,
default_ttl: Optional[int] = None,
unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None,
conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None,
client_encryption_policy: Optional["_models.ClientEncryptionPolicy"] = None,
analytical_storage_ttl: Optional[int] = None,
restore_parameters: Optional["_models.ResourceRestoreParameters"] = None,
create_mode: Union[str, "_models.CreateMode"] = "Default",
materialized_view_definition: Optional["_models.MaterializedViewDefinition"] = None,
computed_properties: Optional[List["_models.ComputedProperty"]] = None,
vector_embedding_policy: Optional["_models.VectorEmbeddingPolicy"] = None,
**kwargs: Any
) -> None:
'''
:keyword id: Name of the Cosmos DB SQL container. Required.
:paramtype id: str
:keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is
automatic for all document paths within the container.
:paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy
:keyword partition_key: The configuration of the partition key to be used for partitioning data
into multiple partitions.
:paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey
:keyword default_ttl: Default time to live.
:paramtype default_ttl: int
:keyword unique_key_policy: The unique key policy configuration for specifying uniqueness
constraints on documents in the collection in the Azure Cosmos DB service.
:paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy
:keyword conflict_resolution_policy: The conflict resolution policy for the container.
:paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy
:keyword client_encryption_policy: The client encryption policy for the container.
:paramtype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy
:keyword analytical_storage_ttl: Analytical TTL.
:paramtype analytical_storage_ttl: int
:keyword restore_parameters: Parameters to indicate the information about the restore.
:paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:keyword create_mode: Enum to indicate the mode of resource creation. Known values are:
"Default" and "Restore".
:paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:keyword materialized_view_definition: The configuration for defining Materialized Views. This
must be specified only for creating a Materialized View container.
:paramtype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition
:keyword computed_properties: List of computed properties.
:paramtype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty]
:keyword vector_embedding_policy: The vector embedding policy for the container.
:paramtype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy
'''
pass
| 2 | 2 | 65 | 0 | 32 | 34 | 1 | 1.33 | 1 | 4 | 0 | 2 | 1 | 13 | 1 | 16 | 123 | 5 | 51 | 34 | 32 | 68 | 18 | 17 | 16 | 1 | 2 | 0 | 1 |
10,640 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.SqlDatabaseCreateUpdateParameters
|
class SqlDatabaseCreateUpdateParameters(ARMResourceProperties):
"""Parameters to create and update Cosmos DB SQL database.
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 server.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar location: The location of the resource group to which the resource belongs.
:vartype location: str
:ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:vartype tags: dict[str, str]
:ivar identity: Identity for the resource.
:vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:ivar resource: The standard JSON format of a SQL database. Required.
:vartype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseResource
:ivar options: A key-value pair of options to be applied for the request. This corresponds to
the headers sent with the request.
:vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"resource": {"required": 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}"},
"identity": {"key": "identity", "type": "ManagedServiceIdentity"},
"resource": {"key": "properties.resource", "type": "SqlDatabaseResource"},
"options": {"key": "properties.options", "type": "CreateUpdateOptions"},
}
def __init__(
self,
*,
resource: "_models.SqlDatabaseResource",
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
identity: Optional["_models.ManagedServiceIdentity"] = None,
options: Optional["_models.CreateUpdateOptions"] = None,
**kwargs: Any
) -> None:
"""
:keyword location: The location of the resource group to which the resource belongs.
:paramtype location: str
:keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:paramtype tags: dict[str, str]
:keyword identity: Identity for the resource.
:paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:keyword resource: The standard JSON format of a SQL database. Required.
:paramtype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseResource
:keyword options: A key-value pair of options to be applied for the request. This corresponds
to the headers sent with the request.
:paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions
"""
super().__init__(location=location, tags=tags, identity=identity, **kwargs)
self.resource = resource
self.options = options
|
class SqlDatabaseCreateUpdateParameters(ARMResourceProperties):
'''Parameters to create and update Cosmos DB SQL database.
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 server.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar location: The location of the resource group to which the resource belongs.
:vartype location: str
:ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:vartype tags: dict[str, str]
:ivar identity: Identity for the resource.
:vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:ivar resource: The standard JSON format of a SQL database. Required.
:vartype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseResource
:ivar options: A key-value pair of options to be applied for the request. This corresponds to
the headers sent with the request.
:vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions
'''
def __init__(
self,
*,
resource: "_models.SqlDatabaseResource",
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
identity: Optional["_models.ManagedServiceIdentity"] = None,
options: Optional["_models.CreateUpdateOptions"] = None,
**kwargs: Any
) -> None:
'''
:keyword location: The location of the resource group to which the resource belongs.
:paramtype location: str
:keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:paramtype tags: dict[str, str]
:keyword identity: Identity for the resource.
:paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:keyword resource: The standard JSON format of a SQL database. Required.
:paramtype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseResource
:keyword options: A key-value pair of options to be applied for the request. This corresponds
to the headers sent with the request.
:paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions
'''
pass
| 2 | 2 | 31 | 0 | 13 | 18 | 1 | 1.47 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 17 | 80 | 6 | 30 | 15 | 19 | 44 | 7 | 6 | 5 | 1 | 3 | 0 | 1 |
10,641 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.SqlDatabaseGetPropertiesOptions
|
class SqlDatabaseGetPropertiesOptions(OptionsResource):
"""SqlDatabaseGetPropertiesOptions.
:ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the
ThroughputSetting resource when retrieving offer details.
:vartype throughput: int
:ivar autoscale_settings: Specifies the Autoscale settings.
:vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings
"""
|
class SqlDatabaseGetPropertiesOptions(OptionsResource):
'''SqlDatabaseGetPropertiesOptions.
:ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the
ThroughputSetting resource when retrieving offer details.
:vartype throughput: int
:ivar autoscale_settings: Specifies the Autoscale settings.
:vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 7 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 9 | 1 | 1 | 1 | 0 | 7 | 1 | 1 | 0 | 0 | 3 | 0 | 0 |
10,642 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.SqlDatabaseGetPropertiesResource
|
class SqlDatabaseGetPropertiesResource(SqlDatabaseResource, ExtendedResourceProperties):
"""SqlDatabaseGetPropertiesResource.
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 server.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar ts: A system generated property that denotes the last updated timestamp of the resource.
:vartype ts: float
:ivar etag: A system generated property representing the resource etag required for optimistic
concurrency control.
:vartype etag: str
:ivar id: Name of the Cosmos DB SQL database. Required.
:vartype id: str
:ivar restore_parameters: Parameters to indicate the information about the restore.
:vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default"
and "Restore".
:vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:ivar colls: A system generated property that specified the addressable path of the collections
resource.
:vartype colls: str
:ivar users: A system generated property that specifies the addressable path of the users
resource.
:vartype users: str
"""
_validation = {
"rid": {"readonly": True},
"ts": {"readonly": True},
"etag": {"readonly": True},
"id": {"required": True},
}
_attribute_map = {
"rid": {"key": "_rid", "type": "str"},
"ts": {"key": "_ts", "type": "float"},
"etag": {"key": "_etag", "type": "str"},
"id": {"key": "id", "type": "str"},
"restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"},
"create_mode": {"key": "createMode", "type": "str"},
"colls": {"key": "_colls", "type": "str"},
"users": {"key": "_users", "type": "str"},
}
def __init__(
self,
*,
id: str, # pylint: disable=redefined-builtin
restore_parameters: Optional["_models.ResourceRestoreParameters"] = None,
create_mode: Union[str, "_models.CreateMode"] = "Default",
colls: Optional[str] = None,
users: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword id: Name of the Cosmos DB SQL database. Required.
:paramtype id: str
:keyword restore_parameters: Parameters to indicate the information about the restore.
:paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:keyword create_mode: Enum to indicate the mode of resource creation. Known values are:
"Default" and "Restore".
:paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:keyword colls: A system generated property that specified the addressable path of the
collections resource.
:paramtype colls: str
:keyword users: A system generated property that specifies the addressable path of the users
resource.
:paramtype users: str
"""
super().__init__(id=id, restore_parameters=restore_parameters, create_mode=create_mode, **kwargs)
self.rid = None
self.ts = None
self.etag = None
self.colls = colls
self.users = users
self.id = id
self.restore_parameters = restore_parameters
self.create_mode = create_mode
|
class SqlDatabaseGetPropertiesResource(SqlDatabaseResource, ExtendedResourceProperties):
'''SqlDatabaseGetPropertiesResource.
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 server.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar ts: A system generated property that denotes the last updated timestamp of the resource.
:vartype ts: float
:ivar etag: A system generated property representing the resource etag required for optimistic
concurrency control.
:vartype etag: str
:ivar id: Name of the Cosmos DB SQL database. Required.
:vartype id: str
:ivar restore_parameters: Parameters to indicate the information about the restore.
:vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default"
and "Restore".
:vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:ivar colls: A system generated property that specified the addressable path of the collections
resource.
:vartype colls: str
:ivar users: A system generated property that specifies the addressable path of the users
resource.
:vartype users: str
'''
def __init__(
self,
*,
id: str, # pylint: disable=redefined-builtin
restore_parameters: Optional["_models.ResourceRestoreParameters"] = None,
create_mode: Union[str, "_models.CreateMode"] = "Default",
colls: Optional[str] = None,
users: Optional[str] = None,
**kwargs: Any
) -> None:
'''
:keyword id: Name of the Cosmos DB SQL database. Required.
:paramtype id: str
:keyword restore_parameters: Parameters to indicate the information about the restore.
:paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:keyword create_mode: Enum to indicate the mode of resource creation. Known values are:
"Default" and "Restore".
:paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:keyword colls: A system generated property that specified the addressable path of the
collections resource.
:paramtype colls: str
:keyword users: A system generated property that specifies the addressable path of the users
resource.
:paramtype users: str
'''
pass
| 2 | 2 | 34 | 0 | 19 | 16 | 1 | 1.11 | 2 | 3 | 0 | 0 | 1 | 8 | 1 | 18 | 81 | 6 | 36 | 21 | 25 | 40 | 13 | 12 | 11 | 1 | 3 | 0 | 1 |
10,643 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RetrieveThroughputPropertiesResource
|
class RetrieveThroughputPropertiesResource(_serialization.Model):
"""Resource to retrieve throughput information for Cosmos DB resource.
All required parameters must be populated in order to send to server.
:ivar physical_partition_ids: Array of PhysicalPartitionId objects. Required.
:vartype physical_partition_ids: list[~azure.mgmt.cosmosdb.models.PhysicalPartitionId]
"""
_validation = {
"physical_partition_ids": {"required": True},
}
_attribute_map = {
"physical_partition_ids": {"key": "physicalPartitionIds", "type": "[PhysicalPartitionId]"},
}
def __init__(self, *, physical_partition_ids: List["_models.PhysicalPartitionId"], **kwargs: Any) -> None:
"""
:keyword physical_partition_ids: Array of PhysicalPartitionId objects. Required.
:paramtype physical_partition_ids: list[~azure.mgmt.cosmosdb.models.PhysicalPartitionId]
"""
super().__init__(**kwargs)
self.physical_partition_ids = physical_partition_ids
|
class RetrieveThroughputPropertiesResource(_serialization.Model):
'''Resource to retrieve throughput information for Cosmos DB resource.
All required parameters must be populated in order to send to server.
:ivar physical_partition_ids: Array of PhysicalPartitionId objects. Required.
:vartype physical_partition_ids: list[~azure.mgmt.cosmosdb.models.PhysicalPartitionId]
'''
def __init__(self, *, physical_partition_ids: List["_models.PhysicalPartitionId"], **kwargs: Any) -> None:
'''
:keyword physical_partition_ids: Array of PhysicalPartitionId objects. Required.
:paramtype physical_partition_ids: list[~azure.mgmt.cosmosdb.models.PhysicalPartitionId]
'''
pass
| 2 | 2 | 7 | 0 | 3 | 4 | 1 | 0.9 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 24 | 5 | 10 | 5 | 8 | 9 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,644 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RetrieveThroughputParameters
|
class RetrieveThroughputParameters(ARMResourceProperties):
"""Cosmos DB retrieve throughput parameters object.
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 server.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar location: The location of the resource group to which the resource belongs.
:vartype location: str
:ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:vartype tags: dict[str, str]
:ivar identity: Identity for the resource.
:vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:ivar resource: The standard JSON format of a resource throughput. Required.
:vartype resource: ~azure.mgmt.cosmosdb.models.RetrieveThroughputPropertiesResource
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"resource": {"required": 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}"},
"identity": {"key": "identity", "type": "ManagedServiceIdentity"},
"resource": {"key": "properties.resource", "type": "RetrieveThroughputPropertiesResource"},
}
def __init__(
self,
*,
resource: "_models.RetrieveThroughputPropertiesResource",
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
identity: Optional["_models.ManagedServiceIdentity"] = None,
**kwargs: Any
) -> None:
"""
:keyword location: The location of the resource group to which the resource belongs.
:paramtype location: str
:keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:paramtype tags: dict[str, str]
:keyword identity: Identity for the resource.
:paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:keyword resource: The standard JSON format of a resource throughput. Required.
:paramtype resource: ~azure.mgmt.cosmosdb.models.RetrieveThroughputPropertiesResource
"""
super().__init__(location=location, tags=tags, identity=identity, **kwargs)
self.resource = resource
|
class RetrieveThroughputParameters(ARMResourceProperties):
'''Cosmos DB retrieve throughput parameters object.
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 server.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar location: The location of the resource group to which the resource belongs.
:vartype location: str
:ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:vartype tags: dict[str, str]
:ivar identity: Identity for the resource.
:vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:ivar resource: The standard JSON format of a resource throughput. Required.
:vartype resource: ~azure.mgmt.cosmosdb.models.RetrieveThroughputPropertiesResource
'''
def __init__(
self,
*,
resource: "_models.RetrieveThroughputPropertiesResource",
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
identity: Optional["_models.ManagedServiceIdentity"] = None,
**kwargs: Any
) -> None:
'''
:keyword location: The location of the resource group to which the resource belongs.
:paramtype location: str
:keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be
used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can
be provided for a resource. Each tag must have a key no greater than 128 characters and value
no greater than 256 characters. For example, the default experience for a template type is set
with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table",
"Graph", "DocumentDB", and "MongoDB".
:paramtype tags: dict[str, str]
:keyword identity: Identity for the resource.
:paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:keyword resource: The standard JSON format of a resource throughput. Required.
:paramtype resource: ~azure.mgmt.cosmosdb.models.RetrieveThroughputPropertiesResource
'''
pass
| 2 | 2 | 26 | 0 | 11 | 15 | 1 | 1.41 | 1 | 3 | 0 | 0 | 1 | 1 | 1 | 17 | 71 | 6 | 27 | 13 | 17 | 38 | 6 | 5 | 4 | 1 | 3 | 0 | 1 |
10,645 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestoreParametersBase
|
class RestoreParametersBase(_serialization.Model):
"""Parameters to indicate the information about the restore.
:ivar restore_source: The id of the restorable database account from which the restore has to
be initiated. For example:
/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long
:vartype restore_source: str
:ivar restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601 format).
:vartype restore_timestamp_in_utc: ~datetime.datetime
:ivar restore_with_ttl_disabled: Specifies whether the restored account will have Time-To-Live
disabled upon the successful restore.
:vartype restore_with_ttl_disabled: bool
"""
_attribute_map = {
"restore_source": {"key": "restoreSource", "type": "str"},
"restore_timestamp_in_utc": {"key": "restoreTimestampInUtc", "type": "iso-8601"},
"restore_with_ttl_disabled": {"key": "restoreWithTtlDisabled", "type": "bool"},
}
def __init__(
self,
*,
restore_source: Optional[str] = None,
restore_timestamp_in_utc: Optional[datetime.datetime] = None,
restore_with_ttl_disabled: Optional[bool] = None,
**kwargs: Any
) -> None:
"""
:keyword restore_source: The id of the restorable database account from which the restore has
to be initiated. For example:
/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long
:paramtype restore_source: str
:keyword restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601
format).
:paramtype restore_timestamp_in_utc: ~datetime.datetime
:keyword restore_with_ttl_disabled: Specifies whether the restored account will have
Time-To-Live disabled upon the successful restore.
:paramtype restore_with_ttl_disabled: bool
"""
super().__init__(**kwargs)
self.restore_source = restore_source
self.restore_timestamp_in_utc = restore_timestamp_in_utc
self.restore_with_ttl_disabled = restore_with_ttl_disabled
|
class RestoreParametersBase(_serialization.Model):
'''Parameters to indicate the information about the restore.
:ivar restore_source: The id of the restorable database account from which the restore has to
be initiated. For example:
/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long
:vartype restore_source: str
:ivar restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601 format).
:vartype restore_timestamp_in_utc: ~datetime.datetime
:ivar restore_with_ttl_disabled: Specifies whether the restored account will have Time-To-Live
disabled upon the successful restore.
:vartype restore_with_ttl_disabled: bool
'''
def __init__(
self,
*,
restore_source: Optional[str] = None,
restore_timestamp_in_utc: Optional[datetime.datetime] = None,
restore_with_ttl_disabled: Optional[bool] = None,
**kwargs: Any
) -> None:
'''
:keyword restore_source: The id of the restorable database account from which the restore has
to be initiated. For example:
/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long
:paramtype restore_source: str
:keyword restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601
format).
:paramtype restore_timestamp_in_utc: ~datetime.datetime
:keyword restore_with_ttl_disabled: Specifies whether the restored account will have
Time-To-Live disabled upon the successful restore.
:paramtype restore_with_ttl_disabled: bool
'''
pass
| 2 | 2 | 24 | 0 | 12 | 12 | 1 | 1.28 | 1 | 5 | 0 | 2 | 1 | 3 | 1 | 16 | 44 | 3 | 18 | 13 | 9 | 23 | 7 | 6 | 5 | 1 | 2 | 0 | 1 |
10,646 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestoreParameters
|
class RestoreParameters(RestoreParametersBase):
"""Parameters to indicate the information about the restore.
:ivar restore_source: The id of the restorable database account from which the restore has to
be initiated. For example:
/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long
:vartype restore_source: str
:ivar restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601 format).
:vartype restore_timestamp_in_utc: ~datetime.datetime
:ivar restore_with_ttl_disabled: Specifies whether the restored account will have Time-To-Live
disabled upon the successful restore.
:vartype restore_with_ttl_disabled: bool
:ivar restore_mode: Describes the mode of the restore. "PointInTime"
:vartype restore_mode: str or ~azure.mgmt.cosmosdb.models.RestoreMode
:ivar databases_to_restore: List of specific databases available for restore.
:vartype databases_to_restore: list[~azure.mgmt.cosmosdb.models.DatabaseRestoreResource]
:ivar gremlin_databases_to_restore: List of specific gremlin databases available for restore.
:vartype gremlin_databases_to_restore:
list[~azure.mgmt.cosmosdb.models.GremlinDatabaseRestoreResource]
:ivar tables_to_restore: List of specific tables available for restore.
:vartype tables_to_restore: list[str]
:ivar source_backup_location: The source backup location for restore.
:vartype source_backup_location: str
"""
_attribute_map = {
"restore_source": {"key": "restoreSource", "type": "str"},
"restore_timestamp_in_utc": {"key": "restoreTimestampInUtc", "type": "iso-8601"},
"restore_with_ttl_disabled": {"key": "restoreWithTtlDisabled", "type": "bool"},
"restore_mode": {"key": "restoreMode", "type": "str"},
"databases_to_restore": {"key": "databasesToRestore", "type": "[DatabaseRestoreResource]"},
"gremlin_databases_to_restore": {
"key": "gremlinDatabasesToRestore",
"type": "[GremlinDatabaseRestoreResource]",
},
"tables_to_restore": {"key": "tablesToRestore", "type": "[str]"},
"source_backup_location": {"key": "sourceBackupLocation", "type": "str"},
}
def __init__(
self,
*,
restore_source: Optional[str] = None,
restore_timestamp_in_utc: Optional[datetime.datetime] = None,
restore_with_ttl_disabled: Optional[bool] = None,
restore_mode: Optional[Union[str, "_models.RestoreMode"]] = None,
databases_to_restore: Optional[List["_models.DatabaseRestoreResource"]] = None,
gremlin_databases_to_restore: Optional[List["_models.GremlinDatabaseRestoreResource"]] = None,
tables_to_restore: Optional[List[str]] = None,
source_backup_location: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword restore_source: The id of the restorable database account from which the restore has
to be initiated. For example:
/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long
:paramtype restore_source: str
:keyword restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601
format).
:paramtype restore_timestamp_in_utc: ~datetime.datetime
:keyword restore_with_ttl_disabled: Specifies whether the restored account will have
Time-To-Live disabled upon the successful restore.
:paramtype restore_with_ttl_disabled: bool
:keyword restore_mode: Describes the mode of the restore. "PointInTime"
:paramtype restore_mode: str or ~azure.mgmt.cosmosdb.models.RestoreMode
:keyword databases_to_restore: List of specific databases available for restore.
:paramtype databases_to_restore: list[~azure.mgmt.cosmosdb.models.DatabaseRestoreResource]
:keyword gremlin_databases_to_restore: List of specific gremlin databases available for
restore.
:paramtype gremlin_databases_to_restore:
list[~azure.mgmt.cosmosdb.models.GremlinDatabaseRestoreResource]
:keyword tables_to_restore: List of specific tables available for restore.
:paramtype tables_to_restore: list[str]
:keyword source_backup_location: The source backup location for restore.
:paramtype source_backup_location: str
"""
super().__init__(
restore_source=restore_source,
restore_timestamp_in_utc=restore_timestamp_in_utc,
restore_with_ttl_disabled=restore_with_ttl_disabled,
**kwargs
)
self.restore_mode = restore_mode
self.databases_to_restore = databases_to_restore
self.gremlin_databases_to_restore = gremlin_databases_to_restore
self.tables_to_restore = tables_to_restore
self.source_backup_location = source_backup_location
|
class RestoreParameters(RestoreParametersBase):
'''Parameters to indicate the information about the restore.
:ivar restore_source: The id of the restorable database account from which the restore has to
be initiated. For example:
/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long
:vartype restore_source: str
:ivar restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601 format).
:vartype restore_timestamp_in_utc: ~datetime.datetime
:ivar restore_with_ttl_disabled: Specifies whether the restored account will have Time-To-Live
disabled upon the successful restore.
:vartype restore_with_ttl_disabled: bool
:ivar restore_mode: Describes the mode of the restore. "PointInTime"
:vartype restore_mode: str or ~azure.mgmt.cosmosdb.models.RestoreMode
:ivar databases_to_restore: List of specific databases available for restore.
:vartype databases_to_restore: list[~azure.mgmt.cosmosdb.models.DatabaseRestoreResource]
:ivar gremlin_databases_to_restore: List of specific gremlin databases available for restore.
:vartype gremlin_databases_to_restore:
list[~azure.mgmt.cosmosdb.models.GremlinDatabaseRestoreResource]
:ivar tables_to_restore: List of specific tables available for restore.
:vartype tables_to_restore: list[str]
:ivar source_backup_location: The source backup location for restore.
:vartype source_backup_location: str
'''
def __init__(
self,
*,
restore_source: Optional[str] = None,
restore_timestamp_in_utc: Optional[datetime.datetime] = None,
restore_with_ttl_disabled: Optional[bool] = None,
restore_mode: Optional[Union[str, "_models.RestoreMode"]] = None,
databases_to_restore: Optional[List["_models.DatabaseRestoreResource"]] = None,
gremlin_databases_to_restore: Optional[List["_models.GremlinDatabaseRestoreResource"]] = None,
tables_to_restore: Optional[List[str]] = None,
source_backup_location: Optional[str] = None,
**kwargs: Any
) -> None:
'''
:keyword restore_source: The id of the restorable database account from which the restore has
to be initiated. For example:
/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long
:paramtype restore_source: str
:keyword restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601
format).
:paramtype restore_timestamp_in_utc: ~datetime.datetime
:keyword restore_with_ttl_disabled: Specifies whether the restored account will have
Time-To-Live disabled upon the successful restore.
:paramtype restore_with_ttl_disabled: bool
:keyword restore_mode: Describes the mode of the restore. "PointInTime"
:paramtype restore_mode: str or ~azure.mgmt.cosmosdb.models.RestoreMode
:keyword databases_to_restore: List of specific databases available for restore.
:paramtype databases_to_restore: list[~azure.mgmt.cosmosdb.models.DatabaseRestoreResource]
:keyword gremlin_databases_to_restore: List of specific gremlin databases available for
restore.
:paramtype gremlin_databases_to_restore:
list[~azure.mgmt.cosmosdb.models.GremlinDatabaseRestoreResource]
:keyword tables_to_restore: List of specific tables available for restore.
:paramtype tables_to_restore: list[str]
:keyword source_backup_location: The source backup location for restore.
:paramtype source_backup_location: str
'''
pass
| 2 | 2 | 48 | 0 | 24 | 24 | 1 | 1.21 | 1 | 5 | 0 | 0 | 1 | 5 | 1 | 17 | 87 | 3 | 38 | 20 | 24 | 46 | 9 | 8 | 7 | 1 | 3 | 0 | 1 |
10,647 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableMongodbDatabasesListResult
|
class RestorableMongodbDatabasesListResult(_serialization.Model):
"""The List operation response, that contains the MongoDB database events and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of MongoDB database events and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableMongodbDatabaseGetResult]
"""
_validation = {
"value": {"readonly": True},
}
_attribute_map = {
"value": {"key": "value", "type": "[RestorableMongodbDatabaseGetResult]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.value = None
|
class RestorableMongodbDatabasesListResult(_serialization.Model):
'''The List operation response, that contains the MongoDB database events and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of MongoDB database events and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableMongodbDatabaseGetResult]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 4 | 0 | 3 | 1 | 1 | 0.6 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 21 | 5 | 10 | 5 | 8 | 6 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,648 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableMongodbResourcesGetResult
|
class RestorableMongodbResourcesGetResult(_serialization.Model):
"""Specific Databases to restore.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar database_name: The name of the database available for restore.
:vartype database_name: str
:ivar collection_names: The names of the collections available for restore.
:vartype collection_names: list[str]
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"database_name": {"key": "databaseName", "type": "str"},
"collection_names": {"key": "collectionNames", "type": "[str]"},
}
def __init__(
self, *, database_name: Optional[str] = None, collection_names: Optional[List[str]] = None, **kwargs: Any
) -> None:
"""
:keyword database_name: The name of the database available for restore.
:paramtype database_name: str
:keyword collection_names: The names of the collections available for restore.
:paramtype collection_names: list[str]
"""
super().__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.database_name = database_name
self.collection_names = collection_names
|
class RestorableMongodbResourcesGetResult(_serialization.Model):
'''Specific Databases to restore.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar database_name: The name of the database available for restore.
:vartype database_name: str
:ivar collection_names: The names of the collections available for restore.
:vartype collection_names: list[str]
'''
def __init__(
self, *, database_name: Optional[str] = None, collection_names: Optional[List[str]] = None, **kwargs: Any
) -> None:
'''
:keyword database_name: The name of the database available for restore.
:paramtype database_name: str
:keyword collection_names: The names of the collections available for restore.
:paramtype collection_names: list[str]
'''
pass
| 2 | 2 | 15 | 0 | 9 | 6 | 1 | 0.86 | 1 | 3 | 0 | 0 | 1 | 5 | 1 | 16 | 46 | 5 | 22 | 11 | 18 | 19 | 10 | 9 | 8 | 1 | 2 | 0 | 1 |
10,649 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableMongodbResourcesListResult
|
class RestorableMongodbResourcesListResult(_serialization.Model):
"""The List operation response, that contains the restorable MongoDB resources.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of restorable MongoDB resources, including the database and collection names.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableMongodbResourcesGetResult]
"""
_validation = {
"value": {"readonly": True},
}
_attribute_map = {
"value": {"key": "value", "type": "[RestorableMongodbResourcesGetResult]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.value = None
|
class RestorableMongodbResourcesListResult(_serialization.Model):
'''The List operation response, that contains the restorable MongoDB resources.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of restorable MongoDB resources, including the database and collection names.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableMongodbResourcesGetResult]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 4 | 0 | 3 | 1 | 1 | 0.6 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 21 | 5 | 10 | 5 | 8 | 6 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,650 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableSqlContainerGetResult
|
class RestorableSqlContainerGetResult(_serialization.Model):
"""An Azure Cosmos DB SQL container event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource Identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar resource: The resource of an Azure Cosmos DB SQL container event.
:vartype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResource
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"resource": {"key": "properties.resource", "type": "RestorableSqlContainerPropertiesResource"},
}
def __init__(
self, *, resource: Optional["_models.RestorableSqlContainerPropertiesResource"] = None, **kwargs: Any
) -> None:
"""
:keyword resource: The resource of an Azure Cosmos DB SQL container event.
:paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResource
"""
super().__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.resource = resource
|
class RestorableSqlContainerGetResult(_serialization.Model):
'''An Azure Cosmos DB SQL container event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource Identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar resource: The resource of an Azure Cosmos DB SQL container event.
:vartype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResource
'''
def __init__(
self, *, resource: Optional["_models.RestorableSqlContainerPropertiesResource"] = None, **kwargs: Any
) -> None:
'''
:keyword resource: The resource of an Azure Cosmos DB SQL container event.
:paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResource
'''
pass
| 2 | 2 | 12 | 0 | 8 | 4 | 1 | 0.75 | 1 | 2 | 0 | 0 | 1 | 4 | 1 | 16 | 40 | 5 | 20 | 10 | 16 | 15 | 9 | 8 | 7 | 1 | 2 | 0 | 1 |
10,651 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableSqlContainerPropertiesResource
|
class RestorableSqlContainerPropertiesResource(_serialization.Model):
"""The resource of an Azure Cosmos DB SQL container event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar operation_type: The operation type of this container event. Known values are: "Create",
"Replace", "Delete", "Recreate", and "SystemOperation".
:vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType
:ivar can_undelete: A state of this container to identify if this container is restorable in
same account.
:vartype can_undelete: str
:ivar can_undelete_reason: The reason why this container can not be restored in same account.
:vartype can_undelete_reason: str
:ivar event_timestamp: The when this container event happened.
:vartype event_timestamp: str
:ivar owner_id: The name of this SQL container.
:vartype owner_id: str
:ivar owner_resource_id: The resource ID of this SQL container.
:vartype owner_resource_id: str
:ivar container: Cosmos DB SQL container resource object.
:vartype container:
~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResourceContainer
"""
_validation = {
"rid": {"readonly": True},
"operation_type": {"readonly": True},
"can_undelete": {"readonly": True},
"can_undelete_reason": {"readonly": True},
"event_timestamp": {"readonly": True},
"owner_id": {"readonly": True},
"owner_resource_id": {"readonly": True},
}
_attribute_map = {
"rid": {"key": "_rid", "type": "str"},
"operation_type": {"key": "operationType", "type": "str"},
"can_undelete": {"key": "canUndelete", "type": "str"},
"can_undelete_reason": {"key": "canUndeleteReason", "type": "str"},
"event_timestamp": {"key": "eventTimestamp", "type": "str"},
"owner_id": {"key": "ownerId", "type": "str"},
"owner_resource_id": {"key": "ownerResourceId", "type": "str"},
"container": {"key": "container", "type": "RestorableSqlContainerPropertiesResourceContainer"},
}
def __init__(
self, *, container: Optional["_models.RestorableSqlContainerPropertiesResourceContainer"] = None, **kwargs: Any
) -> None:
"""
:keyword container: Cosmos DB SQL container resource object.
:paramtype container:
~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResourceContainer
"""
super().__init__(**kwargs)
self.rid = None
self.operation_type = None
self.can_undelete = None
self.can_undelete_reason = None
self.event_timestamp = None
self.owner_id = None
self.owner_resource_id = None
self.container = container
|
class RestorableSqlContainerPropertiesResource(_serialization.Model):
'''The resource of an Azure Cosmos DB SQL container event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar operation_type: The operation type of this container event. Known values are: "Create",
"Replace", "Delete", "Recreate", and "SystemOperation".
:vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType
:ivar can_undelete: A state of this container to identify if this container is restorable in
same account.
:vartype can_undelete: str
:ivar can_undelete_reason: The reason why this container can not be restored in same account.
:vartype can_undelete_reason: str
:ivar event_timestamp: The when this container event happened.
:vartype event_timestamp: str
:ivar owner_id: The name of this SQL container.
:vartype owner_id: str
:ivar owner_resource_id: The resource ID of this SQL container.
:vartype owner_resource_id: str
:ivar container: Cosmos DB SQL container resource object.
:vartype container:
~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResourceContainer
'''
def __init__(
self, *, container: Optional["_models.RestorableSqlContainerPropertiesResourceContainer"] = None, **kwargs: Any
) -> None:
'''
:keyword container: Cosmos DB SQL container resource object.
:paramtype container:
~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResourceContainer
'''
pass
| 2 | 2 | 17 | 0 | 12 | 5 | 1 | 0.84 | 1 | 2 | 0 | 0 | 1 | 8 | 1 | 16 | 64 | 5 | 32 | 14 | 28 | 27 | 13 | 12 | 11 | 1 | 2 | 0 | 1 |
10,652 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableSqlContainerPropertiesResourceContainer
|
class RestorableSqlContainerPropertiesResourceContainer(
SqlContainerResource, ExtendedResourceProperties
): # pylint: disable=name-too-long
"""Cosmos DB SQL container resource object.
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 server.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar ts: A system generated property that denotes the last updated timestamp of the resource.
:vartype ts: float
:ivar etag: A system generated property representing the resource etag required for optimistic
concurrency control.
:vartype etag: str
:ivar id: Name of the Cosmos DB SQL container. Required.
:vartype id: str
:ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is
automatic for all document paths within the container.
:vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy
:ivar partition_key: The configuration of the partition key to be used for partitioning data
into multiple partitions.
:vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey
:ivar default_ttl: Default time to live.
:vartype default_ttl: int
:ivar unique_key_policy: The unique key policy configuration for specifying uniqueness
constraints on documents in the collection in the Azure Cosmos DB service.
:vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy
:ivar conflict_resolution_policy: The conflict resolution policy for the container.
:vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy
:ivar client_encryption_policy: The client encryption policy for the container.
:vartype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy
:ivar analytical_storage_ttl: Analytical TTL.
:vartype analytical_storage_ttl: int
:ivar restore_parameters: Parameters to indicate the information about the restore.
:vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default"
and "Restore".
:vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:ivar materialized_view_definition: The configuration for defining Materialized Views. This
must be specified only for creating a Materialized View container.
:vartype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition
:ivar computed_properties: List of computed properties.
:vartype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty]
:ivar vector_embedding_policy: The vector embedding policy for the container.
:vartype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy
:ivar self_property: A system generated property that specifies the addressable path of the
container resource.
:vartype self_property: str
"""
_validation = {
"rid": {"readonly": True},
"ts": {"readonly": True},
"etag": {"readonly": True},
"id": {"required": True},
"self_property": {"readonly": True},
}
_attribute_map = {
"rid": {"key": "_rid", "type": "str"},
"ts": {"key": "_ts", "type": "float"},
"etag": {"key": "_etag", "type": "str"},
"id": {"key": "id", "type": "str"},
"indexing_policy": {"key": "indexingPolicy", "type": "IndexingPolicy"},
"partition_key": {"key": "partitionKey", "type": "ContainerPartitionKey"},
"default_ttl": {"key": "defaultTtl", "type": "int"},
"unique_key_policy": {"key": "uniqueKeyPolicy", "type": "UniqueKeyPolicy"},
"conflict_resolution_policy": {"key": "conflictResolutionPolicy", "type": "ConflictResolutionPolicy"},
"client_encryption_policy": {"key": "clientEncryptionPolicy", "type": "ClientEncryptionPolicy"},
"analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"},
"restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"},
"create_mode": {"key": "createMode", "type": "str"},
"materialized_view_definition": {"key": "materializedViewDefinition", "type": "MaterializedViewDefinition"},
"computed_properties": {"key": "computedProperties", "type": "[ComputedProperty]"},
"vector_embedding_policy": {"key": "vectorEmbeddingPolicy", "type": "VectorEmbeddingPolicy"},
"self_property": {"key": "_self", "type": "str"},
}
def __init__(
self,
*,
id: str, # pylint: disable=redefined-builtin
indexing_policy: Optional["_models.IndexingPolicy"] = None,
partition_key: Optional["_models.ContainerPartitionKey"] = None,
default_ttl: Optional[int] = None,
unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None,
conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None,
client_encryption_policy: Optional["_models.ClientEncryptionPolicy"] = None,
analytical_storage_ttl: Optional[int] = None,
restore_parameters: Optional["_models.ResourceRestoreParameters"] = None,
create_mode: Union[str, "_models.CreateMode"] = "Default",
materialized_view_definition: Optional["_models.MaterializedViewDefinition"] = None,
computed_properties: Optional[List["_models.ComputedProperty"]] = None,
vector_embedding_policy: Optional["_models.VectorEmbeddingPolicy"] = None,
**kwargs: Any
) -> None:
"""
:keyword id: Name of the Cosmos DB SQL container. Required.
:paramtype id: str
:keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is
automatic for all document paths within the container.
:paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy
:keyword partition_key: The configuration of the partition key to be used for partitioning data
into multiple partitions.
:paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey
:keyword default_ttl: Default time to live.
:paramtype default_ttl: int
:keyword unique_key_policy: The unique key policy configuration for specifying uniqueness
constraints on documents in the collection in the Azure Cosmos DB service.
:paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy
:keyword conflict_resolution_policy: The conflict resolution policy for the container.
:paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy
:keyword client_encryption_policy: The client encryption policy for the container.
:paramtype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy
:keyword analytical_storage_ttl: Analytical TTL.
:paramtype analytical_storage_ttl: int
:keyword restore_parameters: Parameters to indicate the information about the restore.
:paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:keyword create_mode: Enum to indicate the mode of resource creation. Known values are:
"Default" and "Restore".
:paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:keyword materialized_view_definition: The configuration for defining Materialized Views. This
must be specified only for creating a Materialized View container.
:paramtype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition
:keyword computed_properties: List of computed properties.
:paramtype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty]
:keyword vector_embedding_policy: The vector embedding policy for the container.
:paramtype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy
"""
super().__init__(
id=id,
indexing_policy=indexing_policy,
partition_key=partition_key,
default_ttl=default_ttl,
unique_key_policy=unique_key_policy,
conflict_resolution_policy=conflict_resolution_policy,
client_encryption_policy=client_encryption_policy,
analytical_storage_ttl=analytical_storage_ttl,
restore_parameters=restore_parameters,
create_mode=create_mode,
materialized_view_definition=materialized_view_definition,
computed_properties=computed_properties,
vector_embedding_policy=vector_embedding_policy,
**kwargs
)
self.rid = None
self.ts = None
self.etag = None
self.self_property = None
self.id = id
self.indexing_policy = indexing_policy
self.partition_key = partition_key
self.default_ttl = default_ttl
self.unique_key_policy = unique_key_policy
self.conflict_resolution_policy = conflict_resolution_policy
self.client_encryption_policy = client_encryption_policy
self.analytical_storage_ttl = analytical_storage_ttl
self.restore_parameters = restore_parameters
self.create_mode = create_mode
self.materialized_view_definition = materialized_view_definition
self.computed_properties = computed_properties
self.vector_embedding_policy = vector_embedding_policy
|
class RestorableSqlContainerPropertiesResourceContainer(
SqlContainerResource, ExtendedResourceProperties
):
'''Cosmos DB SQL container resource object.
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 server.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar ts: A system generated property that denotes the last updated timestamp of the resource.
:vartype ts: float
:ivar etag: A system generated property representing the resource etag required for optimistic
concurrency control.
:vartype etag: str
:ivar id: Name of the Cosmos DB SQL container. Required.
:vartype id: str
:ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is
automatic for all document paths within the container.
:vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy
:ivar partition_key: The configuration of the partition key to be used for partitioning data
into multiple partitions.
:vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey
:ivar default_ttl: Default time to live.
:vartype default_ttl: int
:ivar unique_key_policy: The unique key policy configuration for specifying uniqueness
constraints on documents in the collection in the Azure Cosmos DB service.
:vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy
:ivar conflict_resolution_policy: The conflict resolution policy for the container.
:vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy
:ivar client_encryption_policy: The client encryption policy for the container.
:vartype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy
:ivar analytical_storage_ttl: Analytical TTL.
:vartype analytical_storage_ttl: int
:ivar restore_parameters: Parameters to indicate the information about the restore.
:vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default"
and "Restore".
:vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:ivar materialized_view_definition: The configuration for defining Materialized Views. This
must be specified only for creating a Materialized View container.
:vartype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition
:ivar computed_properties: List of computed properties.
:vartype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty]
:ivar vector_embedding_policy: The vector embedding policy for the container.
:vartype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy
:ivar self_property: A system generated property that specifies the addressable path of the
container resource.
:vartype self_property: str
'''
def __init__(
self,
*,
id: str, # pylint: disable=redefined-builtin
indexing_policy: Optional["_models.IndexingPolicy"] = None,
partition_key: Optional["_models.ContainerPartitionKey"] = None,
default_ttl: Optional[int] = None,
unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None,
conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None,
client_encryption_policy: Optional["_models.ClientEncryptionPolicy"] = None,
analytical_storage_ttl: Optional[int] = None,
restore_parameters: Optional["_models.ResourceRestoreParameters"] = None,
create_mode: Union[str, "_models.CreateMode"] = "Default",
materialized_view_definition: Optional["_models.MaterializedViewDefinition"] = None,
computed_properties: Optional[List["_models.ComputedProperty"]] = None,
vector_embedding_policy: Optional["_models.VectorEmbeddingPolicy"] = None,
**kwargs: Any
) -> None:
'''
:keyword id: Name of the Cosmos DB SQL container. Required.
:paramtype id: str
:keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is
automatic for all document paths within the container.
:paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy
:keyword partition_key: The configuration of the partition key to be used for partitioning data
into multiple partitions.
:paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey
:keyword default_ttl: Default time to live.
:paramtype default_ttl: int
:keyword unique_key_policy: The unique key policy configuration for specifying uniqueness
constraints on documents in the collection in the Azure Cosmos DB service.
:paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy
:keyword conflict_resolution_policy: The conflict resolution policy for the container.
:paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy
:keyword client_encryption_policy: The client encryption policy for the container.
:paramtype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy
:keyword analytical_storage_ttl: Analytical TTL.
:paramtype analytical_storage_ttl: int
:keyword restore_parameters: Parameters to indicate the information about the restore.
:paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:keyword create_mode: Enum to indicate the mode of resource creation. Known values are:
"Default" and "Restore".
:paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:keyword materialized_view_definition: The configuration for defining Materialized Views. This
must be specified only for creating a Materialized View container.
:paramtype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition
:keyword computed_properties: List of computed properties.
:paramtype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty]
:keyword vector_embedding_policy: The vector embedding policy for the container.
:paramtype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy
'''
pass
| 2 | 2 | 84 | 0 | 51 | 34 | 1 | 1 | 2 | 4 | 0 | 0 | 1 | 17 | 1 | 18 | 164 | 6 | 80 | 40 | 59 | 80 | 22 | 21 | 20 | 1 | 3 | 0 | 1 |
10,653 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableSqlContainersListResult
|
class RestorableSqlContainersListResult(_serialization.Model):
"""The List operation response, that contains the SQL container events and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of SQL container events and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableSqlContainerGetResult]
"""
_validation = {
"value": {"readonly": True},
}
_attribute_map = {
"value": {"key": "value", "type": "[RestorableSqlContainerGetResult]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.value = None
|
class RestorableSqlContainersListResult(_serialization.Model):
'''The List operation response, that contains the SQL container events and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of SQL container events and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableSqlContainerGetResult]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 4 | 0 | 3 | 1 | 1 | 0.6 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 21 | 5 | 10 | 5 | 8 | 6 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,654 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableSqlDatabaseGetResult
|
class RestorableSqlDatabaseGetResult(_serialization.Model):
"""An Azure Cosmos DB SQL database event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource Identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar resource: The resource of an Azure Cosmos DB SQL database event.
:vartype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResource
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"resource": {"key": "properties.resource", "type": "RestorableSqlDatabasePropertiesResource"},
}
def __init__(
self, *, resource: Optional["_models.RestorableSqlDatabasePropertiesResource"] = None, **kwargs: Any
) -> None:
"""
:keyword resource: The resource of an Azure Cosmos DB SQL database event.
:paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResource
"""
super().__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.resource = resource
|
class RestorableSqlDatabaseGetResult(_serialization.Model):
'''An Azure Cosmos DB SQL database event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource Identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar resource: The resource of an Azure Cosmos DB SQL database event.
:vartype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResource
'''
def __init__(
self, *, resource: Optional["_models.RestorableSqlDatabasePropertiesResource"] = None, **kwargs: Any
) -> None:
'''
:keyword resource: The resource of an Azure Cosmos DB SQL database event.
:paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResource
'''
pass
| 2 | 2 | 12 | 0 | 8 | 4 | 1 | 0.75 | 1 | 2 | 0 | 0 | 1 | 4 | 1 | 16 | 40 | 5 | 20 | 10 | 16 | 15 | 9 | 8 | 7 | 1 | 2 | 0 | 1 |
10,655 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.SqlDatabaseListResult
|
class SqlDatabaseListResult(_serialization.Model):
"""The List operation response, that contains the SQL databases and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of SQL databases and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.SqlDatabaseGetResults]
"""
_validation = {
"value": {"readonly": True},
}
_attribute_map = {
"value": {"key": "value", "type": "[SqlDatabaseGetResults]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.value = None
|
class SqlDatabaseListResult(_serialization.Model):
'''The List operation response, that contains the SQL databases and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of SQL databases and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.SqlDatabaseGetResults]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 4 | 0 | 3 | 1 | 1 | 0.6 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 21 | 5 | 10 | 5 | 8 | 6 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,656 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableSqlDatabasePropertiesResource
|
class RestorableSqlDatabasePropertiesResource(_serialization.Model):
"""The resource of an Azure Cosmos DB SQL database event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar operation_type: The operation type of this database event. Known values are: "Create",
"Replace", "Delete", "Recreate", and "SystemOperation".
:vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType
:ivar can_undelete: A state of this database to identify if this database is restorable in same
account.
:vartype can_undelete: str
:ivar can_undelete_reason: The reason why this database can not be restored in same account.
:vartype can_undelete_reason: str
:ivar event_timestamp: The time when this database event happened.
:vartype event_timestamp: str
:ivar owner_id: The name of the SQL database.
:vartype owner_id: str
:ivar owner_resource_id: The resource ID of the SQL database.
:vartype owner_resource_id: str
:ivar database: Cosmos DB SQL database resource object.
:vartype database: ~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResourceDatabase
"""
_validation = {
"rid": {"readonly": True},
"operation_type": {"readonly": True},
"can_undelete": {"readonly": True},
"can_undelete_reason": {"readonly": True},
"event_timestamp": {"readonly": True},
"owner_id": {"readonly": True},
"owner_resource_id": {"readonly": True},
}
_attribute_map = {
"rid": {"key": "_rid", "type": "str"},
"operation_type": {"key": "operationType", "type": "str"},
"can_undelete": {"key": "canUndelete", "type": "str"},
"can_undelete_reason": {"key": "canUndeleteReason", "type": "str"},
"event_timestamp": {"key": "eventTimestamp", "type": "str"},
"owner_id": {"key": "ownerId", "type": "str"},
"owner_resource_id": {"key": "ownerResourceId", "type": "str"},
"database": {"key": "database", "type": "RestorableSqlDatabasePropertiesResourceDatabase"},
}
def __init__(
self, *, database: Optional["_models.RestorableSqlDatabasePropertiesResourceDatabase"] = None, **kwargs: Any
) -> None:
"""
:keyword database: Cosmos DB SQL database resource object.
:paramtype database:
~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResourceDatabase
"""
super().__init__(**kwargs)
self.rid = None
self.operation_type = None
self.can_undelete = None
self.can_undelete_reason = None
self.event_timestamp = None
self.owner_id = None
self.owner_resource_id = None
self.database = database
|
class RestorableSqlDatabasePropertiesResource(_serialization.Model):
'''The resource of an Azure Cosmos DB SQL database event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar operation_type: The operation type of this database event. Known values are: "Create",
"Replace", "Delete", "Recreate", and "SystemOperation".
:vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType
:ivar can_undelete: A state of this database to identify if this database is restorable in same
account.
:vartype can_undelete: str
:ivar can_undelete_reason: The reason why this database can not be restored in same account.
:vartype can_undelete_reason: str
:ivar event_timestamp: The time when this database event happened.
:vartype event_timestamp: str
:ivar owner_id: The name of the SQL database.
:vartype owner_id: str
:ivar owner_resource_id: The resource ID of the SQL database.
:vartype owner_resource_id: str
:ivar database: Cosmos DB SQL database resource object.
:vartype database: ~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResourceDatabase
'''
def __init__(
self, *, database: Optional["_models.RestorableSqlDatabasePropertiesResourceDatabase"] = None, **kwargs: Any
) -> None:
'''
:keyword database: Cosmos DB SQL database resource object.
:paramtype database:
~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResourceDatabase
'''
pass
| 2 | 2 | 17 | 0 | 12 | 5 | 1 | 0.81 | 1 | 2 | 0 | 0 | 1 | 8 | 1 | 16 | 63 | 5 | 32 | 14 | 28 | 26 | 13 | 12 | 11 | 1 | 2 | 0 | 1 |
10,657 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableSqlDatabasesListResult
|
class RestorableSqlDatabasesListResult(_serialization.Model):
"""The List operation response, that contains the SQL database events and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of SQL database events and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableSqlDatabaseGetResult]
"""
_validation = {
"value": {"readonly": True},
}
_attribute_map = {
"value": {"key": "value", "type": "[RestorableSqlDatabaseGetResult]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.value = None
|
class RestorableSqlDatabasesListResult(_serialization.Model):
'''The List operation response, that contains the SQL database events and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of SQL database events and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableSqlDatabaseGetResult]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 4 | 0 | 3 | 1 | 1 | 0.6 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 21 | 5 | 10 | 5 | 8 | 6 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,658 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableSqlResourcesGetResult
|
class RestorableSqlResourcesGetResult(_serialization.Model):
"""Specific Databases to restore.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar database_name: The name of the database available for restore.
:vartype database_name: str
:ivar collection_names: The names of the collections available for restore.
:vartype collection_names: list[str]
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"database_name": {"key": "databaseName", "type": "str"},
"collection_names": {"key": "collectionNames", "type": "[str]"},
}
def __init__(
self, *, database_name: Optional[str] = None, collection_names: Optional[List[str]] = None, **kwargs: Any
) -> None:
"""
:keyword database_name: The name of the database available for restore.
:paramtype database_name: str
:keyword collection_names: The names of the collections available for restore.
:paramtype collection_names: list[str]
"""
super().__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.database_name = database_name
self.collection_names = collection_names
|
class RestorableSqlResourcesGetResult(_serialization.Model):
'''Specific Databases to restore.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar database_name: The name of the database available for restore.
:vartype database_name: str
:ivar collection_names: The names of the collections available for restore.
:vartype collection_names: list[str]
'''
def __init__(
self, *, database_name: Optional[str] = None, collection_names: Optional[List[str]] = None, **kwargs: Any
) -> None:
'''
:keyword database_name: The name of the database available for restore.
:paramtype database_name: str
:keyword collection_names: The names of the collections available for restore.
:paramtype collection_names: list[str]
'''
pass
| 2 | 2 | 15 | 0 | 9 | 6 | 1 | 0.86 | 1 | 3 | 0 | 0 | 1 | 5 | 1 | 16 | 46 | 5 | 22 | 11 | 18 | 19 | 10 | 9 | 8 | 1 | 2 | 0 | 1 |
10,659 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableSqlResourcesListResult
|
class RestorableSqlResourcesListResult(_serialization.Model):
"""The List operation response, that contains the restorable SQL resources.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of restorable SQL resources, including the database and collection names.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableSqlResourcesGetResult]
"""
_validation = {
"value": {"readonly": True},
}
_attribute_map = {
"value": {"key": "value", "type": "[RestorableSqlResourcesGetResult]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.value = None
|
class RestorableSqlResourcesListResult(_serialization.Model):
'''The List operation response, that contains the restorable SQL resources.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of restorable SQL resources, including the database and collection names.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableSqlResourcesGetResult]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 4 | 0 | 3 | 1 | 1 | 0.6 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 21 | 5 | 10 | 5 | 8 | 6 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,660 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableTableGetResult
|
class RestorableTableGetResult(_serialization.Model):
"""An Azure Cosmos DB Table event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource Identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar resource: The resource of an Azure Cosmos DB Table event.
:vartype resource: ~azure.mgmt.cosmosdb.models.RestorableTablePropertiesResource
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"resource": {"key": "properties.resource", "type": "RestorableTablePropertiesResource"},
}
def __init__(
self, *, resource: Optional["_models.RestorableTablePropertiesResource"] = None, **kwargs: Any
) -> None:
"""
:keyword resource: The resource of an Azure Cosmos DB Table event.
:paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableTablePropertiesResource
"""
super().__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.resource = resource
|
class RestorableTableGetResult(_serialization.Model):
'''An Azure Cosmos DB Table event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource Identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar resource: The resource of an Azure Cosmos DB Table event.
:vartype resource: ~azure.mgmt.cosmosdb.models.RestorableTablePropertiesResource
'''
def __init__(
self, *, resource: Optional["_models.RestorableTablePropertiesResource"] = None, **kwargs: Any
) -> None:
'''
:keyword resource: The resource of an Azure Cosmos DB Table event.
:paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableTablePropertiesResource
'''
pass
| 2 | 2 | 12 | 0 | 8 | 4 | 1 | 0.75 | 1 | 2 | 0 | 0 | 1 | 4 | 1 | 16 | 40 | 5 | 20 | 10 | 16 | 15 | 9 | 8 | 7 | 1 | 2 | 0 | 1 |
10,661 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableTablePropertiesResource
|
class RestorableTablePropertiesResource(_serialization.Model):
"""The resource of an Azure Cosmos DB Table event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar operation_type: The operation type of this table event. Known values are: "Create",
"Replace", "Delete", "Recreate", and "SystemOperation".
:vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType
:ivar can_undelete: A state of this table to identify if this table is restorable in same
account.
:vartype can_undelete: str
:ivar can_undelete_reason: The reason why this table can not be restored in same account.
:vartype can_undelete_reason: str
:ivar event_timestamp: The time when this table event happened.
:vartype event_timestamp: str
:ivar owner_id: The name of this Table.
:vartype owner_id: str
:ivar owner_resource_id: The resource ID of this Table.
:vartype owner_resource_id: str
"""
_validation = {
"rid": {"readonly": True},
"operation_type": {"readonly": True},
"can_undelete": {"readonly": True},
"can_undelete_reason": {"readonly": True},
"event_timestamp": {"readonly": True},
"owner_id": {"readonly": True},
"owner_resource_id": {"readonly": True},
}
_attribute_map = {
"rid": {"key": "_rid", "type": "str"},
"operation_type": {"key": "operationType", "type": "str"},
"can_undelete": {"key": "canUndelete", "type": "str"},
"can_undelete_reason": {"key": "canUndeleteReason", "type": "str"},
"event_timestamp": {"key": "eventTimestamp", "type": "str"},
"owner_id": {"key": "ownerId", "type": "str"},
"owner_resource_id": {"key": "ownerResourceId", "type": "str"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.rid = None
self.operation_type = None
self.can_undelete = None
self.can_undelete_reason = None
self.event_timestamp = None
self.owner_id = None
self.owner_resource_id = None
|
class RestorableTablePropertiesResource(_serialization.Model):
'''The resource of an Azure Cosmos DB Table event.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar operation_type: The operation type of this table event. Known values are: "Create",
"Replace", "Delete", "Recreate", and "SystemOperation".
:vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType
:ivar can_undelete: A state of this table to identify if this table is restorable in same
account.
:vartype can_undelete: str
:ivar can_undelete_reason: The reason why this table can not be restored in same account.
:vartype can_undelete_reason: str
:ivar event_timestamp: The time when this table event happened.
:vartype event_timestamp: str
:ivar owner_id: The name of this Table.
:vartype owner_id: str
:ivar owner_resource_id: The resource ID of this Table.
:vartype owner_resource_id: str
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 10 | 0 | 9 | 1 | 1 | 0.71 | 1 | 2 | 0 | 0 | 1 | 7 | 1 | 16 | 53 | 5 | 28 | 11 | 26 | 20 | 12 | 11 | 10 | 1 | 2 | 0 | 1 |
10,662 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableTableResourcesGetResult
|
class RestorableTableResourcesGetResult(_serialization.Model):
"""Specific Databases to restore.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the Table.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.id = None
self.name = None
self.type = None
|
class RestorableTableResourcesGetResult(_serialization.Model):
'''Specific Databases to restore.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the Table.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 6 | 0 | 5 | 1 | 1 | 0.63 | 1 | 2 | 0 | 0 | 1 | 3 | 1 | 16 | 31 | 5 | 16 | 7 | 14 | 10 | 8 | 7 | 6 | 1 | 2 | 0 | 1 |
10,663 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableTableResourcesListResult
|
class RestorableTableResourcesListResult(_serialization.Model):
"""List of restorable table names.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of restorable table names.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableTableResourcesGetResult]
"""
_validation = {
"value": {"readonly": True},
}
_attribute_map = {
"value": {"key": "value", "type": "[RestorableTableResourcesGetResult]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.value = None
|
class RestorableTableResourcesListResult(_serialization.Model):
'''List of restorable table names.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of restorable table names.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableTableResourcesGetResult]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 4 | 0 | 3 | 1 | 1 | 0.6 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 21 | 5 | 10 | 5 | 8 | 6 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,664 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableTablesListResult
|
class RestorableTablesListResult(_serialization.Model):
"""The List operation response, that contains the Table events and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of Table events and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableTableGetResult]
"""
_validation = {
"value": {"readonly": True},
}
_attribute_map = {
"value": {"key": "value", "type": "[RestorableTableGetResult]"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.value = None
|
class RestorableTablesListResult(_serialization.Model):
'''The List operation response, that contains the Table events and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of Table events and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableTableGetResult]
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 4 | 0 | 3 | 1 | 1 | 0.6 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 21 | 5 | 10 | 5 | 8 | 6 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
10,665 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.RestorableSqlDatabasePropertiesResourceDatabase
|
class RestorableSqlDatabasePropertiesResourceDatabase(
SqlDatabaseResource, ExtendedResourceProperties
): # pylint: disable=name-too-long
"""Cosmos DB SQL database resource object.
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 server.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar ts: A system generated property that denotes the last updated timestamp of the resource.
:vartype ts: float
:ivar etag: A system generated property representing the resource etag required for optimistic
concurrency control.
:vartype etag: str
:ivar id: Name of the Cosmos DB SQL database. Required.
:vartype id: str
:ivar restore_parameters: Parameters to indicate the information about the restore.
:vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default"
and "Restore".
:vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:ivar colls: A system generated property that specified the addressable path of the collections
resource.
:vartype colls: str
:ivar users: A system generated property that specifies the addressable path of the users
resource.
:vartype users: str
:ivar self_property: A system generated property that specifies the addressable path of the
database resource.
:vartype self_property: str
"""
_validation = {
"rid": {"readonly": True},
"ts": {"readonly": True},
"etag": {"readonly": True},
"id": {"required": True},
"colls": {"readonly": True},
"users": {"readonly": True},
"self_property": {"readonly": True},
}
_attribute_map = {
"rid": {"key": "_rid", "type": "str"},
"ts": {"key": "_ts", "type": "float"},
"etag": {"key": "_etag", "type": "str"},
"id": {"key": "id", "type": "str"},
"restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"},
"create_mode": {"key": "createMode", "type": "str"},
"colls": {"key": "_colls", "type": "str"},
"users": {"key": "_users", "type": "str"},
"self_property": {"key": "_self", "type": "str"},
}
def __init__(
self,
*,
id: str, # pylint: disable=redefined-builtin
restore_parameters: Optional["_models.ResourceRestoreParameters"] = None,
create_mode: Union[str, "_models.CreateMode"] = "Default",
**kwargs: Any
) -> None:
"""
:keyword id: Name of the Cosmos DB SQL database. Required.
:paramtype id: str
:keyword restore_parameters: Parameters to indicate the information about the restore.
:paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:keyword create_mode: Enum to indicate the mode of resource creation. Known values are:
"Default" and "Restore".
:paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
"""
super().__init__(id=id, restore_parameters=restore_parameters, create_mode=create_mode, **kwargs)
self.rid = None
self.ts = None
self.etag = None
self.colls = None
self.users = None
self.self_property = None
self.id = id
self.restore_parameters = restore_parameters
self.create_mode = create_mode
|
class RestorableSqlDatabasePropertiesResourceDatabase(
SqlDatabaseResource, ExtendedResourceProperties
):
'''Cosmos DB SQL database resource object.
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 server.
:ivar rid: A system generated property. A unique identifier.
:vartype rid: str
:ivar ts: A system generated property that denotes the last updated timestamp of the resource.
:vartype ts: float
:ivar etag: A system generated property representing the resource etag required for optimistic
concurrency control.
:vartype etag: str
:ivar id: Name of the Cosmos DB SQL database. Required.
:vartype id: str
:ivar restore_parameters: Parameters to indicate the information about the restore.
:vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default"
and "Restore".
:vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
:ivar colls: A system generated property that specified the addressable path of the collections
resource.
:vartype colls: str
:ivar users: A system generated property that specifies the addressable path of the users
resource.
:vartype users: str
:ivar self_property: A system generated property that specifies the addressable path of the
database resource.
:vartype self_property: str
'''
def __init__(
self,
*,
id: str, # pylint: disable=redefined-builtin
restore_parameters: Optional["_models.ResourceRestoreParameters"] = None,
create_mode: Union[str, "_models.CreateMode"] = "Default",
**kwargs: Any
) -> None:
'''
:keyword id: Name of the Cosmos DB SQL database. Required.
:paramtype id: str
:keyword restore_parameters: Parameters to indicate the information about the restore.
:paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters
:keyword create_mode: Enum to indicate the mode of resource creation. Known values are:
"Default" and "Restore".
:paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode
'''
pass
| 2 | 2 | 27 | 0 | 18 | 10 | 1 | 0.93 | 2 | 3 | 0 | 0 | 1 | 9 | 1 | 18 | 83 | 6 | 41 | 22 | 30 | 38 | 14 | 13 | 12 | 1 | 3 | 0 | 1 |
10,666 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_application_live_views_operations.py
|
azext_spring.vendored_sdks.appplatform.v2024_05_01_preview.aio.operations._application_live_views_operations.ApplicationLiveViewsOperations
|
class ApplicationLiveViewsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s
:attr:`application_live_views` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.ApplicationLiveViewResource"]:
"""Handles requests to list all resources in a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either ApplicationLiveViewResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
cls: ClsType[_models.ApplicationLiveViewResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("ApplicationLiveViewResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any
) -> _models.ApplicationLiveViewResource:
"""Get the Application Live and its properties.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_live_view_name: The name of Application Live View. Required.
:type application_live_view_name: str
:return: ApplicationLiveViewResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_live_view_name=application_live_view_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
application_live_view_name: str,
application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]],
**kwargs: Any
) -> _models.ApplicationLiveViewResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(application_live_view_resource, (IOBase, bytes)):
_content = application_live_view_resource
else:
_json = self._serialize.body(application_live_view_resource, "ApplicationLiveViewResource")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_live_view_name=application_live_view_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_live_view_name: str,
application_live_view_resource: _models.ApplicationLiveViewResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationLiveViewResource]:
"""Create the default Application Live View or update the existing Application Live View.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_live_view_name: The name of Application Live View. Required.
:type application_live_view_name: str
:param application_live_view_resource: Parameters for the update operation. Required.
:type application_live_view_resource:
~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_live_view_name: str,
application_live_view_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationLiveViewResource]:
"""Create the default Application Live View or update the existing Application Live View.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_live_view_name: The name of Application Live View. Required.
:type application_live_view_name: str
:param application_live_view_resource: Parameters for the update operation. Required.
:type application_live_view_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_live_view_name: str,
application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationLiveViewResource]:
"""Create the default Application Live View or update the existing Application Live View.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_live_view_name: The name of Application Live View. Required.
:type application_live_view_name: str
:param application_live_view_resource: Parameters for the update operation. Is either a
ApplicationLiveViewResource type or a IO[bytes] type. Required.
:type application_live_view_resource:
~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ApplicationLiveViewResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
application_live_view_name=application_live_view_name,
application_live_view_resource=application_live_view_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ApplicationLiveViewResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.ApplicationLiveViewResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.ApplicationLiveViewResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_live_view_name=application_live_view_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Disable the default Application Live View.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_live_view_name: The name of Application Live View. Required.
:type application_live_view_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
application_live_view_name=application_live_view_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method)
|
class ApplicationLiveViewsOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s
:attr:`application_live_views` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.ApplicationLiveViewResource"]:
'''Handles requests to list all resources in a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either ApplicationLiveViewResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
@distributed_trace_async
async def get_next(next_link=None):
'''Get the Application Live and its properties.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_live_view_name: The name of Application Live View. Required.
:type application_live_view_name: str
:return: ApplicationLiveViewResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
application_live_view_name: str,
application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]],
**kwargs: Any
) -> _models.ApplicationLiveViewResource:
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_live_view_name: str,
application_live_view_resource: _models.ApplicationLiveViewResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationLiveViewResource]:
'''Create the default Application Live View or update the existing Application Live View.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_live_view_name: The name of Application Live View. Required.
:type application_live_view_name: str
:param application_live_view_resource: Parameters for the update operation. Required.
:type application_live_view_resource:
~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_live_view_name: str,
application_live_view_resource: _models.ApplicationLiveViewResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationLiveViewResource]:
'''Create the default Application Live View or update the existing Application Live View.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_live_view_name: The name of Application Live View. Required.
:type application_live_view_name: str
:param application_live_view_resource: Parameters for the update operation. Required.
:type application_live_view_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_live_view_name: str,
application_live_view_resource: _models.ApplicationLiveViewResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationLiveViewResource]:
'''Create the default Application Live View or update the existing Application Live View.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_live_view_name: The name of Application Live View. Required.
:type application_live_view_name: str
:param application_live_view_resource: Parameters for the update operation. Is either a
ApplicationLiveViewResource type or a IO[bytes] type. Required.
:type application_live_view_resource:
~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ApplicationLiveViewResource or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationLiveViewResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, application_live_view_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Disable the default Application Live View.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_live_view_name: The name of Application Live View. Required.
:type application_live_view_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
| 21 | 7 | 37 | 4 | 27 | 8 | 3 | 0.36 | 0 | 7 | 0 | 0 | 9 | 5 | 9 | 9 | 491 | 62 | 328 | 135 | 267 | 118 | 163 | 89 | 148 | 6 | 0 | 1 | 42 |
10,667 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_application_accelerators_operations.py
|
azext_spring.vendored_sdks.appplatform.v2024_05_01_preview.aio.operations._application_accelerators_operations.ApplicationAcceleratorsOperations
|
class ApplicationAcceleratorsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s
:attr:`application_accelerators` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.ApplicationAcceleratorResource"]:
"""Handle requests to list all application accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either ApplicationAcceleratorResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
cls: ClsType[_models.ApplicationAcceleratorResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("ApplicationAcceleratorResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any
) -> _models.ApplicationAcceleratorResource:
"""Get the application accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:return: ApplicationAcceleratorResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]],
**kwargs: Any
) -> _models.ApplicationAcceleratorResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(application_accelerator_resource, (IOBase, bytes)):
_content = application_accelerator_resource
else:
_json = self._serialize.body(application_accelerator_resource, "ApplicationAcceleratorResource")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
application_accelerator_resource: _models.ApplicationAcceleratorResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]:
"""Create or update the application accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param application_accelerator_resource: The application accelerator for the create or update
operation. Required.
:type application_accelerator_resource:
~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or
the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
application_accelerator_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]:
"""Create or update the application accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param application_accelerator_resource: The application accelerator for the create or update
operation. Required.
:type application_accelerator_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or
the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]:
"""Create or update the application accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param application_accelerator_resource: The application accelerator for the create or update
operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required.
:type application_accelerator_resource:
~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or
the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ApplicationAcceleratorResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
application_accelerator_resource=application_accelerator_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ApplicationAcceleratorResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.ApplicationAcceleratorResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.ApplicationAcceleratorResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Delete the application accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method)
|
class ApplicationAcceleratorsOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s
:attr:`application_accelerators` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> AsyncIterable["_models.ApplicationAcceleratorResource"]:
'''Handle requests to list all application accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either ApplicationAcceleratorResource or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
@distributed_trace_async
async def get_next(next_link=None):
'''Get the application accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:return: ApplicationAcceleratorResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]],
**kwargs: Any
) -> _models.ApplicationAcceleratorResource:
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
application_accelerator_resource: _models.ApplicationAcceleratorResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]:
'''Create or update the application accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param application_accelerator_resource: The application accelerator for the create or update
operation. Required.
:type application_accelerator_resource:
~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or
the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
application_accelerator_resource: _models.ApplicationAcceleratorResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]:
'''Create or update the application accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param application_accelerator_resource: The application accelerator for the create or update
operation. Required.
:type application_accelerator_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or
the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
application_accelerator_resource: _models.ApplicationAcceleratorResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationAcceleratorResource]:
'''Create or update the application accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param application_accelerator_resource: The application accelerator for the create or update
operation. Is either a ApplicationAcceleratorResource type or a IO[bytes] type. Required.
:type application_accelerator_resource:
~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ApplicationAcceleratorResource or
the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApplicationAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Delete the application accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
| 21 | 7 | 38 | 4 | 27 | 9 | 3 | 0.37 | 0 | 7 | 0 | 0 | 9 | 5 | 9 | 9 | 493 | 62 | 328 | 135 | 267 | 120 | 163 | 89 | 148 | 6 | 0 | 1 | 42 |
10,668 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2024_05_01_preview/aio/operations/_apms_operations.py
|
azext_spring.vendored_sdks.appplatform.v2024_05_01_preview.aio.operations._apms_operations.ApmsOperations
|
class ApmsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s
:attr:`apms` attribute.
"""
models = _models
def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.ApmResource"]:
"""Get collection of APMs.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either ApmResource or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
cls: ClsType[_models.ApmResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
async def extract_data(pipeline_response):
deserialized = self._deserialize("ApmResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
@distributed_trace_async
async def get(
self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any
) -> _models.ApmResource:
"""Get the APM by name.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm_name: The name of the APM. Required.
:type apm_name: str
:return: ApmResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
apm_name=apm_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("ApmResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
apm_name: str,
apm_resource: Union[_models.ApmResource, IO[bytes]],
**kwargs: Any
) -> _models.ApmResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(apm_resource, (IOBase, bytes)):
_content = apm_resource
else:
_json = self._serialize.body(apm_resource, "ApmResource")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
apm_name=apm_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("ApmResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("ApmResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
apm_name: str,
apm_resource: _models.ApmResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApmResource]:
"""Create or update an APM.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm_name: The name of the APM. Required.
:type apm_name: str
:param apm_resource: Parameters for the create or update operation. Required.
:type apm_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ApmResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
apm_name: str,
apm_resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApmResource]:
"""Create or update an APM.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm_name: The name of the APM. Required.
:type apm_name: str
:param apm_resource: Parameters for the create or update operation. Required.
:type apm_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ApmResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
apm_name: str,
apm_resource: Union[_models.ApmResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.ApmResource]:
"""Create or update an APM.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm_name: The name of the APM. Required.
:type apm_name: str
:param apm_resource: Parameters for the create or update operation. Is either a ApmResource
type or a IO[bytes] type. Required.
:type apm_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ApmResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ApmResource] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
apm_name=apm_name,
apm_resource=apm_resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ApmResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[_models.ApmResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[_models.ApmResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
apm_name=apm_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
"""Operation to delete an APM.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm_name: The name of the APM. Required.
:type apm_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = await self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
apm_name=apm_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: AsyncPollingMethod = cast(
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
)
elif polling is False:
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
else:
polling_method = polling
if cont_token:
return AsyncLROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
@distributed_trace_async
async def list_secret_keys(
self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any
) -> _models.ApmSecretKeys:
"""List keys of APM sensitive properties.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm_name: The name of the APM. Required.
:type apm_name: str
:return: ApmSecretKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmSecretKeys
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop(
"api_version", _params.pop("api-version", self._api_version or "2024-05-01-preview")
)
cls: ClsType[_models.ApmSecretKeys] = kwargs.pop("cls", None)
_request = build_list_secret_keys_request(
resource_group_name=resource_group_name,
service_name=service_name,
apm_name=apm_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("ApmSecretKeys", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
|
class ApmsOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2024_05_01_preview.aio.AppPlatformManagementClient`'s
:attr:`apms` attribute.
'''
def __init__(self, *args, **kwargs) -> None:
pass
@distributed_trace
def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterable["_models.ApmResource"]:
'''Get collection of APMs.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either ApmResource or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
@distributed_trace_async
async def get_next(next_link=None):
'''Get the APM by name.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm_name: The name of the APM. Required.
:type apm_name: str
:return: ApmResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
async def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
apm_name: str,
apm_resource: Union[_models.ApmResource, IO[bytes]],
**kwargs: Any
) -> _models.ApmResource:
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
apm_name: str,
apm_resource: _models.ApmResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApmResource]:
'''Create or update an APM.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm_name: The name of the APM. Required.
:type apm_name: str
:param apm_resource: Parameters for the create or update operation. Required.
:type apm_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ApmResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
apm_name: str,
apm_resource: _models.ApmResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApmResource]:
'''Create or update an APM.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm_name: The name of the APM. Required.
:type apm_name: str
:param apm_resource: Parameters for the create or update operation. Required.
:type apm_resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of AsyncLROPoller that returns either ApmResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace_async
async def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
apm_name: str,
apm_resource: _models.ApmResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApmResource]:
'''Create or update an APM.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm_name: The name of the APM. Required.
:type apm_name: str
:param apm_resource: Parameters for the create or update operation. Is either a ApmResource
type or a IO[bytes] type. Required.
:type apm_resource: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource or IO[bytes]
:return: An instance of AsyncLROPoller that returns either ApmResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
async def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace_async
async def begin_delete(
self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
'''Operation to delete an APM.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm_name: The name of the APM. Required.
:type apm_name: str
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@distributed_trace_async
async def list_secret_keys(
self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any
) -> _models.ApmSecretKeys:
'''List keys of APM sensitive properties.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm_name: The name of the APM. Required.
:type apm_name: str
:return: ApmSecretKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2024_05_01_preview.models.ApmSecretKeys
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
| 23 | 8 | 39 | 4 | 27 | 9 | 3 | 0.35 | 0 | 7 | 0 | 0 | 10 | 5 | 10 | 10 | 551 | 73 | 368 | 147 | 305 | 130 | 183 | 100 | 167 | 6 | 0 | 1 | 45 |
10,669 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_operations.py
|
azext_costmanagement.vendored_sdks.costmanagement.aio.operations._operations.Operations
|
class Operations:
"""Operations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def list(
self,
**kwargs
) -> AsyncIterable["_models.OperationListResult"]:
"""Lists all of the available cost management REST API operations.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either OperationListResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.OperationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('OperationListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(
get_next, extract_data
)
list.metadata = {'url': '/providers/Microsoft.CostManagement/operations'}
|
class Operations:
'''Operations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer) -> None:
pass
def list(
self,
**kwargs
) -> AsyncIterable["_models.OperationListResult"]:
'''Lists all of the available cost management REST API operations.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either OperationListResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.OperationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
| 6 | 2 | 20 | 3 | 15 | 4 | 2 | 0.5 | 0 | 0 | 0 | 0 | 2 | 4 | 2 | 2 | 84 | 15 | 50 | 28 | 41 | 25 | 42 | 25 | 36 | 2 | 0 | 1 | 8 |
10,670 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_query_operations.py
|
azext_costmanagement.vendored_sdks.costmanagement.aio.operations._query_operations.QueryOperations
|
class QueryOperations:
"""QueryOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
async def usage(
self,
scope: str,
parameters: "_models.QueryDefinition",
**kwargs
) -> "_models.QueryResult":
"""Query the usage data for scope defined.
:param scope: The scope associated with query and export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param parameters: Parameters supplied to the CreateOrUpdate Query Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.QueryDefinition
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.QueryResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.usage.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'QueryDefinition')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('QueryResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/query'} # type: ignore
async def usage_by_external_cloud_provider_type(
self,
external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"],
external_cloud_provider_id: str,
parameters: "_models.QueryDefinition",
**kwargs
) -> "_models.QueryResult":
"""Query the usage data for external cloud provider type defined.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account.
:type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:param parameters: Parameters supplied to the CreateOrUpdate Query Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.QueryDefinition
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.QueryResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.usage_by_external_cloud_provider_type.metadata['url'] # type: ignore
path_format_arguments = {
'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'),
'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'QueryDefinition')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('QueryResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
usage_by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query'}
|
class QueryOperations:
'''QueryOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer) -> None:
pass
async def usage(
self,
scope: str,
parameters: "_models.QueryDefinition",
**kwargs
) -> "_models.QueryResult":
'''Query the usage data for scope defined.
:param scope: The scope associated with query and export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param parameters: Parameters supplied to the CreateOrUpdate Query Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.QueryDefinition
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def usage_by_external_cloud_provider_type(
self,
external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"],
external_cloud_provider_id: str,
parameters: "_models.QueryDefinition",
**kwargs
) -> "_models.QueryResult":
'''Query the usage data for external cloud provider type defined.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account.
:type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:param parameters: Parameters supplied to the CreateOrUpdate Query Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.QueryDefinition
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
| 4 | 3 | 49 | 6 | 28 | 19 | 2 | 0.78 | 0 | 1 | 0 | 0 | 3 | 4 | 3 | 3 | 167 | 24 | 87 | 52 | 72 | 68 | 67 | 41 | 63 | 3 | 0 | 1 | 7 |
10,671 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_views_operations.py
|
azext_costmanagement.vendored_sdks.costmanagement.aio.operations._views_operations.ViewsOperations
|
class ViewsOperations:
"""ViewsOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def list(
self,
**kwargs
) -> AsyncIterable["_models.ViewListResult"]:
"""Lists all views by tenant and object.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ViewListResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.ViewListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ViewListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('ViewListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(
get_next, extract_data
)
list.metadata = {'url': '/providers/Microsoft.CostManagement/views'} # type: ignore
def list_by_scope(
self,
scope: str,
**kwargs
) -> AsyncIterable["_models.ViewListResult"]:
"""Lists all views at the given scope.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ViewListResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.ViewListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ViewListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list_by_scope.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('ViewListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(
get_next, extract_data
)
list_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views'} # type: ignore
async def get(
self,
view_name: str,
**kwargs
) -> "_models.View":
"""Gets the view by view name.
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.View"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'viewName': self._serialize.url("view_name", view_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('View', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore
async def create_or_update(
self,
view_name: str,
parameters: "_models.View",
**kwargs
) -> "_models.View":
"""The operation to create or update a view. Update operation requires latest eTag to be set in
the request. You may obtain the latest eTag by performing a get operation. Create operation
does not require eTag.
:param view_name: View name.
:type view_name: str
:param parameters: Parameters supplied to the CreateOrUpdate View operation.
:type parameters: ~azure.mgmt.costmanagement.models.View
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.View"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.create_or_update.metadata['url'] # type: ignore
path_format_arguments = {
'viewName': self._serialize.url("view_name", view_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'View')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('View', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('View', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore
async def delete(
self,
view_name: str,
**kwargs
) -> None:
"""The operation to delete a view.
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.delete.metadata['url'] # type: ignore
path_format_arguments = {
'viewName': self._serialize.url("view_name", view_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
delete.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore
async def get_by_scope(
self,
scope: str,
view_name: str,
**kwargs
) -> "_models.View":
"""Gets the view for the defined scope by view name.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.View"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.get_by_scope.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str'),
'viewName': self._serialize.url("view_name", view_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('View', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore
async def create_or_update_by_scope(
self,
scope: str,
view_name: str,
parameters: "_models.View",
**kwargs
) -> "_models.View":
"""The operation to create or update a view. Update operation requires latest eTag to be set in
the request. You may obtain the latest eTag by performing a get operation. Create operation
does not require eTag.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:param view_name: View name.
:type view_name: str
:param parameters: Parameters supplied to the CreateOrUpdate View operation.
:type parameters: ~azure.mgmt.costmanagement.models.View
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.View"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.create_or_update_by_scope.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str'),
'viewName': self._serialize.url("view_name", view_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'View')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('View', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('View', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
create_or_update_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore
async def delete_by_scope(
self,
scope: str,
view_name: str,
**kwargs
) -> None:
"""The operation to delete a view.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.delete_by_scope.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str'),
'viewName': self._serialize.url("view_name", view_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
delete_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'}
|
class ViewsOperations:
'''ViewsOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer) -> None:
pass
def list(
self,
**kwargs
) -> AsyncIterable["_models.ViewListResult"]:
'''Lists all views by tenant and object.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ViewListResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.ViewListResult]
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
def list_by_scope(
self,
scope: str,
**kwargs
) -> AsyncIterable["_models.ViewListResult"]:
'''Lists all views at the given scope.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ViewListResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.ViewListResult]
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
def prepare_request(next_link=None):
pass
async def extract_data(pipeline_response):
pass
async def get_next(next_link=None):
pass
async def get_next(next_link=None):
'''Gets the view by view name.
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def create_or_update(
self,
view_name: str,
parameters: "_models.View",
**kwargs
) -> "_models.View":
'''The operation to create or update a view. Update operation requires latest eTag to be set in
the request. You may obtain the latest eTag by performing a get operation. Create operation
does not require eTag.
:param view_name: View name.
:type view_name: str
:param parameters: Parameters supplied to the CreateOrUpdate View operation.
:type parameters: ~azure.mgmt.costmanagement.models.View
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def delete(
self,
view_name: str,
**kwargs
) -> None:
'''The operation to delete a view.
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def get_by_scope(
self,
scope: str,
view_name: str,
**kwargs
) -> "_models.View":
'''Gets the view for the defined scope by view name.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def create_or_update_by_scope(
self,
scope: str,
view_name: str,
parameters: "_models.View",
**kwargs
) -> "_models.View":
'''The operation to create or update a view. Update operation requires latest eTag to be set in
the request. You may obtain the latest eTag by performing a get operation. Create operation
does not require eTag.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:param view_name: View name.
:type view_name: str
:param parameters: Parameters supplied to the CreateOrUpdate View operation.
:type parameters: ~azure.mgmt.costmanagement.models.View
:keyword callable cls: A custom type or function that will be passed the direct response
:return: View, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.View
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def delete_by_scope(
self,
scope: str,
view_name: str,
**kwargs
) -> None:
'''The operation to delete a view.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for
Department scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for BillingProfile scope,
'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
for Management Group scope,
'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for
External Billing Account scope and
'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for
External Subscription scope.
:type scope: str
:param view_name: View name.
:type view_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
| 16 | 9 | 41 | 5 | 24 | 14 | 2 | 0.69 | 0 | 1 | 0 | 0 | 9 | 4 | 9 | 9 | 576 | 86 | 316 | 168 | 264 | 218 | 241 | 132 | 225 | 5 | 0 | 1 | 37 |
10,672 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_cost_management_client_enums.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._cost_management_client_enums.AccumulatedType
|
class AccumulatedType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Show costs accumulated over time.
"""
TRUE = "true"
FALSE = "false"
|
class AccumulatedType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
'''Show costs accumulated over time.
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.67 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 1 | 3 | 3 | 2 | 2 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
10,673 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_cost_management_client_enums.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._cost_management_client_enums.AlertCategory
|
class AlertCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Alert category
"""
COST = "Cost"
USAGE = "Usage"
BILLING = "Billing"
SYSTEM = "System"
|
class AlertCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
'''Alert category
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.4 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 1 | 5 | 5 | 4 | 2 | 5 | 5 | 4 | 0 | 1 | 0 | 0 |
10,674 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_services_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.operations._services_operations.ServicesOperations
|
class ServicesOperations: # pylint: disable=too-many-public-methods
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.AppPlatformManagementClient`'s
:attr:`services` attribute.
"""
models = _models
def __init__(self, *args, **kwargs):
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.ServiceResource:
"""Get a Service and its properties.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: ServiceResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("ServiceResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
resource: Union[_models.ServiceResource, IO[bytes]],
**kwargs: Any
) -> _models.ServiceResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(resource, (IOBase, bytes)):
_content = resource
else:
_json = self._serialize.body(resource, "ServiceResource")
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("ServiceResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("ServiceResource", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("ServiceResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ServiceResource]:
"""Create a new Service or update an exiting Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the create or update operation. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ServiceResource]:
"""Create a new Service or update an exiting Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the create or update operation. Required.
:type resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
resource: Union[_models.ServiceResource, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.ServiceResource]:
"""Create a new Service or update an exiting Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the create or update operation. Is either a ServiceResource
type or a IO[bytes] type. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO[bytes]
:return: An instance of LROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
resource=resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ServiceResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[_models.ServiceResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[_models.ServiceResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]:
"""Operation to delete a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
def _update_initial(
self,
resource_group_name: str,
service_name: str,
resource: Union[_models.ServiceResource, IO[bytes]],
**kwargs: Any
) -> _models.ServiceResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(resource, (IOBase, bytes)):
_content = resource
else:
_json = self._serialize.body(resource, "ServiceResource")
_request = build_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("ServiceResource", pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize("ServiceResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
def begin_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ServiceResource]:
"""Operation to update an exiting Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the update operation. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
def begin_update(
self,
resource_group_name: str,
service_name: str,
resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ServiceResource]:
"""Operation to update an exiting Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the update operation. Required.
:type resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace
def begin_update(
self,
resource_group_name: str,
service_name: str,
resource: Union[_models.ServiceResource, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.ServiceResource]:
"""Operation to update an exiting Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the update operation. Is either a ServiceResource type or a
IO[bytes] type. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO[bytes]
:return: An instance of LROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
resource=resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ServiceResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[_models.ServiceResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[_models.ServiceResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
@distributed_trace
def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys:
"""List test keys for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None)
_request = build_list_test_keys_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("TestKeys", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@overload
def regenerate_test_key(
self,
resource_group_name: str,
service_name: str,
regenerate_test_key_request: _models.RegenerateTestKeyRequestPayload,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.TestKeys:
"""Regenerate a test key for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param regenerate_test_key_request: Parameters for the operation. Required.
:type regenerate_test_key_request:
~azure.mgmt.appplatform.v2023_12_01.models.RegenerateTestKeyRequestPayload
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
def regenerate_test_key(
self,
resource_group_name: str,
service_name: str,
regenerate_test_key_request: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.TestKeys:
"""Regenerate a test key for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param regenerate_test_key_request: Parameters for the operation. Required.
:type regenerate_test_key_request: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace
def regenerate_test_key(
self,
resource_group_name: str,
service_name: str,
regenerate_test_key_request: Union[_models.RegenerateTestKeyRequestPayload, IO[bytes]],
**kwargs: Any
) -> _models.TestKeys:
"""Regenerate a test key for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param regenerate_test_key_request: Parameters for the operation. Is either a
RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required.
:type regenerate_test_key_request:
~azure.mgmt.appplatform.v2023_12_01.models.RegenerateTestKeyRequestPayload or IO[bytes]
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(regenerate_test_key_request, (IOBase, bytes)):
_content = regenerate_test_key_request
else:
_json = self._serialize.body(regenerate_test_key_request, "RegenerateTestKeyRequestPayload")
_request = build_regenerate_test_key_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("TestKeys", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace
def disable_test_endpoint( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
"""Disable test endpoint functionality for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_disable_test_endpoint_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys:
"""Enable test endpoint functionality for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.TestKeys] = kwargs.pop("cls", None)
_request = build_enable_test_endpoint_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("TestKeys", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
def _stop_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
304: ResourceNotModifiedError,
404: lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat),
409: lambda response: ResourceExistsError(response=response, error_format=ARMErrorFormat),
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_stop_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202]:
map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]:
"""Stop a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._stop_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
def _start_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
304: ResourceNotModifiedError,
404: lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat),
409: lambda response: ResourceExistsError(response=response, error_format=ARMErrorFormat),
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_start_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202]:
map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]:
"""Start a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._start_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_flush_vnet_dns_setting_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@distributed_trace
def begin_flush_vnet_dns_setting(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> LROPoller[None]:
"""Flush Virtual Network DNS settings for a VNET injected Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._flush_vnet_dns_setting_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(
PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
)
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
@distributed_trace
def list_supported_apm_types(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> Iterable["_models.SupportedApmType"]:
"""List supported APM types for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either SupportedApmType or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.SupportedApmType]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.SupportedApmTypes] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_supported_apm_types_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("SupportedApmTypes", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(get_next, extract_data)
@distributed_trace
def list_globally_enabled_apms(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> _models.GloballyEnabledApms:
"""List globally enabled APMs for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: GloballyEnabledApms or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GloballyEnabledApms
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.GloballyEnabledApms] = kwargs.pop("cls", None)
_request = build_list_globally_enabled_apms_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("GloballyEnabledApms", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(apm, (IOBase, bytes)):
_content = apm
else:
_json = self._serialize.body(apm, "ApmReference")
_request = build_enable_apm_globally_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@overload
def begin_enable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[None]:
"""Enable an APM globally.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the enable operation. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
def begin_enable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[None]:
"""Enable an APM globally.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the enable operation. Required.
:type apm: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace
def begin_enable_apm_globally(
self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any
) -> LROPoller[None]:
"""Enable an APM globally.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the enable operation. Is either a ApmReference type or a
IO[bytes] type. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO[bytes]
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._enable_apm_globally_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
apm=apm,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(
PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs)
)
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(apm, (IOBase, bytes)):
_content = apm
else:
_json = self._serialize.body(apm, "ApmReference")
_request = build_disable_apm_globally_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@overload
def begin_disable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[None]:
"""Disable an APM globally.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the disable operation. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
def begin_disable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[None]:
"""Disable an APM globally.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the disable operation. Required.
:type apm: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace
def begin_disable_apm_globally(
self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any
) -> LROPoller[None]:
"""Disable an APM globally.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the disable operation. Is either a ApmReference type or a
IO[bytes] type. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO[bytes]
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._disable_apm_globally_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
apm=apm,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(
PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs)
)
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
@overload
def check_name_availability(
self,
location: str,
availability_parameters: _models.NameAvailabilityParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.NameAvailability:
"""Checks that the resource name is valid and is not already in use.
:param location: the region. Required.
:type location: str
:param availability_parameters: Parameters supplied to the operation. Required.
:type availability_parameters:
~azure.mgmt.appplatform.v2023_12_01.models.NameAvailabilityParameters
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: NameAvailability or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
def check_name_availability(
self,
location: str,
availability_parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.NameAvailability:
"""Checks that the resource name is valid and is not already in use.
:param location: the region. Required.
:type location: str
:param availability_parameters: Parameters supplied to the operation. Required.
:type availability_parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: NameAvailability or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace
def check_name_availability(
self,
location: str,
availability_parameters: Union[_models.NameAvailabilityParameters, IO[bytes]],
**kwargs: Any
) -> _models.NameAvailability:
"""Checks that the resource name is valid and is not already in use.
:param location: the region. Required.
:type location: str
:param availability_parameters: Parameters supplied to the operation. Is either a
NameAvailabilityParameters type or a IO[bytes] type. Required.
:type availability_parameters:
~azure.mgmt.appplatform.v2023_12_01.models.NameAvailabilityParameters or IO[bytes]
:return: NameAvailability or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.NameAvailability] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(availability_parameters, (IOBase, bytes)):
_content = availability_parameters
else:
_json = self._serialize.body(availability_parameters, "NameAvailabilityParameters")
_request = build_check_name_availability_request(
location=location,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("NameAvailability", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace
def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]:
"""Handles requests to list all resources in a subscription.
:return: An iterator like instance of either ServiceResource or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_by_subscription_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("ServiceResourceList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(get_next, extract_data)
@distributed_trace
def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ServiceResource"]:
"""Handles requests to list all resources in a resource group.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:return: An iterator like instance of either ServiceResource or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("ServiceResourceList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(get_next, extract_data)
@distributed_trace
def list_supported_server_versions(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> Iterable["_models.SupportedServerVersion"]:
"""Lists all of the available server versions supported by Microsoft.AppPlatform provider.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either SupportedServerVersion or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.SupportedServerVersion]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.SupportedServerVersions] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_supported_server_versions_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("SupportedServerVersions", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(get_next, extract_data)
|
class ServicesOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.AppPlatformManagementClient`'s
:attr:`services` attribute.
'''
def __init__(self, *args, **kwargs):
pass
@distributed_trace
def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.ServiceResource:
'''Get a Service and its properties.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: ServiceResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def _create_or_update_initial(
self,
resource_group_name: str,
service_name: str,
resource: Union[_models.ServiceResource, IO[bytes]],
**kwargs: Any
) -> _models.ServiceResource:
pass
@overload
def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ServiceResource]:
'''Create a new Service or update an exiting Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the create or update operation. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ServiceResource]:
'''Create a new Service or update an exiting Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the create or update operation. Required.
:type resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace
def begin_create_or_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ServiceResource]:
'''Create a new Service or update an exiting Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the create or update operation. Is either a ServiceResource
type or a IO[bytes] type. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO[bytes]
:return: An instance of LROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace
def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]:
'''Operation to delete a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
def _update_initial(
self,
resource_group_name: str,
service_name: str,
resource: Union[_models.ServiceResource, IO[bytes]],
**kwargs: Any
) -> _models.ServiceResource:
pass
@overload
def begin_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ServiceResource]:
'''Operation to update an exiting Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the update operation. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
def begin_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ServiceResource]:
'''Operation to update an exiting Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the update operation. Required.
:type resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace
def begin_update(
self,
resource_group_name: str,
service_name: str,
resource: _models.ServiceResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ServiceResource]:
'''Operation to update an exiting Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param resource: Parameters for the update operation. Is either a ServiceResource type or a
IO[bytes] type. Required.
:type resource: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource or IO[bytes]
:return: An instance of LROPoller that returns either ServiceResource or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@distributed_trace
def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys:
'''List test keys for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
def regenerate_test_key(
self,
resource_group_name: str,
service_name: str,
regenerate_test_key_request: _models.RegenerateTestKeyRequestPayload,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.TestKeys:
'''Regenerate a test key for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param regenerate_test_key_request: Parameters for the operation. Required.
:type regenerate_test_key_request:
~azure.mgmt.appplatform.v2023_12_01.models.RegenerateTestKeyRequestPayload
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
def regenerate_test_key(
self,
resource_group_name: str,
service_name: str,
regenerate_test_key_request: _models.RegenerateTestKeyRequestPayload,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.TestKeys:
'''Regenerate a test key for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param regenerate_test_key_request: Parameters for the operation. Required.
:type regenerate_test_key_request: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace
def regenerate_test_key(
self,
resource_group_name: str,
service_name: str,
regenerate_test_key_request: _models.RegenerateTestKeyRequestPayload,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.TestKeys:
'''Regenerate a test key for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param regenerate_test_key_request: Parameters for the operation. Is either a
RegenerateTestKeyRequestPayload type or a IO[bytes] type. Required.
:type regenerate_test_key_request:
~azure.mgmt.appplatform.v2023_12_01.models.RegenerateTestKeyRequestPayload or IO[bytes]
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace
def disable_test_endpoint( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
'''Disable test endpoint functionality for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace
def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys:
'''Enable test endpoint functionality for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: TestKeys or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.TestKeys
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def _stop_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace
def begin_stop(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]:
'''Stop a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
def _start_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace
def begin_start(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]:
'''Start a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
def _flush_vnet_dns_setting_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace
def begin_flush_vnet_dns_setting(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> LROPoller[None]:
'''Flush Virtual Network DNS settings for a VNET injected Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@distributed_trace
def list_supported_apm_types(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> Iterable["_models.SupportedApmType"]:
'''List supported APM types for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either SupportedApmType or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.SupportedApmType]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
def extract_data(pipeline_response):
pass
def get_next(next_link=None):
pass
@distributed_trace
def list_globally_enabled_apms(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> _models.GloballyEnabledApms:
'''List globally enabled APMs for a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: GloballyEnabledApms or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.GloballyEnabledApms
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def _enable_apm_globally_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any
) -> None:
pass
@overload
def begin_enable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[None]:
'''Enable an APM globally.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the enable operation. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
def begin_enable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[None]:
'''Enable an APM globally.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the enable operation. Required.
:type apm: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace
def begin_enable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[None]:
'''Enable an APM globally.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the enable operation. Is either a ApmReference type or a
IO[bytes] type. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO[bytes]
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
def _disable_apm_globally_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any
) -> None:
pass
@overload
def begin_disable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[None]:
'''Disable an APM globally.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the disable operation. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
def begin_disable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[None]:
'''Disable an APM globally.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the disable operation. Required.
:type apm: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace
def begin_disable_apm_globally(
self,
resource_group_name: str,
service_name: str,
apm: _models.ApmReference,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[None]:
'''Disable an APM globally.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param apm: The target APM for the disable operation. Is either a ApmReference type or a
IO[bytes] type. Required.
:type apm: ~azure.mgmt.appplatform.v2023_12_01.models.ApmReference or IO[bytes]
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@overload
def check_name_availability(
self,
location: str,
availability_parameters: _models.NameAvailabilityParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.NameAvailability:
'''Checks that the resource name is valid and is not already in use.
:param location: the region. Required.
:type location: str
:param availability_parameters: Parameters supplied to the operation. Required.
:type availability_parameters:
~azure.mgmt.appplatform.v2023_12_01.models.NameAvailabilityParameters
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: NameAvailability or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
def check_name_availability(
self,
location: str,
availability_parameters: _models.NameAvailabilityParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.NameAvailability:
'''Checks that the resource name is valid and is not already in use.
:param location: the region. Required.
:type location: str
:param availability_parameters: Parameters supplied to the operation. Required.
:type availability_parameters: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: NameAvailability or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace
def check_name_availability(
self,
location: str,
availability_parameters: _models.NameAvailabilityParameters,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.NameAvailability:
'''Checks that the resource name is valid and is not already in use.
:param location: the region. Required.
:type location: str
:param availability_parameters: Parameters supplied to the operation. Is either a
NameAvailabilityParameters type or a IO[bytes] type. Required.
:type availability_parameters:
~azure.mgmt.appplatform.v2023_12_01.models.NameAvailabilityParameters or IO[bytes]
:return: NameAvailability or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.NameAvailability
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace
def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResource"]:
'''Handles requests to list all resources in a subscription.
:return: An iterator like instance of either ServiceResource or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
def extract_data(pipeline_response):
pass
def get_next(next_link=None):
pass
@distributed_trace
def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.TestKeys:
'''Handles requests to list all resources in a resource group.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:return: An iterator like instance of either ServiceResource or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
def extract_data(pipeline_response):
pass
def get_next(next_link=None):
pass
@distributed_trace
def list_supported_server_versions(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> Iterable["_models.SupportedServerVersion"]:
'''Lists all of the available server versions supported by Microsoft.AppPlatform provider.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either SupportedServerVersion or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.SupportedServerVersion]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
def extract_data(pipeline_response):
pass
def get_next(next_link=None):
pass
| 92 | 32 | 36 | 4 | 25 | 8 | 3 | 0.37 | 0 | 7 | 0 | 0 | 40 | 5 | 40 | 40 | 2,005 | 274 | 1,327 | 552 | 1,080 | 488 | 685 | 366 | 624 | 7 | 0 | 1 | 160 |
10,675 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_service_registries_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.operations._service_registries_operations.ServiceRegistriesOperations
|
class ServiceRegistriesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.AppPlatformManagementClient`'s
:attr:`service_registries` attribute.
"""
models = _models
def __init__(self, *args, **kwargs):
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def get(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> _models.ServiceRegistryResource:
"""Get the Service Registry and its properties.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param service_registry_name: The name of Service Registry. Required.
:type service_registry_name: str
:return: ServiceRegistryResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceRegistryResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
service_registry_name=service_registry_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("ServiceRegistryResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
def _create_or_update_initial(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> _models.ServiceRegistryResource:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None)
_request = build_create_or_update_request(
resource_group_name=resource_group_name,
service_name=service_name,
service_registry_name=service_registry_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize("ServiceRegistryResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("ServiceRegistryResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
@distributed_trace
def begin_create_or_update(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> LROPoller[_models.ServiceRegistryResource]:
"""Create the default Service Registry or update the existing Service Registry.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param service_registry_name: The name of Service Registry. Required.
:type service_registry_name: str
:return: An instance of LROPoller that returns either ServiceRegistryResource or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ServiceRegistryResource] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
service_name=service_name,
service_registry_name=service_registry_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("ServiceRegistryResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[_models.ServiceRegistryResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[_models.ServiceRegistryResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
service_name=service_name,
service_registry_name=service_registry_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
def begin_delete(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> LROPoller[None]:
"""Disable the default Service Registry.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param service_registry_name: The name of Service Registry. Required.
:type service_registry_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
service_registry_name=service_registry_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> Iterable["_models.ServiceRegistryResource"]:
"""Handles requests to list all resources in a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either ServiceRegistryResource or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.ServiceRegistryResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("ServiceRegistryResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(get_next, extract_data)
|
class ServiceRegistriesOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.AppPlatformManagementClient`'s
:attr:`service_registries` attribute.
'''
def __init__(self, *args, **kwargs):
pass
@distributed_trace
def get(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> _models.ServiceRegistryResource:
'''Get the Service Registry and its properties.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param service_registry_name: The name of Service Registry. Required.
:type service_registry_name: str
:return: ServiceRegistryResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.ServiceRegistryResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def _create_or_update_initial(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> _models.ServiceRegistryResource:
pass
@distributed_trace
def begin_create_or_update(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> LROPoller[_models.ServiceRegistryResource]:
'''Create the default Service Registry or update the existing Service Registry.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param service_registry_name: The name of Service Registry. Required.
:type service_registry_name: str
:return: An instance of LROPoller that returns either ServiceRegistryResource or the result of
cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2023_12_01.models.ServiceRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace
def begin_delete(
self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any
) -> LROPoller[None]:
'''Disable the default Service Registry.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param service_registry_name: The name of Service Registry. Required.
:type service_registry_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, **kwargs: Any
) -> Iterable["_models.ServiceRegistryResource"]:
'''Handles requests to list all resources in a Service.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:return: An iterator like instance of either ServiceRegistryResource or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.ServiceRegistryResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
def extract_data(pipeline_response):
pass
def get_next(next_link=None):
pass
| 17 | 5 | 35 | 4 | 26 | 6 | 3 | 0.28 | 0 | 4 | 0 | 0 | 7 | 5 | 7 | 7 | 381 | 56 | 267 | 98 | 238 | 75 | 150 | 82 | 137 | 6 | 0 | 1 | 38 |
10,676 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_runtime_versions_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.operations._runtime_versions_operations.RuntimeVersionsOperations
|
class RuntimeVersionsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.AppPlatformManagementClient`'s
:attr:`runtime_versions` attribute.
"""
models = _models
def __init__(self, *args, **kwargs):
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions:
"""Lists all of the available runtime versions supported by Microsoft.AppPlatform provider.
:return: AvailableRuntimeVersions or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.AvailableRuntimeVersions
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.AvailableRuntimeVersions] = kwargs.pop("cls", None)
_request = build_list_runtime_versions_request(
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("AvailableRuntimeVersions", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
|
class RuntimeVersionsOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.AppPlatformManagementClient`'s
:attr:`runtime_versions` attribute.
'''
def __init__(self, *args, **kwargs):
pass
@distributed_trace
def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions:
'''Lists all of the available runtime versions supported by Microsoft.AppPlatform provider.
:return: AvailableRuntimeVersions or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.AvailableRuntimeVersions
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
| 4 | 2 | 27 | 5 | 19 | 4 | 5 | 0.37 | 0 | 3 | 0 | 0 | 2 | 5 | 2 | 2 | 67 | 14 | 41 | 21 | 37 | 15 | 29 | 20 | 26 | 6 | 0 | 1 | 9 |
10,677 |
Azure/azure-cli-extensions
|
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/operations/_predefined_accelerators_operations.py
|
azext_spring.vendored_sdks.appplatform.v2023_12_01.operations._predefined_accelerators_operations.PredefinedAcceleratorsOperations
|
class PredefinedAcceleratorsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.AppPlatformManagementClient`'s
:attr:`predefined_accelerators` attribute.
"""
models = _models
def __init__(self, *args, **kwargs):
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any
) -> Iterable["_models.PredefinedAcceleratorResource"]:
"""Handle requests to list all predefined accelerators.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:return: An iterator like instance of either PredefinedAcceleratorResource or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.PredefinedAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.PredefinedAcceleratorResourceCollection] = kwargs.pop("cls", None)
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("PredefinedAcceleratorResourceCollection", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(get_next, extract_data)
@distributed_trace
def get(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> _models.PredefinedAcceleratorResource:
"""Get the predefined accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param predefined_accelerator_name: The name of the predefined accelerator. Required.
:type predefined_accelerator_name: str
:return: PredefinedAcceleratorResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.PredefinedAcceleratorResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[_models.PredefinedAcceleratorResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
predefined_accelerator_name=predefined_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize("PredefinedAcceleratorResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
def _disable_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_disable_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
predefined_accelerator_name=predefined_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@distributed_trace
def begin_disable(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Disable predefined accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param predefined_accelerator_name: The name of the predefined accelerator. Required.
:type predefined_accelerator_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._disable_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
predefined_accelerator_name=predefined_accelerator_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
def _enable_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> None:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_enable_request(
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
predefined_accelerator_name=predefined_accelerator_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@distributed_trace
def begin_enable(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> LROPoller[None]:
"""Enable predefined accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param predefined_accelerator_name: The name of the predefined accelerator. Required.
:type predefined_accelerator_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-12-01"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._enable_initial( # type: ignore
resource_group_name=resource_group_name,
service_name=service_name,
application_accelerator_name=application_accelerator_name,
predefined_accelerator_name=predefined_accelerator_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method)
|
class PredefinedAcceleratorsOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.appplatform.v2023_12_01.AppPlatformManagementClient`'s
:attr:`predefined_accelerators` attribute.
'''
def __init__(self, *args, **kwargs):
pass
@distributed_trace
def list(
self, resource_group_name: str, service_name: str, application_accelerator_name: str, **kwargs: Any
) -> Iterable["_models.PredefinedAcceleratorResource"]:
'''Handle requests to list all predefined accelerators.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:return: An iterator like instance of either PredefinedAcceleratorResource or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.v2023_12_01.models.PredefinedAcceleratorResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
def extract_data(pipeline_response):
pass
def get_next(next_link=None):
pass
@distributed_trace
def get_next(next_link=None):
'''Get the predefined accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param predefined_accelerator_name: The name of the predefined accelerator. Required.
:type predefined_accelerator_name: str
:return: PredefinedAcceleratorResource or the result of cls(response)
:rtype: ~azure.mgmt.appplatform.v2023_12_01.models.PredefinedAcceleratorResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def _disable_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> None:
pass
@distributed_trace
def begin_disable(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> LROPoller[None]:
'''Disable predefined accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param predefined_accelerator_name: The name of the predefined accelerator. Required.
:type predefined_accelerator_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
def _enable_initial( # pylint: disable=inconsistent-return-statements
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> None:
pass
@distributed_trace
def begin_enable(
self,
resource_group_name: str,
service_name: str,
application_accelerator_name: str,
predefined_accelerator_name: str,
**kwargs: Any
) -> LROPoller[None]:
'''Enable predefined accelerator.
:param resource_group_name: The name of the resource group that contains the resource. You can
obtain this value from the Azure Resource Manager API or the portal. Required.
:type resource_group_name: str
:param service_name: The name of the Service resource. Required.
:type service_name: str
:param application_accelerator_name: The name of the application accelerator. Required.
:type application_accelerator_name: str
:param predefined_accelerator_name: The name of the predefined accelerator. Required.
:type predefined_accelerator_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
| 17 | 5 | 38 | 4 | 28 | 7 | 3 | 0.28 | 0 | 4 | 0 | 0 | 7 | 5 | 7 | 7 | 414 | 55 | 295 | 123 | 241 | 83 | 149 | 82 | 136 | 6 | 0 | 1 | 38 |
10,678 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_cost_management_client_enums.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._cost_management_client_enums.AlertCriteria
|
class AlertCriteria(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Criteria that triggered alert
"""
COST_THRESHOLD_EXCEEDED = "CostThresholdExceeded"
USAGE_THRESHOLD_EXCEEDED = "UsageThresholdExceeded"
CREDIT_THRESHOLD_APPROACHING = "CreditThresholdApproaching"
CREDIT_THRESHOLD_REACHED = "CreditThresholdReached"
QUOTA_THRESHOLD_APPROACHING = "QuotaThresholdApproaching"
QUOTA_THRESHOLD_REACHED = "QuotaThresholdReached"
MULTI_CURRENCY = "MultiCurrency"
FORECAST_COST_THRESHOLD_EXCEEDED = "ForecastCostThresholdExceeded"
FORECAST_USAGE_THRESHOLD_EXCEEDED = "ForecastUsageThresholdExceeded"
INVOICE_DUE_DATE_APPROACHING = "InvoiceDueDateApproaching"
INVOICE_DUE_DATE_REACHED = "InvoiceDueDateReached"
CROSS_CLOUD_NEW_DATA_AVAILABLE = "CrossCloudNewDataAvailable"
CROSS_CLOUD_COLLECTION_ERROR = "CrossCloudCollectionError"
GENERAL_THRESHOLD_ERROR = "GeneralThresholdError"
|
class AlertCriteria(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
'''Criteria that triggered alert
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.13 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 1 | 15 | 15 | 14 | 2 | 15 | 15 | 14 | 0 | 1 | 0 | 0 |
10,679 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_cost_management_client_enums.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._cost_management_client_enums.AlertOperator
|
class AlertOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""operator used to compare currentSpend with amount
"""
NONE = "None"
EQUAL_TO = "EqualTo"
GREATER_THAN = "GreaterThan"
GREATER_THAN_OR_EQUAL_TO = "GreaterThanOrEqualTo"
LESS_THAN = "LessThan"
LESS_THAN_OR_EQUAL_TO = "LessThanOrEqualTo"
|
class AlertOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
'''operator used to compare currentSpend with amount
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.29 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 1 | 7 | 7 | 6 | 2 | 7 | 7 | 6 | 0 | 1 | 0 | 0 |
10,680 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_cost_management_client_enums.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._cost_management_client_enums.AlertSource
|
class AlertSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Source of alert
"""
PRESET = "Preset"
USER = "User"
|
class AlertSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
'''Source of alert
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.67 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 1 | 3 | 3 | 2 | 2 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
10,681 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_cost_management_client_enums.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._cost_management_client_enums.AlertStatus
|
class AlertStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""alert status
"""
NONE = "None"
ACTIVE = "Active"
OVERRIDDEN = "Overridden"
RESOLVED = "Resolved"
DISMISSED = "Dismissed"
|
class AlertStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
'''alert status
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.33 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 1 | 6 | 6 | 5 | 2 | 6 | 6 | 5 | 0 | 1 | 0 | 0 |
10,682 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_cost_management_client_enums.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._cost_management_client_enums.AlertTimeGrainType
|
class AlertTimeGrainType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Type of timegrain cadence
"""
NONE = "None"
MONTHLY = "Monthly"
QUARTERLY = "Quarterly"
ANNUALLY = "Annually"
BILLING_MONTH = "BillingMonth"
BILLING_QUARTER = "BillingQuarter"
BILLING_ANNUAL = "BillingAnnual"
|
class AlertTimeGrainType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
'''Type of timegrain cadence
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 1 | 8 | 8 | 7 | 2 | 8 | 8 | 7 | 0 | 1 | 0 | 0 |
10,683 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_cost_management_client_enums.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._cost_management_client_enums.AlertType
|
class AlertType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""type of alert
"""
BUDGET = "Budget"
INVOICE = "Invoice"
CREDIT = "Credit"
QUOTA = "Quota"
GENERAL = "General"
X_CLOUD = "xCloud"
BUDGET_FORECAST = "BudgetForecast"
|
class AlertType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
'''type of alert
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 1 | 8 | 8 | 7 | 2 | 8 | 8 | 7 | 0 | 1 | 0 | 0 |
10,684 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_cost_management_client_enums.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._cost_management_client_enums.ChartType
|
class ChartType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Chart type of the main view in Cost Analysis. Required.
"""
AREA = "Area"
LINE = "Line"
STACKED_COLUMN = "StackedColumn"
GROUPED_COLUMN = "GroupedColumn"
TABLE = "Table"
|
class ChartType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
'''Chart type of the main view in Cost Analysis. Required.
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.33 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 1 | 6 | 6 | 5 | 2 | 6 | 6 | 5 | 0 | 1 | 0 | 0 |
10,685 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_cost_management_client_enums.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._cost_management_client_enums.ExecutionStatus
|
class ExecutionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The last known status of the export execution.
"""
QUEUED = "Queued"
IN_PROGRESS = "InProgress"
COMPLETED = "Completed"
FAILED = "Failed"
TIMEOUT = "Timeout"
NEW_DATA_NOT_AVAILABLE = "NewDataNotAvailable"
DATA_NOT_AVAILABLE = "DataNotAvailable"
|
class ExecutionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
'''The last known status of the export execution.
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 1 | 8 | 8 | 7 | 2 | 8 | 8 | 7 | 0 | 1 | 0 | 0 |
10,686 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_forecast_operations.py
|
azext_costmanagement.vendored_sdks.costmanagement.aio.operations._forecast_operations.ForecastOperations
|
class ForecastOperations:
"""ForecastOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
async def usage(
self,
scope: str,
parameters: "_models.ForecastDefinition",
filter: Optional[str] = None,
**kwargs
) -> "_models.QueryResult":
"""Lists the forecast charges for scope defined.
:param scope: The scope associated with forecast operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition
:param filter: May be used to filter forecasts by properties/usageDate (Utc time),
properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge',
and 'and'. It does not currently support 'ne', 'or', or 'not'.
:type filter: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.QueryResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.usage.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
if filter is not None:
query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'ForecastDefinition')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('QueryResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/forecast'} # type: ignore
async def external_cloud_provider_usage(
self,
external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"],
external_cloud_provider_id: str,
parameters: "_models.ForecastDefinition",
filter: Optional[str] = None,
**kwargs
) -> "_models.QueryResult":
"""Lists the forecast charges for external cloud provider type defined.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account.
:type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition
:param filter: May be used to filter forecasts by properties/usageDate (Utc time),
properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge',
and 'and'. It does not currently support 'ne', 'or', or 'not'.
:type filter: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.QueryResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.external_cloud_provider_usage.metadata['url'] # type: ignore
path_format_arguments = {
'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'),
'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
if filter is not None:
query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'ForecastDefinition')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('QueryResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
external_cloud_provider_usage.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast'}
|
class ForecastOperations:
'''ForecastOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer) -> None:
pass
async def usage(
self,
scope: str,
parameters: "_models.ForecastDefinition",
filter: Optional[str] = None,
**kwargs
) -> "_models.QueryResult":
'''Lists the forecast charges for scope defined.
:param scope: The scope associated with forecast operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition
:param filter: May be used to filter forecasts by properties/usageDate (Utc time),
properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge',
and 'and'. It does not currently support 'ne', 'or', or 'not'.
:type filter: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def external_cloud_provider_usage(
self,
external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"],
external_cloud_provider_id: str,
parameters: "_models.ForecastDefinition",
filter: Optional[str] = None,
**kwargs
) -> "_models.QueryResult":
'''Lists the forecast charges for external cloud provider type defined.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account.
:type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
:type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition
:param filter: May be used to filter forecasts by properties/usageDate (Utc time),
properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge',
and 'and'. It does not currently support 'ne', 'or', or 'not'.
:type filter: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: QueryResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.QueryResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
| 4 | 3 | 54 | 6 | 30 | 21 | 3 | 0.82 | 0 | 1 | 0 | 0 | 3 | 4 | 3 | 3 | 181 | 24 | 93 | 54 | 76 | 76 | 71 | 41 | 67 | 4 | 0 | 1 | 9 |
10,687 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_cost_management_client_enums.py
|
azext_costmanagement.vendored_sdks.costmanagement.models._cost_management_client_enums.ExecutionType
|
class ExecutionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The type of the export execution.
"""
ON_DEMAND = "OnDemand"
SCHEDULED = "Scheduled"
|
class ExecutionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
'''The type of the export execution.
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.67 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 1 | 3 | 3 | 2 | 2 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
10,688 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_exports_operations.py
|
azext_costmanagement.vendored_sdks.costmanagement.aio.operations._exports_operations.ExportsOperations
|
class ExportsOperations:
"""ExportsOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
async def list(
self,
scope: str,
expand: Optional[str] = None,
**kwargs
) -> "_models.ExportListResult":
"""The operation to list all exports at the given scope.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param expand: May be used to expand the properties within an export. Currently only
'runHistory' is supported and will return information for the last execution of each export.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ExportListResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.ExportListResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.list.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
if expand is not None:
query_parameters['$expand'] = self._serialize.query("expand", expand, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('ExportListResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports'} # type: ignore
async def get(
self,
scope: str,
export_name: str,
expand: Optional[str] = None,
**kwargs
) -> "_models.Export":
"""The operation to get the export for the defined scope by export name.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:param expand: May be used to expand the properties within an export. Currently only
'runHistory' is supported and will return information for the last 10 executions of the export.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Export, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Export
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Export"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'exportName': self._serialize.url("export_name", export_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
if expand is not None:
query_parameters['$expand'] = self._serialize.query("expand", expand, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Export', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore
async def create_or_update(
self,
scope: str,
export_name: str,
parameters: "_models.Export",
**kwargs
) -> "_models.Export":
"""The operation to create or update a export. Update operation requires latest eTag to be set in
the request. You may obtain the latest eTag by performing a get operation. Create operation
does not require eTag.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:param parameters: Parameters supplied to the CreateOrUpdate Export operation.
:type parameters: ~azure.mgmt.costmanagement.models.Export
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Export, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Export
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Export"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.create_or_update.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'exportName': self._serialize.url("export_name", export_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'Export')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('Export', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('Export', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore
async def delete(
self,
scope: str,
export_name: str,
**kwargs
) -> None:
"""The operation to delete a export.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.delete.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'exportName': self._serialize.url("export_name", export_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
delete.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore
async def execute(
self,
scope: str,
export_name: str,
**kwargs
) -> None:
"""The operation to execute an export.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.execute.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'exportName': self._serialize.url("export_name", export_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.post(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
execute.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run'} # type: ignore
async def get_execution_history(
self,
scope: str,
export_name: str,
**kwargs
) -> "_models.ExportExecutionListResult":
"""The operation to get the execution history of an export for the defined scope and export name.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ExportExecutionListResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.ExportExecutionListResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ExportExecutionListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.get_execution_history.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'exportName': self._serialize.url("export_name", export_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('ExportExecutionListResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get_execution_history.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory'}
|
class ExportsOperations:
'''ExportsOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer) -> None:
pass
async def list(
self,
scope: str,
expand: Optional[str] = None,
**kwargs
) -> "_models.ExportListResult":
'''The operation to list all exports at the given scope.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param expand: May be used to expand the properties within an export. Currently only
'runHistory' is supported and will return information for the last execution of each export.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ExportListResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.ExportListResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def get(
self,
scope: str,
export_name: str,
expand: Optional[str] = None,
**kwargs
) -> "_models.Export":
'''The operation to get the export for the defined scope by export name.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:param expand: May be used to expand the properties within an export. Currently only
'runHistory' is supported and will return information for the last 10 executions of the export.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Export, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Export
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def create_or_update(
self,
scope: str,
export_name: str,
parameters: "_models.Export",
**kwargs
) -> "_models.Export":
'''The operation to create or update a export. Update operation requires latest eTag to be set in
the request. You may obtain the latest eTag by performing a get operation. Create operation
does not require eTag.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:param parameters: Parameters supplied to the CreateOrUpdate Export operation.
:type parameters: ~azure.mgmt.costmanagement.models.Export
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Export, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Export
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def delete(
self,
scope: str,
export_name: str,
**kwargs
) -> None:
'''The operation to delete a export.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def execute(
self,
scope: str,
export_name: str,
**kwargs
) -> None:
'''The operation to execute an export.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def get_execution_history(
self,
scope: str,
export_name: str,
**kwargs
) -> "_models.ExportExecutionListResult":
'''The operation to get the execution history of an export for the defined scope and export name.
:param scope: The scope associated with export operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param export_name: Export Name.
:type export_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ExportExecutionListResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.ExportExecutionListResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
| 8 | 7 | 64 | 7 | 31 | 29 | 3 | 0.96 | 0 | 1 | 0 | 0 | 7 | 4 | 7 | 7 | 475 | 63 | 226 | 124 | 186 | 217 | 165 | 92 | 157 | 5 | 0 | 1 | 23 |
10,689 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_alerts_operations.py
|
azext_costmanagement.vendored_sdks.costmanagement.aio.operations._alerts_operations.AlertsOperations
|
class AlertsOperations:
"""AlertsOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
async def list(
self,
scope: str,
**kwargs
) -> "_models.AlertsResult":
"""Lists the alerts for scope defined.
:param scope: The scope associated with alerts operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertsResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.AlertsResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertsResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.list.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('AlertsResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts'} # type: ignore
async def get(
self,
scope: str,
alert_id: str,
**kwargs
) -> "_models.Alert":
"""Gets the alert for the scope by alert ID.
:param scope: The scope associated with alerts operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param alert_id: Alert ID.
:type alert_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Alert, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Alert
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Alert"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'alertId': self._serialize.url("alert_id", alert_id, 'str', skip_quote=True),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Alert', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'} # type: ignore
async def dismiss(
self,
scope: str,
alert_id: str,
parameters: "_models.DismissAlertPayload",
**kwargs
) -> "_models.Alert":
"""Dismisses the specified alert.
:param scope: The scope associated with alerts operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param alert_id: Alert ID.
:type alert_id: str
:param parameters: Parameters supplied to the Dismiss Alert operation.
:type parameters: ~azure.mgmt.costmanagement.models.DismissAlertPayload
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Alert, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Alert
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Alert"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.dismiss.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'alertId': self._serialize.url("alert_id", alert_id, 'str', skip_quote=True),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'DismissAlertPayload')
body_content_kwargs['content'] = body_content
request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Alert', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
dismiss.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'} # type: ignore
async def list_external(
self,
external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"],
external_cloud_provider_id: str,
**kwargs
) -> "_models.AlertsResult":
"""Lists the Alerts for external cloud provider type defined.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account.
:type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertsResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.AlertsResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertsResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-06-01"
accept = "application/json"
# Construct URL
url = self.list_external.metadata['url'] # type: ignore
path_format_arguments = {
'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'),
'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('AlertsResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
list_external.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts'}
|
class AlertsOperations:
'''AlertsOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.costmanagement.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
'''
def __init__(self, client, config, serializer, deserializer) -> None:
pass
async def list(
self,
scope: str,
**kwargs
) -> "_models.AlertsResult":
'''Lists the alerts for scope defined.
:param scope: The scope associated with alerts operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertsResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.AlertsResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def get(
self,
scope: str,
alert_id: str,
**kwargs
) -> "_models.Alert":
'''Gets the alert for the scope by alert ID.
:param scope: The scope associated with alerts operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param alert_id: Alert ID.
:type alert_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Alert, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Alert
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def dismiss(
self,
scope: str,
alert_id: str,
parameters: "_models.DismissAlertPayload",
**kwargs
) -> "_models.Alert":
'''Dismisses the specified alert.
:param scope: The scope associated with alerts operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
:param alert_id: Alert ID.
:type alert_id: str
:param parameters: Parameters supplied to the Dismiss Alert operation.
:type parameters: ~azure.mgmt.costmanagement.models.DismissAlertPayload
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Alert, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.Alert
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
async def list_external(
self,
external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"],
external_cloud_provider_id: str,
**kwargs
) -> "_models.AlertsResult":
'''Lists the Alerts for external cloud provider type defined.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account.
:type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: AlertsResult, or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.AlertsResult
:raises: ~azure.core.exceptions.HttpResponseError
'''
pass
| 6 | 5 | 56 | 7 | 29 | 23 | 3 | 0.87 | 0 | 1 | 0 | 0 | 5 | 4 | 5 | 5 | 305 | 44 | 151 | 86 | 125 | 131 | 112 | 66 | 106 | 3 | 0 | 1 | 13 |
10,690 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_mongocluster/operations/_private_endpoint_connections_operations.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_mongocluster.operations._private_endpoint_connections_operations.PrivateEndpointConnectionsOperations
|
class PrivateEndpointConnectionsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.mongocluster.MongoClusterMgmtClient`'s
:attr:`private_endpoint_connections` attribute.
"""
models = _models
def __init__(self, *args, **kwargs):
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
def list_by_mongo_cluster(
self, resource_group_name: str, mongo_cluster_name: str, **kwargs: Any
) -> Iterable["_models.PrivateEndpointConnectionResource"]:
"""List existing private connections.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param mongo_cluster_name: The name of the mongo cluster. Required.
:type mongo_cluster_name: str
:return: An iterator like instance of either PrivateEndpointConnectionResource or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.PrivateEndpointConnectionResourceListResult] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_by_mongo_cluster_request(
resource_group_name=resource_group_name,
mongo_cluster_name=mongo_cluster_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("PrivateEndpointConnectionResourceListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(get_next, extract_data)
@distributed_trace
def get(
self, resource_group_name: str, mongo_cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any
) -> _models.PrivateEndpointConnectionResource:
"""Get a specific private connection.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param mongo_cluster_name: The name of the mongo cluster. Required.
:type mongo_cluster_name: str
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:return: PrivateEndpointConnectionResource or the result of cls(response)
:rtype: ~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None)
_request = build_get_request(
resource_group_name=resource_group_name,
mongo_cluster_name=mongo_cluster_name,
private_endpoint_connection_name=private_endpoint_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
def _create_initial(
self,
resource_group_name: str,
mongo_cluster_name: str,
private_endpoint_connection_name: str,
resource: Union[_models.PrivateEndpointConnectionResource, IO[bytes]],
**kwargs: Any
) -> Optional[_models.PrivateEndpointConnectionResource]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[Optional[_models.PrivateEndpointConnectionResource]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(resource, (IOBase, bytes)):
_content = resource
else:
_json = self._serialize.body(resource, "PrivateEndpointConnectionResource")
_request = build_create_request(
resource_group_name=resource_group_name,
mongo_cluster_name=mongo_cluster_name,
private_endpoint_connection_name=private_endpoint_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 201, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = None
response_headers = {}
if response.status_code == 200:
deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response)
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
if cls:
return cls(pipeline_response, deserialized, response_headers) # type: ignore
return deserialized # type: ignore
@overload
def begin_create(
self,
resource_group_name: str,
mongo_cluster_name: str,
private_endpoint_connection_name: str,
resource: _models.PrivateEndpointConnectionResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.PrivateEndpointConnectionResource]:
"""Create a Private endpoint connection.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param mongo_cluster_name: The name of the mongo cluster. Required.
:type mongo_cluster_name: str
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:param resource: Resource create parameters. Required.
:type resource: ~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either PrivateEndpointConnectionResource or the
result of cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
def begin_create(
self,
resource_group_name: str,
mongo_cluster_name: str,
private_endpoint_connection_name: str,
resource: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.PrivateEndpointConnectionResource]:
"""Create a Private endpoint connection.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param mongo_cluster_name: The name of the mongo cluster. Required.
:type mongo_cluster_name: str
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:param resource: Resource create parameters. Required.
:type resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either PrivateEndpointConnectionResource or the
result of cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace
def begin_create(
self,
resource_group_name: str,
mongo_cluster_name: str,
private_endpoint_connection_name: str,
resource: Union[_models.PrivateEndpointConnectionResource, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.PrivateEndpointConnectionResource]:
"""Create a Private endpoint connection.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param mongo_cluster_name: The name of the mongo cluster. Required.
:type mongo_cluster_name: str
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:param resource: Resource create parameters. Is either a PrivateEndpointConnectionResource type
or a IO[bytes] type. Required.
:type resource: ~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource or IO[bytes]
:return: An instance of LROPoller that returns either PrivateEndpointConnectionResource or the
result of cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._create_initial(
resource_group_name=resource_group_name,
mongo_cluster_name=mongo_cluster_name,
private_endpoint_connection_name=private_endpoint_connection_name,
resource=resource,
api_version=api_version,
content_type=content_type,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
if polling is True:
polling_method: PollingMethod = cast(
PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs)
)
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[_models.PrivateEndpointConnectionResource].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[_models.PrivateEndpointConnectionResource](
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, mongo_cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any
) -> None:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
_request = build_delete_request(
resource_group_name=resource_group_name,
mongo_cluster_name=mongo_cluster_name,
private_endpoint_connection_name=private_endpoint_connection_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
if cls:
return cls(pipeline_response, None, response_headers) # type: ignore
@distributed_trace
def begin_delete(
self, resource_group_name: str, mongo_cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any
) -> LROPoller[None]:
"""Delete the private endpoint connection.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param mongo_cluster_name: The name of the mongo cluster. Required.
:type mongo_cluster_name: str
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._delete_initial( # type: ignore
resource_group_name=resource_group_name,
mongo_cluster_name=mongo_cluster_name,
private_endpoint_connection_name=private_endpoint_connection_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(
PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
)
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method)
|
class PrivateEndpointConnectionsOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.mongocluster.MongoClusterMgmtClient`'s
:attr:`private_endpoint_connections` attribute.
'''
def __init__(self, *args, **kwargs):
pass
@distributed_trace
def list_by_mongo_cluster(
self, resource_group_name: str, mongo_cluster_name: str, **kwargs: Any
) -> Iterable["_models.PrivateEndpointConnectionResource"]:
'''List existing private connections.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param mongo_cluster_name: The name of the mongo cluster. Required.
:type mongo_cluster_name: str
:return: An iterator like instance of either PrivateEndpointConnectionResource or the result of
cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
def extract_data(pipeline_response):
pass
def get_next(next_link=None):
pass
@distributed_trace
def get_next(next_link=None):
'''Get a specific private connection.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param mongo_cluster_name: The name of the mongo cluster. Required.
:type mongo_cluster_name: str
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:return: PrivateEndpointConnectionResource or the result of cls(response)
:rtype: ~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def _create_initial(
self,
resource_group_name: str,
mongo_cluster_name: str,
private_endpoint_connection_name: str,
resource: Union[_models.PrivateEndpointConnectionResource, IO[bytes]],
**kwargs: Any
) -> Optional[_models.PrivateEndpointConnectionResource]:
pass
@overload
def begin_create(
self,
resource_group_name: str,
mongo_cluster_name: str,
private_endpoint_connection_name: str,
resource: _models.PrivateEndpointConnectionResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.PrivateEndpointConnectionResource]:
'''Create a Private endpoint connection.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param mongo_cluster_name: The name of the mongo cluster. Required.
:type mongo_cluster_name: str
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:param resource: Resource create parameters. Required.
:type resource: ~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either PrivateEndpointConnectionResource or the
result of cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@overload
def begin_create(
self,
resource_group_name: str,
mongo_cluster_name: str,
private_endpoint_connection_name: str,
resource: _models.PrivateEndpointConnectionResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.PrivateEndpointConnectionResource]:
'''Create a Private endpoint connection.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param mongo_cluster_name: The name of the mongo cluster. Required.
:type mongo_cluster_name: str
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:param resource: Resource create parameters. Required.
:type resource: IO[bytes]
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: An instance of LROPoller that returns either PrivateEndpointConnectionResource or the
result of cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
@distributed_trace
def begin_create(
self,
resource_group_name: str,
mongo_cluster_name: str,
private_endpoint_connection_name: str,
resource: _models.PrivateEndpointConnectionResource,
*,
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.PrivateEndpointConnectionResource]:
'''Create a Private endpoint connection.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param mongo_cluster_name: The name of the mongo cluster. Required.
:type mongo_cluster_name: str
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:param resource: Resource create parameters. Is either a PrivateEndpointConnectionResource type
or a IO[bytes] type. Required.
:type resource: ~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource or IO[bytes]
:return: An instance of LROPoller that returns either PrivateEndpointConnectionResource or the
result of cls(response)
:rtype:
~azure.core.polling.LROPoller[~azure.mgmt.mongocluster.models.PrivateEndpointConnectionResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
def _delete_initial( # pylint: disable=inconsistent-return-statements
self, resource_group_name: str, mongo_cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any
) -> None:
pass
@distributed_trace
def begin_delete(
self, resource_group_name: str, mongo_cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any
) -> LROPoller[None]:
'''Delete the private endpoint connection.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param mongo_cluster_name: The name of the mongo cluster. Required.
:type mongo_cluster_name: str
:param private_endpoint_connection_name: The name of the private endpoint connection associated
with the Azure resource. Required.
:type private_endpoint_connection_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def get_long_running_output(pipeline_response):
pass
| 21 | 7 | 38 | 4 | 27 | 9 | 3 | 0.37 | 0 | 9 | 0 | 0 | 9 | 4 | 9 | 9 | 496 | 63 | 329 | 139 | 268 | 121 | 172 | 93 | 157 | 7 | 0 | 1 | 42 |
10,691 |
Azure/azure-cli-extensions
|
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_mongocluster/operations/_private_links_operations.py
|
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_mongocluster.operations._private_links_operations.PrivateLinksOperations
|
class PrivateLinksOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.mongocluster.MongoClusterMgmtClient`'s
:attr:`private_links` attribute.
"""
models = _models
def __init__(self, *args, **kwargs):
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
def list_by_mongo_cluster(
self, resource_group_name: str, mongo_cluster_name: str, **kwargs: Any
) -> Iterable["_models.PrivateLinkResource"]:
"""list private links on the given resource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param mongo_cluster_name: The name of the mongo cluster. Required.
:type mongo_cluster_name: str
:return: An iterator like instance of either PrivateLinkResource or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.mongocluster.models.PrivateLinkResource]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None)
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
_request = build_list_by_mongo_cluster_request(
resource_group_name=resource_group_name,
mongo_cluster_name=mongo_cluster_name,
subscription_id=self._config.subscription_id,
api_version=api_version,
headers=_headers,
params=_params,
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
_request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
def extract_data(pipeline_response):
deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem) # type: ignore
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
_request = prepare_request(next_link)
_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(get_next, extract_data)
|
class PrivateLinksOperations:
'''
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.mongocluster.MongoClusterMgmtClient`'s
:attr:`private_links` attribute.
'''
def __init__(self, *args, **kwargs):
pass
@distributed_trace
def list_by_mongo_cluster(
self, resource_group_name: str, mongo_cluster_name: str, **kwargs: Any
) -> Iterable["_models.PrivateLinkResource"]:
'''list private links on the given resource.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param mongo_cluster_name: The name of the mongo cluster. Required.
:type mongo_cluster_name: str
:return: An iterator like instance of either PrivateLinkResource or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.mongocluster.models.PrivateLinkResource]
:raises ~azure.core.exceptions.HttpResponseError:
'''
pass
def prepare_request(next_link=None):
pass
def extract_data(pipeline_response):
pass
def get_next(next_link=None):
pass
| 7 | 2 | 28 | 3 | 23 | 3 | 2 | 0.29 | 0 | 5 | 0 | 0 | 2 | 4 | 2 | 2 | 104 | 16 | 70 | 30 | 61 | 20 | 45 | 27 | 39 | 5 | 0 | 1 | 12 |
10,692 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/__init__.py
|
azext_costmanagement.CostManagementClientCommandsLoader
|
class CostManagementClientCommandsLoader(AzCommandsLoader):
def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_costmanagement.generated._client_factory import cf_costmanagement
costmanagement_custom = CliCommandType(
operations_tmpl='azext_costmanagement.custom#{}',
client_factory=cf_costmanagement)
super().__init__(cli_ctx=cli_ctx, custom_command_type=costmanagement_custom)
def load_command_table(self, args):
from azext_costmanagement.generated.commands import load_command_table
from azure.cli.core.aaz import load_aaz_command_table
try:
from . import aaz
except ImportError:
aaz = None
if aaz:
load_aaz_command_table(
loader=self,
aaz_pkg_name=aaz.__name__,
args=args
)
load_command_table(self, args)
try:
from azext_costmanagement.manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError:
pass
return self.command_table
def load_arguments(self, command):
from azext_costmanagement.generated._params import load_arguments
load_arguments(self, command)
try:
from azext_costmanagement.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError:
pass
|
class CostManagementClientCommandsLoader(AzCommandsLoader):
def __init__(self, cli_ctx=None):
pass
def load_command_table(self, args):
pass
def load_arguments(self, command):
pass
| 4 | 0 | 12 | 0 | 12 | 0 | 2 | 0.03 | 1 | 2 | 0 | 0 | 3 | 0 | 3 | 3 | 39 | 3 | 36 | 13 | 24 | 1 | 30 | 13 | 18 | 4 | 1 | 1 | 7 |
10,693 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/aaz/latest/costmanagement/__cmd_group.py
|
azext_costmanagement.aaz.latest.costmanagement.__cmd_group.__CMDGroup
|
class __CMDGroup(AAZCommandGroup):
"""costmanagement
"""
pass
|
class __CMDGroup(AAZCommandGroup):
'''costmanagement
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 2 | 1 | 1 | 2 | 2 | 1 | 1 | 0 | 1 | 0 | 0 |
10,694 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/aaz/latest/costmanagement/_show_operation_result.py
|
azext_costmanagement.aaz.latest.costmanagement._show_operation_result.ShowOperationResult
|
class ShowOperationResult(AAZCommand):
"""Get the result of the specified operation. The link with this operationId is provided as a response header of the initial request.
"""
_aaz_info = {
"version": "2023-08-01",
"resources": [
["mgmt-plane", "/{scope}/providers/microsoft.costmanagement/operationresults/{}", "2023-08-01"],
]
}
AZ_SUPPORT_NO_WAIT = True
def _handler(self, command_args):
super()._handler(command_args)
return self.build_lro_poller(self._execute_operations, self._output)
_args_schema = None
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
if cls._args_schema is not None:
return cls._args_schema
cls._args_schema = super()._build_arguments_schema(*args, **kwargs)
# define Arg Group ""
_args_schema = cls._args_schema
_args_schema.operation_id = AAZStrArg(
options=["--operation-id"],
help="The target operation Id.",
required=True,
)
_args_schema.scope = AAZStrArg(
options=["--scope"],
help="The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For details, see https://aka.ms/costmgmt/scopes.",
required=True,
)
return cls._args_schema
def _execute_operations(self):
self.pre_operations()
yield self.GenerateDetailedCostReportOperationResultsGet(ctx=self.ctx)()
self.post_operations()
@register_callback
def pre_operations(self):
pass
@register_callback
def post_operations(self):
pass
def _output(self, *args, **kwargs):
result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True)
return result
class GenerateDetailedCostReportOperationResultsGet(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"
def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(request=request, stream=False, **kwargs)
if session.http_response.status_code in [202]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "ODataV4Format"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"operationId", self.ctx.args.operation_id,
required=True,
),
**self.serialize_url_param(
"scope", self.ctx.args.scope,
skip_quote=True,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-08-01",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
def on_200(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200
)
_schema_on_200 = None
@classmethod
def _build_schema_on_200(cls):
if cls._schema_on_200 is not None:
return cls._schema_on_200
cls._schema_on_200 = AAZObjectType()
_schema_on_200 = cls._schema_on_200
_schema_on_200.id = AAZStrType()
_schema_on_200.name = AAZStrType()
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.type = AAZStrType()
properties = cls._schema_on_200.properties
properties.download_url = AAZStrType(
serialized_name="downloadUrl",
)
properties.expiry_time = AAZStrType(
serialized_name="expiryTime",
flags={"read_only": True},
)
properties.valid_till = AAZStrType(
serialized_name="validTill",
)
return cls._schema_on_200
|
class ShowOperationResult(AAZCommand):
'''Get the result of the specified operation. The link with this operationId is provided as a response header of the initial request.
'''
def _handler(self, command_args):
pass
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
pass
def _execute_operations(self):
pass
@register_callback
def pre_operations(self):
pass
@register_callback
def post_operations(self):
pass
def _output(self, *args, **kwargs):
pass
class GenerateDetailedCostReportOperationResultsGet(AAZHttpOperation):
def __call__(self, *args, **kwargs):
pass
@property
def url(self):
pass
@property
def method(self):
pass
@property
def error_format(self):
pass
@property
def url_parameters(self):
pass
@property
def query_parameters(self):
pass
@property
def header_parameters(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 27 | 1 | 8 | 0 | 8 | 0 | 1 | 0.02 | 1 | 2 | 1 | 0 | 5 | 0 | 6 | 6 | 171 | 27 | 141 | 43 | 114 | 3 | 69 | 32 | 52 | 3 | 1 | 1 | 19 |
10,695 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/generated/action.py
|
azext_costmanagement.generated.action.AddDatasetConfiguration
|
class AddDatasetConfiguration(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
if hasattr(namespace, 'dataset_configuration'):
namespace.dataset_configuration = action
if hasattr(namespace, 'definition_dataset_configuration'):
namespace.definition_dataset_configuration = action
def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'columns':
d['columns'] = v
return d
|
class AddDatasetConfiguration(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
pass
def get_action(self, values, option_string):
pass
| 3 | 0 | 11 | 0 | 11 | 1 | 4 | 0.05 | 1 | 3 | 0 | 0 | 2 | 0 | 2 | 9 | 23 | 1 | 22 | 8 | 19 | 1 | 22 | 8 | 19 | 5 | 3 | 2 | 8 |
10,696 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/generated/action.py
|
azext_costmanagement.generated.action.AddDatasetGrouping
|
class AddDatasetGrouping(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddDatasetGrouping, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'type':
d['type'] = v[0]
elif kl == 'name':
d['name'] = v[0]
return d
|
class AddDatasetGrouping(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
pass
def get_action(self, values, option_string):
pass
| 3 | 0 | 10 | 0 | 10 | 1 | 4 | 0.05 | 1 | 4 | 0 | 0 | 2 | 0 | 2 | 11 | 22 | 1 | 21 | 8 | 18 | 1 | 20 | 8 | 17 | 6 | 4 | 2 | 7 |
10,697 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/generated/action.py
|
azext_costmanagement.generated.action.AddDeliveryInfoDestination
|
class AddDeliveryInfoDestination(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.delivery_info_destination = action
def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'resource-id':
d['resource_id'] = v[0]
elif kl == 'container':
d['container'] = v[0]
elif kl == 'root-folder-path':
d['root_folder_path'] = v[0]
return d
|
class AddDeliveryInfoDestination(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
pass
def get_action(self, values, option_string):
pass
| 3 | 0 | 11 | 0 | 11 | 1 | 4 | 0.04 | 1 | 3 | 0 | 0 | 2 | 0 | 2 | 9 | 24 | 1 | 23 | 8 | 20 | 1 | 21 | 8 | 18 | 7 | 3 | 2 | 8 |
10,698 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/generated/action.py
|
azext_costmanagement.generated.action.AddKpis
|
class AddKpis(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddKpis, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'type':
d['type'] = v[0]
elif kl == 'id':
d['id'] = v[0]
elif kl == 'enabled':
d['enabled'] = v[0]
return d
|
class AddKpis(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
pass
def get_action(self, values, option_string):
pass
| 3 | 0 | 11 | 0 | 11 | 1 | 4 | 0.04 | 1 | 4 | 0 | 0 | 2 | 0 | 2 | 11 | 24 | 1 | 23 | 8 | 20 | 1 | 21 | 8 | 18 | 7 | 4 | 2 | 8 |
10,699 |
Azure/azure-cli-extensions
|
src/costmanagement/azext_costmanagement/generated/action.py
|
azext_costmanagement.generated.action.AddPivots
|
class AddPivots(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddPivots, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'type':
d['type'] = v[0]
elif kl == 'name':
d['name'] = v[0]
return d
|
class AddPivots(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
pass
def get_action(self, values, option_string):
pass
| 3 | 0 | 10 | 0 | 10 | 1 | 4 | 0.05 | 1 | 4 | 0 | 0 | 2 | 0 | 2 | 11 | 22 | 1 | 21 | 8 | 18 | 1 | 20 | 8 | 17 | 6 | 4 | 2 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.