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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,000 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.ExposureControlResponse
|
class ExposureControlResponse(_serialization.Model):
"""The exposure control response.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar feature_name: The feature name.
:vartype feature_name: str
:ivar value: The feature value.
:vartype value: str
"""
_validation = {
"feature_name": {"readonly": True},
"value": {"readonly": True},
}
_attribute_map = {
"feature_name": {"key": "featureName", "type": "str"},
"value": {"key": "value", "type": "str"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.feature_name = None
self.value = None
|
class ExposureControlResponse(_serialization.Model):
'''The exposure control response.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar feature_name: The feature name.
:vartype feature_name: str
:ivar value: The feature value.
:vartype value: str
'''
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 |
11,001 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.Expression
|
class Expression(_serialization.Model):
"""Azure Data Factory expression definition.
All required parameters must be populated in order to send to server.
:ivar type: Expression type. Required. "Expression"
:vartype type: str or ~azure.mgmt.datafactory.models.ExpressionType
:ivar value: Expression value. Required.
:vartype value: str
"""
_validation = {
"type": {"required": True},
"value": {"required": True},
}
_attribute_map = {
"type": {"key": "type", "type": "str"},
"value": {"key": "value", "type": "str"},
}
def __init__(self, *, type: Union[str, "_models.ExpressionType"], value: str, **kwargs: Any) -> None:
"""
:keyword type: Expression type. Required. "Expression"
:paramtype type: str or ~azure.mgmt.datafactory.models.ExpressionType
:keyword value: Expression value. Required.
:paramtype value: str
"""
super().__init__(**kwargs)
self.type = type
self.value = value
|
class Expression(_serialization.Model):
'''Azure Data Factory expression definition.
All required parameters must be populated in order to send to server.
:ivar type: Expression type. Required. "Expression"
:vartype type: str or ~azure.mgmt.datafactory.models.ExpressionType
:ivar value: Expression value. Required.
:vartype value: str
'''
def __init__(self, *, type: Union[str, "_models.ExpressionType"], value: str, **kwargs: Any) -> None:
'''
:keyword type: Expression type. Required. "Expression"
:paramtype type: str or ~azure.mgmt.datafactory.models.ExpressionType
:keyword value: Expression value. Required.
:paramtype value: str
'''
pass
| 2 | 2 | 10 | 0 | 4 | 6 | 1 | 1 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 16 | 31 | 5 | 13 | 6 | 11 | 13 | 7 | 6 | 5 | 1 | 2 | 0 | 1 |
11,002 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.ExpressionV2
|
class ExpressionV2(_serialization.Model):
"""Nested representation of a complex expression.
:ivar type: Type of expressions supported by the system. Type: string. Known values are:
"Constant", "Field", "Unary", "Binary", and "NAry".
:vartype type: str or ~azure.mgmt.datafactory.models.ExpressionV2Type
:ivar value: Value for Constant/Field Type: string.
:vartype value: str
:ivar operators: Expression operator value Type: list of strings.
:vartype operators: list[str]
:ivar operands: List of nested expressions.
:vartype operands: list[~azure.mgmt.datafactory.models.ExpressionV2]
"""
_attribute_map = {
"type": {"key": "type", "type": "str"},
"value": {"key": "value", "type": "str"},
"operators": {"key": "operators", "type": "[str]"},
"operands": {"key": "operands", "type": "[ExpressionV2]"},
}
def __init__(
self,
*,
type: Optional[Union[str, "_models.ExpressionV2Type"]] = None,
value: Optional[str] = None,
operators: Optional[List[str]] = None,
operands: Optional[List["_models.ExpressionV2"]] = None,
**kwargs: Any
) -> None:
"""
:keyword type: Type of expressions supported by the system. Type: string. Known values are:
"Constant", "Field", "Unary", "Binary", and "NAry".
:paramtype type: str or ~azure.mgmt.datafactory.models.ExpressionV2Type
:keyword value: Value for Constant/Field Type: string.
:paramtype value: str
:keyword operators: Expression operator value Type: list of strings.
:paramtype operators: list[str]
:keyword operands: List of nested expressions.
:paramtype operands: list[~azure.mgmt.datafactory.models.ExpressionV2]
"""
super().__init__(**kwargs)
self.type = type
self.value = value
self.operators = operators
self.operands = operands
|
class ExpressionV2(_serialization.Model):
'''Nested representation of a complex expression.
:ivar type: Type of expressions supported by the system. Type: string. Known values are:
"Constant", "Field", "Unary", "Binary", and "NAry".
:vartype type: str or ~azure.mgmt.datafactory.models.ExpressionV2Type
:ivar value: Value for Constant/Field Type: string.
:vartype value: str
:ivar operators: Expression operator value Type: list of strings.
:vartype operators: list[str]
:ivar operands: List of nested expressions.
:vartype operands: list[~azure.mgmt.datafactory.models.ExpressionV2]
'''
def __init__(
self,
*,
type: Optional[Union[str, "_models.ExpressionV2Type"]] = None,
value: Optional[str] = None,
operators: Optional[List[str]] = None,
operands: Optional[List["_models.ExpressionV2"]] = None,
**kwargs: Any
) -> None:
'''
:keyword type: Type of expressions supported by the system. Type: string. Known values are:
"Constant", "Field", "Unary", "Binary", and "NAry".
:paramtype type: str or ~azure.mgmt.datafactory.models.ExpressionV2Type
:keyword value: Value for Constant/Field Type: string.
:paramtype value: str
:keyword operators: Expression operator value Type: list of strings.
:paramtype operators: list[str]
:keyword operands: List of nested expressions.
:paramtype operands: list[~azure.mgmt.datafactory.models.ExpressionV2]
'''
pass
| 2 | 2 | 25 | 0 | 14 | 11 | 1 | 1.05 | 1 | 3 | 0 | 0 | 1 | 4 | 1 | 16 | 46 | 3 | 21 | 15 | 11 | 22 | 8 | 7 | 6 | 1 | 2 | 0 | 1 |
11,003 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.Factory
|
class Factory(Resource):
"""Factory resource type.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The resource identifier.
:vartype id: str
:ivar name: The resource name.
:vartype name: str
:ivar type: The resource type.
:vartype type: str
:ivar location: The resource location.
:vartype location: str
:ivar tags: The resource tags.
:vartype tags: dict[str, str]
:ivar e_tag: Etag identifies change in the resource.
:vartype e_tag: str
:ivar additional_properties: Unmatched properties from the message are deserialized to this
collection.
:vartype additional_properties: dict[str, JSON]
:ivar identity: Managed service identity of the factory.
:vartype identity: ~azure.mgmt.datafactory.models.FactoryIdentity
:ivar provisioning_state: Factory provisioning state, example Succeeded.
:vartype provisioning_state: str
:ivar create_time: Time the factory was created in ISO8601 format.
:vartype create_time: ~datetime.datetime
:ivar version: Version of the factory.
:vartype version: str
:ivar purview_configuration: Purview information of the factory.
:vartype purview_configuration: ~azure.mgmt.datafactory.models.PurviewConfiguration
:ivar repo_configuration: Git repo information of the factory.
:vartype repo_configuration: ~azure.mgmt.datafactory.models.FactoryRepoConfiguration
:ivar global_parameters: List of parameters for factory.
:vartype global_parameters: dict[str,
~azure.mgmt.datafactory.models.GlobalParameterSpecification]
:ivar encryption: Properties to enable Customer Managed Key for the factory.
:vartype encryption: ~azure.mgmt.datafactory.models.EncryptionConfiguration
:ivar public_network_access: Whether or not public network access is allowed for the data
factory. Known values are: "Enabled" and "Disabled".
:vartype public_network_access: str or ~azure.mgmt.datafactory.models.PublicNetworkAccess
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"e_tag": {"readonly": True},
"provisioning_state": {"readonly": True},
"create_time": {"readonly": True},
"version": {"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}"},
"e_tag": {"key": "eTag", "type": "str"},
"additional_properties": {"key": "", "type": "{object}"},
"identity": {"key": "identity", "type": "FactoryIdentity"},
"provisioning_state": {"key": "properties.provisioningState", "type": "str"},
"create_time": {"key": "properties.createTime", "type": "iso-8601"},
"version": {"key": "properties.version", "type": "str"},
"purview_configuration": {"key": "properties.purviewConfiguration", "type": "PurviewConfiguration"},
"repo_configuration": {"key": "properties.repoConfiguration", "type": "FactoryRepoConfiguration"},
"global_parameters": {"key": "properties.globalParameters", "type": "{GlobalParameterSpecification}"},
"encryption": {"key": "properties.encryption", "type": "EncryptionConfiguration"},
"public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"},
}
def __init__(
self,
*,
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
additional_properties: Optional[Dict[str, JSON]] = None,
identity: Optional["_models.FactoryIdentity"] = None,
purview_configuration: Optional["_models.PurviewConfiguration"] = None,
repo_configuration: Optional["_models.FactoryRepoConfiguration"] = None,
global_parameters: Optional[Dict[str, "_models.GlobalParameterSpecification"]] = None,
encryption: Optional["_models.EncryptionConfiguration"] = None,
public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
**kwargs: Any
) -> None:
"""
:keyword location: The resource location.
:paramtype location: str
:keyword tags: The resource tags.
:paramtype tags: dict[str, str]
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
:keyword identity: Managed service identity of the factory.
:paramtype identity: ~azure.mgmt.datafactory.models.FactoryIdentity
:keyword purview_configuration: Purview information of the factory.
:paramtype purview_configuration: ~azure.mgmt.datafactory.models.PurviewConfiguration
:keyword repo_configuration: Git repo information of the factory.
:paramtype repo_configuration: ~azure.mgmt.datafactory.models.FactoryRepoConfiguration
:keyword global_parameters: List of parameters for factory.
:paramtype global_parameters: dict[str,
~azure.mgmt.datafactory.models.GlobalParameterSpecification]
:keyword encryption: Properties to enable Customer Managed Key for the factory.
:paramtype encryption: ~azure.mgmt.datafactory.models.EncryptionConfiguration
:keyword public_network_access: Whether or not public network access is allowed for the data
factory. Known values are: "Enabled" and "Disabled".
:paramtype public_network_access: str or ~azure.mgmt.datafactory.models.PublicNetworkAccess
"""
super().__init__(location=location, tags=tags, **kwargs)
self.additional_properties = additional_properties
self.identity = identity
self.provisioning_state = None
self.create_time = None
self.version = None
self.purview_configuration = purview_configuration
self.repo_configuration = repo_configuration
self.global_parameters = global_parameters
self.encryption = encryption
self.public_network_access = public_network_access
|
class Factory(Resource):
'''Factory resource type.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The resource identifier.
:vartype id: str
:ivar name: The resource name.
:vartype name: str
:ivar type: The resource type.
:vartype type: str
:ivar location: The resource location.
:vartype location: str
:ivar tags: The resource tags.
:vartype tags: dict[str, str]
:ivar e_tag: Etag identifies change in the resource.
:vartype e_tag: str
:ivar additional_properties: Unmatched properties from the message are deserialized to this
collection.
:vartype additional_properties: dict[str, JSON]
:ivar identity: Managed service identity of the factory.
:vartype identity: ~azure.mgmt.datafactory.models.FactoryIdentity
:ivar provisioning_state: Factory provisioning state, example Succeeded.
:vartype provisioning_state: str
:ivar create_time: Time the factory was created in ISO8601 format.
:vartype create_time: ~datetime.datetime
:ivar version: Version of the factory.
:vartype version: str
:ivar purview_configuration: Purview information of the factory.
:vartype purview_configuration: ~azure.mgmt.datafactory.models.PurviewConfiguration
:ivar repo_configuration: Git repo information of the factory.
:vartype repo_configuration: ~azure.mgmt.datafactory.models.FactoryRepoConfiguration
:ivar global_parameters: List of parameters for factory.
:vartype global_parameters: dict[str,
~azure.mgmt.datafactory.models.GlobalParameterSpecification]
:ivar encryption: Properties to enable Customer Managed Key for the factory.
:vartype encryption: ~azure.mgmt.datafactory.models.EncryptionConfiguration
:ivar public_network_access: Whether or not public network access is allowed for the data
factory. Known values are: "Enabled" and "Disabled".
:vartype public_network_access: str or ~azure.mgmt.datafactory.models.PublicNetworkAccess
'''
def __init__(
self,
*,
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
additional_properties: Optional[Dict[str, JSON]] = None,
identity: Optional["_models.FactoryIdentity"] = None,
purview_configuration: Optional["_models.PurviewConfiguration"] = None,
repo_configuration: Optional["_models.FactoryRepoConfiguration"] = None,
global_parameters: Optional[Dict[str, "_models.GlobalParameterSpecification"]] = None,
encryption: Optional["_models.EncryptionConfiguration"] = None,
public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
**kwargs: Any
) -> None:
'''
:keyword location: The resource location.
:paramtype location: str
:keyword tags: The resource tags.
:paramtype tags: dict[str, str]
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
:keyword identity: Managed service identity of the factory.
:paramtype identity: ~azure.mgmt.datafactory.models.FactoryIdentity
:keyword purview_configuration: Purview information of the factory.
:paramtype purview_configuration: ~azure.mgmt.datafactory.models.PurviewConfiguration
:keyword repo_configuration: Git repo information of the factory.
:paramtype repo_configuration: ~azure.mgmt.datafactory.models.FactoryRepoConfiguration
:keyword global_parameters: List of parameters for factory.
:paramtype global_parameters: dict[str,
~azure.mgmt.datafactory.models.GlobalParameterSpecification]
:keyword encryption: Properties to enable Customer Managed Key for the factory.
:paramtype encryption: ~azure.mgmt.datafactory.models.EncryptionConfiguration
:keyword public_network_access: Whether or not public network access is allowed for the data
factory. Known values are: "Enabled" and "Disabled".
:paramtype public_network_access: str or ~azure.mgmt.datafactory.models.PublicNetworkAccess
'''
pass
| 2 | 2 | 48 | 0 | 25 | 23 | 1 | 1.15 | 1 | 3 | 0 | 0 | 1 | 10 | 1 | 17 | 119 | 5 | 53 | 27 | 38 | 61 | 15 | 14 | 13 | 1 | 3 | 0 | 1 |
11,004 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.FactoryGitHubConfiguration
|
class FactoryGitHubConfiguration(FactoryRepoConfiguration):
"""Factory's GitHub repo information.
All required parameters must be populated in order to send to server.
:ivar type: Type of repo configuration. Required.
:vartype type: str
:ivar account_name: Account name. Required.
:vartype account_name: str
:ivar repository_name: Repository name. Required.
:vartype repository_name: str
:ivar collaboration_branch: Collaboration branch. Required.
:vartype collaboration_branch: str
:ivar root_folder: Root folder. Required.
:vartype root_folder: str
:ivar last_commit_id: Last commit id.
:vartype last_commit_id: str
:ivar disable_publish: Disable manual publish operation in ADF studio to favor automated
publish.
:vartype disable_publish: bool
:ivar host_name: GitHub Enterprise host name. For example: ``https://github.mydomain.com``.
:vartype host_name: str
:ivar client_id: GitHub bring your own app client id.
:vartype client_id: str
:ivar client_secret: GitHub bring your own app client secret information.
:vartype client_secret: ~azure.mgmt.datafactory.models.GitHubClientSecret
"""
_validation = {
"type": {"required": True},
"account_name": {"required": True},
"repository_name": {"required": True},
"collaboration_branch": {"required": True},
"root_folder": {"required": True},
}
_attribute_map = {
"type": {"key": "type", "type": "str"},
"account_name": {"key": "accountName", "type": "str"},
"repository_name": {"key": "repositoryName", "type": "str"},
"collaboration_branch": {"key": "collaborationBranch", "type": "str"},
"root_folder": {"key": "rootFolder", "type": "str"},
"last_commit_id": {"key": "lastCommitId", "type": "str"},
"disable_publish": {"key": "disablePublish", "type": "bool"},
"host_name": {"key": "hostName", "type": "str"},
"client_id": {"key": "clientId", "type": "str"},
"client_secret": {"key": "clientSecret", "type": "GitHubClientSecret"},
}
def __init__(
self,
*,
account_name: str,
repository_name: str,
collaboration_branch: str,
root_folder: str,
last_commit_id: Optional[str] = None,
disable_publish: Optional[bool] = None,
host_name: Optional[str] = None,
client_id: Optional[str] = None,
client_secret: Optional["_models.GitHubClientSecret"] = None,
**kwargs: Any
) -> None:
"""
:keyword account_name: Account name. Required.
:paramtype account_name: str
:keyword repository_name: Repository name. Required.
:paramtype repository_name: str
:keyword collaboration_branch: Collaboration branch. Required.
:paramtype collaboration_branch: str
:keyword root_folder: Root folder. Required.
:paramtype root_folder: str
:keyword last_commit_id: Last commit id.
:paramtype last_commit_id: str
:keyword disable_publish: Disable manual publish operation in ADF studio to favor automated
publish.
:paramtype disable_publish: bool
:keyword host_name: GitHub Enterprise host name. For example: ``https://github.mydomain.com``.
:paramtype host_name: str
:keyword client_id: GitHub bring your own app client id.
:paramtype client_id: str
:keyword client_secret: GitHub bring your own app client secret information.
:paramtype client_secret: ~azure.mgmt.datafactory.models.GitHubClientSecret
"""
super().__init__(
account_name=account_name,
repository_name=repository_name,
collaboration_branch=collaboration_branch,
root_folder=root_folder,
last_commit_id=last_commit_id,
disable_publish=disable_publish,
**kwargs
)
self.type: str = "FactoryGitHubConfiguration"
self.host_name = host_name
self.client_id = client_id
self.client_secret = client_secret
|
class FactoryGitHubConfiguration(FactoryRepoConfiguration):
'''Factory's GitHub repo information.
All required parameters must be populated in order to send to server.
:ivar type: Type of repo configuration. Required.
:vartype type: str
:ivar account_name: Account name. Required.
:vartype account_name: str
:ivar repository_name: Repository name. Required.
:vartype repository_name: str
:ivar collaboration_branch: Collaboration branch. Required.
:vartype collaboration_branch: str
:ivar root_folder: Root folder. Required.
:vartype root_folder: str
:ivar last_commit_id: Last commit id.
:vartype last_commit_id: str
:ivar disable_publish: Disable manual publish operation in ADF studio to favor automated
publish.
:vartype disable_publish: bool
:ivar host_name: GitHub Enterprise host name. For example: ``https://github.mydomain.com``.
:vartype host_name: str
:ivar client_id: GitHub bring your own app client id.
:vartype client_id: str
:ivar client_secret: GitHub bring your own app client secret information.
:vartype client_secret: ~azure.mgmt.datafactory.models.GitHubClientSecret
'''
def __init__(
self,
*,
account_name: str,
repository_name: str,
collaboration_branch: str,
root_folder: str,
last_commit_id: Optional[str] = None,
disable_publish: Optional[bool] = None,
host_name: Optional[str] = None,
client_id: Optional[str] = None,
client_secret: Optional["_models.GitHubClientSecret"] = None,
**kwargs: Any
) -> None:
'''
:keyword account_name: Account name. Required.
:paramtype account_name: str
:keyword repository_name: Repository name. Required.
:paramtype repository_name: str
:keyword collaboration_branch: Collaboration branch. Required.
:paramtype collaboration_branch: str
:keyword root_folder: Root folder. Required.
:paramtype root_folder: str
:keyword last_commit_id: Last commit id.
:paramtype last_commit_id: str
:keyword disable_publish: Disable manual publish operation in ADF studio to favor automated
publish.
:paramtype disable_publish: bool
:keyword host_name: GitHub Enterprise host name. For example: ``https://github.mydomain.com``.
:paramtype host_name: str
:keyword client_id: GitHub bring your own app client id.
:paramtype client_id: str
:keyword client_secret: GitHub bring your own app client secret information.
:paramtype client_secret: ~azure.mgmt.datafactory.models.GitHubClientSecret
'''
pass
| 2 | 2 | 48 | 0 | 27 | 21 | 1 | 0.96 | 1 | 4 | 0 | 0 | 1 | 4 | 1 | 17 | 97 | 5 | 47 | 21 | 32 | 45 | 9 | 8 | 7 | 1 | 3 | 0 | 1 |
11,005 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.FactoryIdentity
|
class FactoryIdentity(_serialization.Model):
"""Identity properties of the factory resource.
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 type: The identity type. Required. Known values are: "SystemAssigned", "UserAssigned",
and "SystemAssigned,UserAssigned".
:vartype type: str or ~azure.mgmt.datafactory.models.FactoryIdentityType
:ivar principal_id: The principal id of the identity.
:vartype principal_id: str
:ivar tenant_id: The client tenant id of the identity.
:vartype tenant_id: str
:ivar user_assigned_identities: List of user assigned identities for the factory.
:vartype user_assigned_identities: dict[str, JSON]
"""
_validation = {
"type": {"required": True},
"principal_id": {"readonly": True},
"tenant_id": {"readonly": True},
}
_attribute_map = {
"type": {"key": "type", "type": "str"},
"principal_id": {"key": "principalId", "type": "str"},
"tenant_id": {"key": "tenantId", "type": "str"},
"user_assigned_identities": {"key": "userAssignedIdentities", "type": "{object}"},
}
def __init__(
self,
*,
type: Union[str, "_models.FactoryIdentityType"],
user_assigned_identities: Optional[Dict[str, JSON]] = None,
**kwargs: Any
) -> None:
"""
:keyword type: The identity type. Required. Known values are: "SystemAssigned", "UserAssigned",
and "SystemAssigned,UserAssigned".
:paramtype type: str or ~azure.mgmt.datafactory.models.FactoryIdentityType
:keyword user_assigned_identities: List of user assigned identities for the factory.
:paramtype user_assigned_identities: dict[str, JSON]
"""
super().__init__(**kwargs)
self.type = type
self.principal_id = None
self.tenant_id = None
self.user_assigned_identities = user_assigned_identities
|
class FactoryIdentity(_serialization.Model):
'''Identity properties of the factory resource.
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 type: The identity type. Required. Known values are: "SystemAssigned", "UserAssigned",
and "SystemAssigned,UserAssigned".
:vartype type: str or ~azure.mgmt.datafactory.models.FactoryIdentityType
:ivar principal_id: The principal id of the identity.
:vartype principal_id: str
:ivar tenant_id: The client tenant id of the identity.
:vartype tenant_id: str
:ivar user_assigned_identities: List of user assigned identities for the factory.
:vartype user_assigned_identities: dict[str, JSON]
'''
def __init__(
self,
*,
type: Union[str, "_models.FactoryIdentityType"],
user_assigned_identities: Optional[Dict[str, JSON]] = None,
**kwargs: Any
) -> None:
'''
:keyword type: The identity type. Required. Known values are: "SystemAssigned", "UserAssigned",
and "SystemAssigned,UserAssigned".
:paramtype type: str or ~azure.mgmt.datafactory.models.FactoryIdentityType
:keyword user_assigned_identities: List of user assigned identities for the factory.
:paramtype user_assigned_identities: dict[str, JSON]
'''
pass
| 2 | 2 | 19 | 0 | 12 | 7 | 1 | 0.83 | 1 | 3 | 0 | 0 | 1 | 4 | 1 | 16 | 50 | 6 | 24 | 14 | 16 | 20 | 9 | 8 | 7 | 1 | 2 | 0 | 1 |
11,006 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.ExposureControlBatchRequest
|
class ExposureControlBatchRequest(_serialization.Model):
"""A list of exposure control features.
All required parameters must be populated in order to send to server.
:ivar exposure_control_requests: List of exposure control features. Required.
:vartype exposure_control_requests: list[~azure.mgmt.datafactory.models.ExposureControlRequest]
"""
_validation = {
"exposure_control_requests": {"required": True},
}
_attribute_map = {
"exposure_control_requests": {"key": "exposureControlRequests", "type": "[ExposureControlRequest]"},
}
def __init__(self, *, exposure_control_requests: List["_models.ExposureControlRequest"], **kwargs: Any) -> None:
"""
:keyword exposure_control_requests: List of exposure control features. Required.
:paramtype exposure_control_requests:
list[~azure.mgmt.datafactory.models.ExposureControlRequest]
"""
super().__init__(**kwargs)
self.exposure_control_requests = exposure_control_requests
|
class ExposureControlBatchRequest(_serialization.Model):
'''A list of exposure control features.
All required parameters must be populated in order to send to server.
:ivar exposure_control_requests: List of exposure control features. Required.
:vartype exposure_control_requests: list[~azure.mgmt.datafactory.models.ExposureControlRequest]
'''
def __init__(self, *, exposure_control_requests: List["_models.ExposureControlRequest"], **kwargs: Any) -> None:
'''
:keyword exposure_control_requests: List of exposure control features. Required.
:paramtype exposure_control_requests:
list[~azure.mgmt.datafactory.models.ExposureControlRequest]
'''
pass
| 2 | 2 | 8 | 0 | 3 | 5 | 1 | 1 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 16 | 25 | 5 | 10 | 5 | 8 | 10 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
11,007 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.DatasetReference
|
class DatasetReference(_serialization.Model):
"""Dataset reference type.
All required parameters must be populated in order to send to server.
:ivar type: Dataset reference type. Required. "DatasetReference"
:vartype type: str or ~azure.mgmt.datafactory.models.DatasetReferenceType
:ivar reference_name: Reference dataset name. Required.
:vartype reference_name: str
:ivar parameters: Arguments for dataset.
:vartype parameters: dict[str, JSON]
"""
_validation = {
"type": {"required": True},
"reference_name": {"required": True},
}
_attribute_map = {
"type": {"key": "type", "type": "str"},
"reference_name": {"key": "referenceName", "type": "str"},
"parameters": {"key": "parameters", "type": "{object}"},
}
def __init__(
self,
*,
type: Union[str, "_models.DatasetReferenceType"],
reference_name: str,
parameters: Optional[Dict[str, JSON]] = None,
**kwargs: Any
) -> None:
"""
:keyword type: Dataset reference type. Required. "DatasetReference"
:paramtype type: str or ~azure.mgmt.datafactory.models.DatasetReferenceType
:keyword reference_name: Reference dataset name. Required.
:paramtype reference_name: str
:keyword parameters: Arguments for dataset.
:paramtype parameters: dict[str, JSON]
"""
super().__init__(**kwargs)
self.type = type
self.reference_name = reference_name
self.parameters = parameters
|
class DatasetReference(_serialization.Model):
'''Dataset reference type.
All required parameters must be populated in order to send to server.
:ivar type: Dataset reference type. Required. "DatasetReference"
:vartype type: str or ~azure.mgmt.datafactory.models.DatasetReferenceType
:ivar reference_name: Reference dataset name. Required.
:vartype reference_name: str
:ivar parameters: Arguments for dataset.
:vartype parameters: dict[str, JSON]
'''
def __init__(
self,
*,
type: Union[str, "_models.DatasetReferenceType"],
reference_name: str,
parameters: Optional[Dict[str, JSON]] = None,
**kwargs: Any
) -> None:
'''
:keyword type: Dataset reference type. Required. "DatasetReference"
:paramtype type: str or ~azure.mgmt.datafactory.models.DatasetReferenceType
:keyword reference_name: Reference dataset name. Required.
:paramtype reference_name: str
:keyword parameters: Arguments for dataset.
:paramtype parameters: dict[str, JSON]
'''
pass
| 2 | 2 | 20 | 0 | 12 | 8 | 1 | 0.77 | 1 | 3 | 0 | 0 | 1 | 3 | 1 | 16 | 44 | 5 | 22 | 14 | 13 | 17 | 8 | 7 | 6 | 1 | 2 | 0 | 1 |
11,008 |
Azure/azure-cli-extensions
|
src/securityinsight/azext_sentinel/aaz/latest/sentinel/alert_rule/action/_show.py
|
azext_sentinel.aaz.latest.sentinel.alert_rule.action._show.Show
|
class Show(AAZCommand):
"""Get the action of alert rule.
"""
_aaz_info = {
"version": "2022-06-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/providers/microsoft.securityinsights/alertrules/{}/actions/{}", "2022-06-01-preview"],
]
}
def _handler(self, command_args):
super()._handler(command_args)
self._execute_operations()
return 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.action_name = AAZStrArg(
options=["-n", "--name", "--action-name"],
help="Name of action.",
required=True,
is_experimental=True,
id_part="child_name_2",
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.rule_name = AAZStrArg(
options=["--rule-name"],
help="Name of alert rule.",
required=True,
is_experimental=True,
id_part="child_name_1",
)
_args_schema.workspace_name = AAZStrArg(
options=["-w", "--workspace-name"],
help="The name of the workspace.",
required=True,
is_experimental=True,
id_part="name",
)
return cls._args_schema
def _execute_operations(self):
self.ActionsGet(ctx=self.ctx)()
def _output(self, *args, **kwargs):
result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True)
return result
class ActionsGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}",
**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(
"actionId", self.ctx.args.action_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"ruleId", self.ctx.args.rule_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
**self.serialize_url_param(
"workspaceName", self.ctx.args.workspace_name,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-06-01-preview",
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.etag = AAZStrType()
_schema_on_200.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.logic_app_resource_id = AAZStrType(
serialized_name="logicAppResourceId",
flags={"required": True},
)
properties.workflow_id = AAZStrType(
serialized_name="workflowId",
)
system_data = cls._schema_on_200.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
flags={"read_only": True},
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
flags={"read_only": True},
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
flags={"read_only": True},
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
flags={"read_only": True},
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
flags={"read_only": True},
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
flags={"read_only": True},
)
return cls._schema_on_200
|
class Show(AAZCommand):
'''Get the action of alert rule.
'''
def _handler(self, command_args):
pass
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
pass
def _execute_operations(self):
pass
def _output(self, *args, **kwargs):
pass
class ActionsGet(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
| 23 | 1 | 13 | 1 | 12 | 0 | 1 | 0.02 | 1 | 2 | 1 | 0 | 3 | 0 | 4 | 4 | 203 | 25 | 175 | 38 | 152 | 3 | 71 | 30 | 56 | 2 | 1 | 1 | 16 |
11,009 |
Azure/azure-cli-extensions
|
src/securityinsight/azext_sentinel/aaz/latest/sentinel/alert_rule/action/_delete.py
|
azext_sentinel.aaz.latest.sentinel.alert_rule.action._delete.Delete
|
class Delete(AAZCommand):
"""Delete the action of alert rule.
"""
_aaz_info = {
"version": "2022-06-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/providers/microsoft.securityinsights/alertrules/{}/actions/{}", "2022-06-01-preview"],
]
}
def _handler(self, command_args):
super()._handler(command_args)
self._execute_operations()
return None
_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.action_name = AAZStrArg(
options=["-n", "--name", "--action-name"],
help="Name of action.",
required=True,
is_experimental=True,
id_part="child_name_2",
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.rule_name = AAZStrArg(
options=["--rule-name"],
help="Name of alert rule.",
required=True,
is_experimental=True,
id_part="child_name_1",
)
_args_schema.workspace_name = AAZStrArg(
options=["-w", "--workspace-name"],
help="The name of the workspace.",
required=True,
is_experimental=True,
id_part="name",
)
return cls._args_schema
def _execute_operations(self):
self.ActionsDelete(ctx=self.ctx)()
class ActionsDelete(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 [200]:
return self.on_200(session)
if session.http_response.status_code in [204]:
return self.on_204(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}",
**self.url_parameters
)
@property
def method(self):
return "DELETE"
@property
def error_format(self):
return "ODataV4Format"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"actionId", self.ctx.args.action_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"ruleId", self.ctx.args.rule_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
**self.serialize_url_param(
"workspaceName", self.ctx.args.workspace_name,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-06-01-preview",
required=True,
),
}
return parameters
def on_200(self, session):
pass
def on_204(self, session):
pass
|
class Delete(AAZCommand):
'''Delete the action of alert rule.
'''
def _handler(self, command_args):
pass
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
pass
def _execute_operations(self):
pass
class ActionsDelete(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
def on_200(self, session):
pass
def on_204(self, session):
pass
| 19 | 1 | 8 | 0 | 8 | 0 | 1 | 0.03 | 1 | 2 | 1 | 0 | 2 | 0 | 3 | 3 | 125 | 17 | 105 | 27 | 86 | 3 | 45 | 21 | 32 | 3 | 1 | 1 | 14 |
11,010 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.LinkedServiceResource
|
class LinkedServiceResource(SubResource):
"""Linked service resource type.
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 resource identifier.
:vartype id: str
:ivar name: The resource name.
:vartype name: str
:ivar type: The resource type.
:vartype type: str
:ivar etag: Etag identifies change in the resource.
:vartype etag: str
:ivar properties: Properties of linked service. Required.
:vartype properties: ~azure.mgmt.datafactory.models.LinkedService
"""
_validation = {
"id": {"readonly": True},
"name": {"readonly": True},
"type": {"readonly": True},
"etag": {"readonly": True},
"properties": {"required": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"etag": {"key": "etag", "type": "str"},
"properties": {"key": "properties", "type": "LinkedService"},
}
def __init__(self, *, properties: "_models.LinkedService", **kwargs: Any) -> None:
"""
:keyword properties: Properties of linked service. Required.
:paramtype properties: ~azure.mgmt.datafactory.models.LinkedService
"""
super().__init__(**kwargs)
self.properties = properties
|
class LinkedServiceResource(SubResource):
'''Linked service resource type.
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 resource identifier.
:vartype id: str
:ivar name: The resource name.
:vartype name: str
:ivar type: The resource type.
:vartype type: str
:ivar etag: Etag identifies change in the resource.
:vartype etag: str
:ivar properties: Properties of linked service. Required.
:vartype properties: ~azure.mgmt.datafactory.models.LinkedService
'''
def __init__(self, *, properties: "_models.LinkedService", **kwargs: Any) -> None:
'''
:keyword properties: Properties of linked service. Required.
:paramtype properties: ~azure.mgmt.datafactory.models.LinkedService
'''
pass
| 2 | 2 | 7 | 0 | 3 | 4 | 1 | 1 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 17 | 42 | 6 | 18 | 5 | 16 | 18 | 6 | 5 | 4 | 1 | 3 | 0 | 1 |
11,011 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.LogLocationSettings
|
class LogLocationSettings(_serialization.Model):
"""Log location settings.
All required parameters must be populated in order to send to server.
:ivar linked_service_name: Log storage linked service reference. Required.
:vartype linked_service_name: ~azure.mgmt.datafactory.models.LinkedServiceReference
:ivar path: The path to storage for storing detailed logs of activity execution. Type: string
(or Expression with resultType string).
:vartype path: JSON
"""
_validation = {
"linked_service_name": {"required": True},
}
_attribute_map = {
"linked_service_name": {"key": "linkedServiceName", "type": "LinkedServiceReference"},
"path": {"key": "path", "type": "object"},
}
def __init__(
self, *, linked_service_name: "_models.LinkedServiceReference", path: Optional[JSON] = None, **kwargs: Any
) -> None:
"""
:keyword linked_service_name: Log storage linked service reference. Required.
:paramtype linked_service_name: ~azure.mgmt.datafactory.models.LinkedServiceReference
:keyword path: The path to storage for storing detailed logs of activity execution. Type:
string (or Expression with resultType string).
:paramtype path: JSON
"""
super().__init__(**kwargs)
self.linked_service_name = linked_service_name
self.path = path
|
class LogLocationSettings(_serialization.Model):
'''Log location settings.
All required parameters must be populated in order to send to server.
:ivar linked_service_name: Log storage linked service reference. Required.
:vartype linked_service_name: ~azure.mgmt.datafactory.models.LinkedServiceReference
:ivar path: The path to storage for storing detailed logs of activity execution. Type: string
(or Expression with resultType string).
:vartype path: JSON
'''
def __init__(
self, *, linked_service_name: "_models.LinkedServiceReference", path: Optional[JSON] = None, **kwargs: Any
) -> None:
'''
:keyword linked_service_name: Log storage linked service reference. Required.
:paramtype linked_service_name: ~azure.mgmt.datafactory.models.LinkedServiceReference
:keyword path: The path to storage for storing detailed logs of activity execution. Type:
string (or Expression with resultType string).
:paramtype path: JSON
'''
pass
| 2 | 2 | 13 | 0 | 6 | 7 | 1 | 1.07 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 16 | 34 | 5 | 14 | 8 | 10 | 15 | 7 | 6 | 5 | 1 | 2 | 0 | 1 |
11,012 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/tests/latest/test_PrivateLinkAndPrivateEndpointConnection_scenario.py
|
azext_connectedmachine.tests.latest.test_PrivateLinkAndPrivateEndpointConnection_scenario.PrivateLinkAndPrivateEndpointConnectionScenarioTest
|
class PrivateLinkAndPrivateEndpointConnectionScenarioTest(ScenarioTest):
@AllowLargeResponse(size_kb=9999)
@ResourceGroupPreparer(name_prefix='cli_test_privatelink')
def test_private_link(self):
rand_string = 'test4'
self.kwargs.update({
'machine': 'testmachine',
'rg': 'ytongtest',
'scope': 'scope-' + rand_string,
'vnet': 'vnet-' + rand_string,
'subnet': 'subnet-' + rand_string,
'private_endpoint': 'pe-' + rand_string,
'private_endpoint_connection': 'pec-' + rand_string,
'location': 'eastus',
'customScriptName': 'custom-' + rand_string,
})
# Prepare network
self.cmd('az network vnet create -n {vnet} -g {rg} -l {location} --subnet-name {subnet}',
checks=self.check('length(newVNet.subnets)', 1))
self.cmd('az network vnet subnet update -n {subnet} --vnet-name {vnet} -g {rg} '
'--disable-private-endpoint-network-policies true',
checks=self.check('privateEndpointNetworkPolicies', 'Disabled'))
# Create a private link scope
self.cmd('az connectedmachine private-link-scope create '
'--location "{location}" '
'--resource-group "{rg}" '
'--scope-name "{scope}"',
checks=[
self.check('name', '{scope}'),
self.check('properties.publicNetworkAccess', 'Disabled')
])
# Update the private link scope
self.cmd('az connectedmachine private-link-scope update '
'--tags Tag1="Value1" '
'--public-network-access Enabled '
'--resource-group "{rg}" '
'--scope-name "{scope}"',
checks=[
self.check('name', '{scope}'),
self.check('properties.publicNetworkAccess', 'Enabled')
])
# Test private link scope list
self.cmd('az connectedmachine private-link-scope list '
'--resource-group "{rg}"',
checks=[])
# Private link scope show
private_link_scope = self.cmd(
'az connectedmachine private-link-scope show --scope-name {scope} -g {rg}').get_output_in_json()
self.kwargs['scope_id'] = private_link_scope['id']
# Test private link resource show
self.cmd('az connectedmachine private-link-resource show --scope-name {scope} -g {rg} --group-name hybridcompute', checks=[
# self.check('length(@)', 6)
])
# Test private link resource list
self.cmd(
'az connectedmachine private-link-resource list --scope-name {scope} -g {rg}', checks=[])
# DO NOT remove --location, otherwise it will print out an error saying vnet-test not found
result = self.cmd('az network private-endpoint create -g {rg} -n {private_endpoint} --vnet-name {vnet} --subnet {subnet} --private-connection-resource-id {scope_id} '
'--connection-name {private_endpoint_connection} --group-id hybridcompute --location {location}').get_output_in_json()
self.assertTrue(
self.kwargs['private_endpoint'].lower() in result['name'].lower())
connection_list = self.cmd('az connectedmachine private-endpoint-connection list '
'--resource-group "{rg}" '
'--scope-name "{scope}"').get_output_in_json()
self.kwargs['private_endpoint_connection_name'] = connection_list[0]['name']
self.cmd('az connectedmachine private-endpoint-connection update '
'--description "Rejected by AZ CLI" '
'--status "Rejected" '
'--name "{private_endpoint_connection_name}" '
'--resource-group "{rg}" '
'--scope-name "{scope}"',
checks=[
self.check('name', '{private_endpoint_connection_name}'),
self.check(
'properties.privateLinkServiceConnectionState.description', 'Rejected by AZ CLI'),
self.check(
'properties.privateLinkServiceConnectionState.status', 'Rejected')
])
self.cmd('az connectedmachine private-endpoint-connection show '
'--name "{private_endpoint_connection_name}" '
'--resource-group "{rg}" '
'--scope-name "{scope}"',
checks=[
self.check('name', '{private_endpoint_connection_name}'),
self.check(
'properties.privateLinkServiceConnectionState.description', 'Rejected by AZ CLI'),
self.check(
'properties.privateLinkServiceConnectionState.status', 'Rejected')
])
self.cmd('az connectedmachine private-endpoint-connection delete -y '
'--name "{private_endpoint_connection_name}" '
'--resource-group "{rg}" '
'--scope-name "{scope}"',
checks=[])
self.cmd('az connectedmachine private-endpoint-connection list '
'--resource-group "{rg}" '
'--scope-name "{scope}"',
checks=[
self.check('length(@)', 0)
])
self.cmd('az connectedmachine private-link-scope delete -y '
'--resource-group "{rg}" '
'--scope-name "{scope}"',
checks=[])
|
class PrivateLinkAndPrivateEndpointConnectionScenarioTest(ScenarioTest):
@AllowLargeResponse(size_kb=9999)
@ResourceGroupPreparer(name_prefix='cli_test_privatelink')
def test_private_link(self):
pass
| 4 | 0 | 108 | 14 | 85 | 9 | 1 | 0.1 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 111 | 14 | 88 | 7 | 84 | 9 | 22 | 6 | 20 | 1 | 1 | 0 | 1 |
11,013 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/tests/latest/test_NetworkConfigurationPerimeter_scenario.py
|
azext_connectedmachine.tests.latest.test_NetworkConfigurationPerimeter_scenario.NetworkConfigurationPerimeterScenarioTest
|
class NetworkConfigurationPerimeterScenarioTest(ScenarioTest):
@ResourceGroupPreparer(name_prefix='cli_test_networkconfigurationperimeter')
def test_netowrk_configuration(self):
rand_string = 'test'
self.kwargs.update({
'machine': 'testmachine',
'rg': 'ytongtest',
'scope': 'myScope3',
'location': 'eastus',
'subscription': '00000000-0000-0000-0000-000000000000',
'perimeterName': '00000000-0000-0000-0000-000000000000.testAssociation',
})
# Create a private link scope, NSP and perimeter profile, and associate them
# az connectedmachine private-link-scope create --location eastus --resource-group ytongtest --scope-name myScope3
# az network perimeter create -n testPerimeter -g ytongtest -l eastus
# az network perimeter profile create -n testProfile --perimeter-name testPerimeter -g ytongtest
# az network perimeter association create -n testAssociation --perimeter-name testPerimeter -g ytongtest --access-mode Learning
# --private-link-resource "{id:/subscriptions/b24cc8ee-df4f-48ac-94cf-46edf36b0fae/resourceGroups/ytongtest/providers/Microsoft.HybridCompute/privateLinkScopes/myScope3}"
# --profile "{id:/subscriptions/b24cc8ee-df4f-48ac-94cf-46edf36b0fae/resourceGroups/ytongtest/providers/Microsoft.Network/networkSecurityPerimeters/testPerimeter/profiles/testProfile}"
# perimeter name can be found by running the list command, under 'name'
# network security perimeter configuration
self.cmd('az connectedmachine private-link-scope network-security-perimeter-configuration list '
'--resource-group "{rg}" '
'--scope-name "{scope}" '
'--subscription "{subscription}"',
checks=[])
self.cmd('az connectedmachine private-link-scope network-security-perimeter-configuration show '
'--resource-group "{rg}" '
'--scope-name "{scope}" '
'--subscription "{subscription}" '
'--perimeter-name "{perimeterName}"',
checks=[])
self.cmd('az connectedmachine private-link-scope network-security-perimeter-configuration reconcile '
'--resource-group "{rg}" '
'--scope-name "{scope}" '
'--subscription "{subscription}" '
'--perimeter-name "{perimeterName}"',
checks=[])
|
class NetworkConfigurationPerimeterScenarioTest(ScenarioTest):
@ResourceGroupPreparer(name_prefix='cli_test_networkconfigurationperimeter')
def test_netowrk_configuration(self):
pass
| 3 | 0 | 41 | 5 | 27 | 9 | 1 | 0.31 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 44 | 6 | 29 | 4 | 26 | 9 | 7 | 3 | 5 | 1 | 1 | 0 | 1 |
11,014 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/tests/latest/test_ESULicense_scenario.py
|
azext_connectedmachine.tests.latest.test_ESULicense_scenario.ESULicenseScenarioTest
|
class ESULicenseScenarioTest(ScenarioTest):
@AllowLargeResponse(size_kb=9999)
@ResourceGroupPreparer(name_prefix='cli_test_esulicense')
def test_esu_license(self):
self.kwargs.update({
'customScriptName': 'custom-test',
'machine': 'testmachine',
'machineSA': 'WIN-A3C7NS0B144',
'machinePaygo': 'WIN-IAH3TLSP7A8',
'rg': 'ytongtest',
'location': 'eastus',
'subscription': '00000000-0000-0000-0000-000000000000',
'licenseName': 'myESULicense',
'licenseResourceIdProfile': '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PayGo_cmdlet/providers/Microsoft.HybridCompute/machines/WIN-IAH3TLSP7A8/licenseProfiles/default',
'rgProfile': 'PayGo_cmdlet',
'productFfeatures': '[{ \'name\':\'Hotpatch\', \'subscriptionStatus\':\'Enabled\'}]'
})
self.cmd('az connectedmachine license create '
'--name "{licenseName}" '
'--resource-group "{rg}" '
'--location "{location}" '
'--license-type "ESU" '
'--state "Activated" '
'--target "Windows Server 2012" '
'--edition "Datacenter" '
'--type "pCore" '
'--processors 16',
checks=[
self.check('name', '{licenseName}'),
])
self.cmd('az connectedmachine license list --subscription {subscription}', checks=[
self.check('length(@)', 8)
])
self.cmd('az connectedmachine license show --resource-group {rg} --name {licenseName} --subscription {subscription}', checks=[
self.check('length(@)', 8)
])
self.cmd('az connectedmachine license update '
'--name "{licenseName}" '
'--resource-group "{rg}" '
'--license-type "ESU" '
'--state "Deactivated" '
'--target "Windows Server 2012" '
'--edition "Datacenter" '
'--type "pCore" '
'--processors 16',
checks=[
self.check('name', '{licenseName}'),
])
self.cmd('az connectedmachine license delete -y '
'--name "{licenseName}" '
'--subscription "{subscription}" '
'--resource-group "{rg}"',
checks=[])
self.cmd('az connectedmachine license-profile create '
'--machine-name "{machinePaygo}" '
'--resource-group "{rgProfile}" '
'--location "{location}" '
'--product-type "WindowsServer" '
'--subscription-status "Enabled" '
'--product-features "{productFfeatures}"',
checks=[
self.check('id', '{licenseResourceIdProfile}'),
])
# test SA service
# self.cmd('az connectedmachine license-profile create '
# '--machine-name "{machineSA}" '
# '--resource-group "{rgProfile}" '
# '--location "{location}" '
# '--software-assurance-customer True',
# checks=[
# self.check('provisioningState', 'Succeeded'),
# ])
self.cmd('az connectedmachine license-profile update '
'--machine-name "{machinePaygo}" '
'--resource-group "{rgProfile}" '
'--product-type "WindowsServer" '
'--subscription-status "Enabled" '
'--product-features "{productFfeatures}"',
checks=[
self.check('id', '{licenseResourceIdProfile}'),
])
self.cmd('az connectedmachine license-profile list --subscription {subscription} --resource-group {rgProfile} --machine-name {machinePaygo}', checks=[
self.check('length(@)', 1)
])
self.cmd('az connectedmachine license-profile show --resource-group {rgProfile} --machine-name {machinePaygo} --subscription {subscription}', checks=[
self.check('length(@)', 15)
])
self.cmd('az connectedmachine license-profile delete -y '
'--machine-name "{machinePaygo}" '
'--resource-group "{rgProfile}"',
checks=[])
|
class ESULicenseScenarioTest(ScenarioTest):
@AllowLargeResponse(size_kb=9999)
@ResourceGroupPreparer(name_prefix='cli_test_esulicense')
def test_esu_license(self):
pass
| 4 | 0 | 99 | 11 | 79 | 9 | 1 | 0.11 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 102 | 11 | 82 | 3 | 78 | 9 | 13 | 2 | 11 | 1 | 1 | 0 | 1 |
11,015 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/tests/latest/test_ConnectedMachineAndExtension_scenario.py
|
azext_connectedmachine.tests.latest.test_ConnectedMachineAndExtension_scenario.ConnectedMachineAndExtensionScenarioTest
|
class ConnectedMachineAndExtensionScenarioTest(ScenarioTest):
@AllowLargeResponse(100)
@ResourceGroupPreparer(name_prefix='cli_test_machineextension')
def test_machine_and_extension(self):
self.kwargs.update({
'machine': 'testmachine',
'rg': 'ytongtest',
'location': 'eastus',
'customScriptName': 'custom-test',
})
self.cmd('az connectedmachine show -n {machine} -g {rg}', checks=[
self.check('name', '{machine}'),
self.check('resourceGroup', '{rg}')
])
self.cmd('az connectedmachine list -g {rg}', checks=[
self.check('length(@)', 1)
])
self.cmd('az connectedmachine extension create '
'--name "{customScriptName}" '
'--location "{location}" '
'--type "NetworkWatcherAgentWindows" '
'--publisher "Microsoft.Azure.NetworkWatcher" '
'--type-handler-version "1.4.2798.3" '
'--machine-name "{machine}" '
'--resource-group "{rg}" '
'--settings "{{\\"commandToExecute\\":\\"powershell.exe ls\\"}}"',
checks=[
self.check('name', '{customScriptName}'),
self.check('properties.typeHandlerVersion', '1.4.2798.3'),
])
self.cmd('az connectedmachine extension list '
'--machine-name {machine} -g {rg}',
checks=[
# self.check('length(@)', 1)
])
self.cmd('az connectedmachine extension show '
'--name {customScriptName} '
'--machine-name "{machine}" '
'--resource-group "{rg}"',
checks=[
self.check('name', '{customScriptName}'),
self.check('properties.typeHandlerVersion', '1.4.2798.3')
])
self.cmd('az connectedmachine extension image show '
'--publisher "Microsoft.Azure.NetworkWatcher" '
'--extension-type "NetworkWatcherAgentWindows" '
'--location "{location}" '
'--version "1.4.2798.3"',
checks=[
self.check('version', '1.4.2798.3'),
self.check('publisher', 'microsoft.azure.networkwatcher'),
self.check('extensionType', 'networkwatcheragentwindows')
])
self.cmd('az connectedmachine extension image list '
'--publisher "Microsoft.Azure.NetworkWatcher" '
'--extension-type "NetworkWatcherAgentWindows" '
'--location "{location}"',
checks=[
])
self.cmd('az connectedmachine upgrade-extension '
'--extension-targets "{{\\"Microsoft.Azure.NetworkWatcher\\":{{\\"targetVersion\\":\\"1.4.3135.1\\"}}}}" '
'--machine-name "{machine}" '
'--resource-group "{rg}"',
checks=[])
self.cmd('az connectedmachine extension update '
'--name "{customScriptName}" '
'--enable-automatic-upgrade false '
'--settings "{{\\"commandToExecute\\":\\"dir\\"}}" '
'--machine-name "{machine}" '
'--resource-group "{rg}"',
checks=[
self.check('name', '{customScriptName}'),
self.check('properties.enableAutomaticUpgrade', False),
self.check('properties.provisioningState', 'Succeeded'),
self.check('properties.settings.commandToExecute', 'dir'),
self.check('properties.typeHandlerVersion', '1.4.2798.3')
])
self.cmd('az connectedmachine install-patches '
'--resource-group "{rg}" '
'--name "{machine}" '
'--maximum-duration "PT4H" '
'--reboot-setting "IfRequired" '
'--windows-parameters "{{\\"classificationsToInclude\\":[\\"Critical\\", \\"Security\\"]}}"',
checks=[
self.check('status', 'Succeeded')
])
self.cmd('az connectedmachine assess-patches '
'--resource-group "{rg}" '
'--name "{machine}"',
checks=[
self.check('status', 'Succeeded')
])
self.cmd('az connectedmachine extension delete -y '
'--name "{customScriptName}" '
'--machine-name "{machine}" '
'--resource-group "{rg}"',
checks=[])
self.cmd('az connectedmachine delete -y '
'--name "{machine}" '
'--resource-group "{rg}"',
checks=[])
|
class ConnectedMachineAndExtensionScenarioTest(ScenarioTest):
@AllowLargeResponse(100)
@ResourceGroupPreparer(name_prefix='cli_test_machineextension')
def test_machine_and_extension(self):
pass
| 4 | 0 | 111 | 13 | 97 | 1 | 1 | 0.01 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 114 | 13 | 100 | 3 | 96 | 1 | 16 | 2 | 14 | 1 | 1 | 0 | 1 |
11,016 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/run_command/_wait.py
|
azext_connectedmachine.aaz.latest.connectedmachine.run_command._wait.Wait.MachineRunCommandsGet
|
class MachineRunCommandsGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"runCommandName", self.ctx.args.run_command_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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(
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType(
flags={"required": True},
)
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.async_execution = AAZBoolType(
serialized_name="asyncExecution",
)
properties.error_blob_managed_identity = AAZObjectType(
serialized_name="errorBlobManagedIdentity",
)
_WaitHelper._build_schema_run_command_managed_identity_read(
properties.error_blob_managed_identity)
properties.error_blob_uri = AAZStrType(
serialized_name="errorBlobUri",
)
properties.instance_view = AAZObjectType(
serialized_name="instanceView",
flags={"read_only": True},
)
properties.output_blob_managed_identity = AAZObjectType(
serialized_name="outputBlobManagedIdentity",
)
_WaitHelper._build_schema_run_command_managed_identity_read(
properties.output_blob_managed_identity)
properties.output_blob_uri = AAZStrType(
serialized_name="outputBlobUri",
)
properties.parameters = AAZListType()
properties.protected_parameters = AAZListType(
serialized_name="protectedParameters",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.run_as_password = AAZStrType(
serialized_name="runAsPassword",
flags={"secret": True},
)
properties.run_as_user = AAZStrType(
serialized_name="runAsUser",
)
properties.source = AAZObjectType()
properties.timeout_in_seconds = AAZIntType(
serialized_name="timeoutInSeconds",
)
instance_view = cls._schema_on_200.properties.instance_view
instance_view.end_time = AAZStrType(
serialized_name="endTime",
)
instance_view.error = AAZStrType()
instance_view.execution_message = AAZStrType(
serialized_name="executionMessage",
)
instance_view.execution_state = AAZStrType(
serialized_name="executionState",
)
instance_view.exit_code = AAZIntType(
serialized_name="exitCode",
)
instance_view.output = AAZStrType()
instance_view.start_time = AAZStrType(
serialized_name="startTime",
)
instance_view.statuses = AAZListType()
statuses = cls._schema_on_200.properties.instance_view.statuses
statuses.Element = AAZObjectType()
_element = cls._schema_on_200.properties.instance_view.statuses.Element
_element.code = AAZStrType()
_element.display_status = AAZStrType(
serialized_name="displayStatus",
)
_element.level = AAZStrType()
_element.message = AAZStrType()
_element.time = AAZStrType()
parameters = cls._schema_on_200.properties.parameters
parameters.Element = AAZObjectType()
_WaitHelper._build_schema_run_command_input_parameter_read(
parameters.Element)
protected_parameters = cls._schema_on_200.properties.protected_parameters
protected_parameters.Element = AAZObjectType()
_WaitHelper._build_schema_run_command_input_parameter_read(
protected_parameters.Element)
source = cls._schema_on_200.properties.source
source.command_id = AAZStrType(
serialized_name="commandId",
)
source.script = AAZStrType()
source.script_uri = AAZStrType(
serialized_name="scriptUri",
)
source.script_uri_managed_identity = AAZObjectType(
serialized_name="scriptUriManagedIdentity",
)
_WaitHelper._build_schema_run_command_managed_identity_read(
source.script_uri_managed_identity)
system_data = cls._schema_on_200.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class MachineRunCommandsGet(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
| 17 | 0 | 23 | 1 | 21 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 225 | 23 | 202 | 35 | 185 | 0 | 94 | 28 | 84 | 2 | 1 | 1 | 11 |
11,017 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/run_command/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.run_command._update.Update.MachineRunCommandsGet
|
class MachineRunCommandsGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"runCommandName", self.ctx.args.run_command_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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()
_UpdateHelper._build_schema_machine_run_command_read(
cls._schema_on_200)
return cls._schema_on_200
|
class MachineRunCommandsGet(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
| 17 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 86 | 13 | 73 | 25 | 56 | 0 | 33 | 18 | 23 | 2 | 1 | 1 | 11 |
11,018 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/run_command/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.run_command._update.Update.MachineRunCommandsCreateOrUpdate
|
class MachineRunCommandsCreateOrUpdate(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_201,
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, 201]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
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(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"runCommandName", self.ctx.args.run_command_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
value=self.ctx.vars.instance,
)
return self.serialize_content(_content_value)
def on_200_201(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200_201
)
_schema_on_200_201 = None
@classmethod
def _build_schema_on_200_201(cls):
if cls._schema_on_200_201 is not None:
return cls._schema_on_200_201
cls._schema_on_200_201 = AAZObjectType()
_UpdateHelper._build_schema_machine_run_command_read(
cls._schema_on_200_201)
return cls._schema_on_200_201
|
class MachineRunCommandsCreateOrUpdate(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
@property
def content(self):
pass
def on_200_201(self, session):
pass
@classmethod
def _build_schema_on_200_201(cls):
pass
| 19 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 9 | 1 | 10 | 10 | 114 | 15 | 99 | 29 | 80 | 0 | 38 | 20 | 27 | 3 | 1 | 1 | 13 |
11,019 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/run_command/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.run_command._update.Update.InstanceUpdateByJson
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
self._update_instance(self.ctx.vars.instance)
def _update_instance(self, instance):
_instance_value, _builder = self.new_content_builder(
self.ctx.args,
value=instance,
typ=AAZObjectType
)
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
_builder.set_prop("tags", AAZDictType, ".tags")
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop(
"asyncExecution", AAZBoolType, ".async_execution")
_UpdateHelper._build_schema_run_command_managed_identity_update(properties.set_prop(
"errorBlobManagedIdentity", AAZObjectType, ".error_blob_managed_identity"))
properties.set_prop(
"errorBlobUri", AAZStrType, ".error_blob_uri")
_UpdateHelper._build_schema_run_command_managed_identity_update(properties.set_prop(
"outputBlobManagedIdentity", AAZObjectType, ".output_blob_managed_identity"))
properties.set_prop(
"outputBlobUri", AAZStrType, ".output_blob_uri")
properties.set_prop("parameters", AAZListType, ".parameters")
properties.set_prop("protectedParameters",
AAZListType, ".protected_parameters")
properties.set_prop("runAsPassword", AAZStrType, ".run_as_password", typ_kwargs={
"flags": {"secret": True}})
properties.set_prop("runAsUser", AAZStrType, ".run_as_user")
properties.set_prop("source", AAZObjectType)
properties.set_prop("timeoutInSeconds",
AAZIntType, ".timeout_in_seconds")
parameters = _builder.get(".properties.parameters")
if parameters is not None:
_UpdateHelper._build_schema_run_command_input_parameter_update(
parameters.set_elements(AAZObjectType, "."))
protected_parameters = _builder.get(
".properties.protectedParameters")
if protected_parameters is not None:
_UpdateHelper._build_schema_run_command_input_parameter_update(
protected_parameters.set_elements(AAZObjectType, "."))
source = _builder.get(".properties.source")
if source is not None:
source.set_prop("commandId", AAZStrType, ".command_id")
source.set_prop("script", AAZStrType, ".script")
source.set_prop("scriptUri", AAZStrType, ".script_uri")
_UpdateHelper._build_schema_run_command_managed_identity_update(source.set_prop(
"scriptUriManagedIdentity", AAZObjectType, ".script_uri_managed_identity"))
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return _instance_value
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
pass
def _update_instance(self, instance):
pass
| 3 | 0 | 23 | 3 | 20 | 0 | 4 | 0 | 1 | 1 | 1 | 0 | 2 | 0 | 2 | 2 | 48 | 8 | 40 | 9 | 37 | 0 | 36 | 9 | 33 | 6 | 1 | 1 | 7 |
11,020 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/run_command/_show.py
|
azext_connectedmachine.aaz.latest.connectedmachine.run_command._show.Show.MachineRunCommandsGet
|
class MachineRunCommandsGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"runCommandName", self.ctx.args.run_command_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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(
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType(
flags={"required": True},
)
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.async_execution = AAZBoolType(
serialized_name="asyncExecution",
)
properties.error_blob_managed_identity = AAZObjectType(
serialized_name="errorBlobManagedIdentity",
)
_ShowHelper._build_schema_run_command_managed_identity_read(
properties.error_blob_managed_identity)
properties.error_blob_uri = AAZStrType(
serialized_name="errorBlobUri",
)
properties.instance_view = AAZObjectType(
serialized_name="instanceView",
flags={"read_only": True},
)
properties.output_blob_managed_identity = AAZObjectType(
serialized_name="outputBlobManagedIdentity",
)
_ShowHelper._build_schema_run_command_managed_identity_read(
properties.output_blob_managed_identity)
properties.output_blob_uri = AAZStrType(
serialized_name="outputBlobUri",
)
properties.parameters = AAZListType()
properties.protected_parameters = AAZListType(
serialized_name="protectedParameters",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.run_as_password = AAZStrType(
serialized_name="runAsPassword",
flags={"secret": True},
)
properties.run_as_user = AAZStrType(
serialized_name="runAsUser",
)
properties.source = AAZObjectType()
properties.timeout_in_seconds = AAZIntType(
serialized_name="timeoutInSeconds",
)
instance_view = cls._schema_on_200.properties.instance_view
instance_view.end_time = AAZStrType(
serialized_name="endTime",
)
instance_view.error = AAZStrType()
instance_view.execution_message = AAZStrType(
serialized_name="executionMessage",
)
instance_view.execution_state = AAZStrType(
serialized_name="executionState",
)
instance_view.exit_code = AAZIntType(
serialized_name="exitCode",
)
instance_view.output = AAZStrType()
instance_view.start_time = AAZStrType(
serialized_name="startTime",
)
instance_view.statuses = AAZListType()
statuses = cls._schema_on_200.properties.instance_view.statuses
statuses.Element = AAZObjectType()
_element = cls._schema_on_200.properties.instance_view.statuses.Element
_element.code = AAZStrType()
_element.display_status = AAZStrType(
serialized_name="displayStatus",
)
_element.level = AAZStrType()
_element.message = AAZStrType()
_element.time = AAZStrType()
parameters = cls._schema_on_200.properties.parameters
parameters.Element = AAZObjectType()
_ShowHelper._build_schema_run_command_input_parameter_read(
parameters.Element)
protected_parameters = cls._schema_on_200.properties.protected_parameters
protected_parameters.Element = AAZObjectType()
_ShowHelper._build_schema_run_command_input_parameter_read(
protected_parameters.Element)
source = cls._schema_on_200.properties.source
source.command_id = AAZStrType(
serialized_name="commandId",
)
source.script = AAZStrType()
source.script_uri = AAZStrType(
serialized_name="scriptUri",
)
source.script_uri_managed_identity = AAZObjectType(
serialized_name="scriptUriManagedIdentity",
)
_ShowHelper._build_schema_run_command_managed_identity_read(
source.script_uri_managed_identity)
system_data = cls._schema_on_200.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class MachineRunCommandsGet(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
| 17 | 0 | 23 | 1 | 21 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 225 | 23 | 202 | 35 | 185 | 0 | 94 | 28 | 84 | 2 | 1 | 1 | 11 |
11,021 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/run_command/_list.py
|
azext_connectedmachine.aaz.latest.connectedmachine.run_command._list.List.MachineRunCommandsList
|
class MachineRunCommandsList(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"$expand", self.ctx.args.expand,
),
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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.next_link = AAZStrType(
serialized_name="nextLink",
)
_schema_on_200.value = AAZListType()
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.location = AAZStrType(
flags={"required": True},
)
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType(
flags={"client_flatten": True},
)
_element.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_element.tags = AAZDictType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.async_execution = AAZBoolType(
serialized_name="asyncExecution",
)
properties.error_blob_managed_identity = AAZObjectType(
serialized_name="errorBlobManagedIdentity",
)
_ListHelper._build_schema_run_command_managed_identity_read(
properties.error_blob_managed_identity)
properties.error_blob_uri = AAZStrType(
serialized_name="errorBlobUri",
)
properties.instance_view = AAZObjectType(
serialized_name="instanceView",
flags={"read_only": True},
)
properties.output_blob_managed_identity = AAZObjectType(
serialized_name="outputBlobManagedIdentity",
)
_ListHelper._build_schema_run_command_managed_identity_read(
properties.output_blob_managed_identity)
properties.output_blob_uri = AAZStrType(
serialized_name="outputBlobUri",
)
properties.parameters = AAZListType()
properties.protected_parameters = AAZListType(
serialized_name="protectedParameters",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.run_as_password = AAZStrType(
serialized_name="runAsPassword",
flags={"secret": True},
)
properties.run_as_user = AAZStrType(
serialized_name="runAsUser",
)
properties.source = AAZObjectType()
properties.timeout_in_seconds = AAZIntType(
serialized_name="timeoutInSeconds",
)
instance_view = cls._schema_on_200.value.Element.properties.instance_view
instance_view.end_time = AAZStrType(
serialized_name="endTime",
)
instance_view.error = AAZStrType()
instance_view.execution_message = AAZStrType(
serialized_name="executionMessage",
)
instance_view.execution_state = AAZStrType(
serialized_name="executionState",
)
instance_view.exit_code = AAZIntType(
serialized_name="exitCode",
)
instance_view.output = AAZStrType()
instance_view.start_time = AAZStrType(
serialized_name="startTime",
)
instance_view.statuses = AAZListType()
statuses = cls._schema_on_200.value.Element.properties.instance_view.statuses
statuses.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element.properties.instance_view.statuses.Element
_element.code = AAZStrType()
_element.display_status = AAZStrType(
serialized_name="displayStatus",
)
_element.level = AAZStrType()
_element.message = AAZStrType()
_element.time = AAZStrType()
parameters = cls._schema_on_200.value.Element.properties.parameters
parameters.Element = AAZObjectType()
_ListHelper._build_schema_run_command_input_parameter_read(
parameters.Element)
protected_parameters = cls._schema_on_200.value.Element.properties.protected_parameters
protected_parameters.Element = AAZObjectType()
_ListHelper._build_schema_run_command_input_parameter_read(
protected_parameters.Element)
source = cls._schema_on_200.value.Element.properties.source
source.command_id = AAZStrType(
serialized_name="commandId",
)
source.script = AAZStrType()
source.script_uri = AAZStrType(
serialized_name="scriptUri",
)
source.script_uri_managed_identity = AAZObjectType(
serialized_name="scriptUriManagedIdentity",
)
_ListHelper._build_schema_run_command_managed_identity_read(
source.script_uri_managed_identity)
system_data = cls._schema_on_200.value.Element.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200.value.Element.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class MachineRunCommandsList(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
| 17 | 0 | 24 | 2 | 22 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 233 | 25 | 208 | 36 | 191 | 0 | 99 | 29 | 89 | 2 | 1 | 1 | 11 |
11,022 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/run_command/_delete.py
|
azext_connectedmachine.aaz.latest.connectedmachine.run_command._delete.Delete.MachineRunCommandsDelete
|
class MachineRunCommandsDelete(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_201,
self.on_error,
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [204]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_204,
self.on_error,
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200, 201]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}",
**self.url_parameters
)
@property
def method(self):
return "DELETE"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"runCommandName", self.ctx.args.run_command_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
def on_204(self, session):
pass
def on_200_201(self, session):
pass
|
class MachineRunCommandsDelete(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
def on_204(self, session):
pass
def on_200_201(self, session):
pass
| 14 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 1 | 8 | 8 | 88 | 9 | 79 | 20 | 65 | 0 | 28 | 14 | 19 | 4 | 1 | 1 | 11 |
11,023 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/run_command/_create.py
|
azext_connectedmachine.aaz.latest.connectedmachine.run_command._create.Create.MachineRunCommandsCreateOrUpdate
|
class MachineRunCommandsCreateOrUpdate(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_201,
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, 201]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
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(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"runCommandName", self.ctx.args.run_command_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={
"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={
"flags": {"required": True}})
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
_builder.set_prop("tags", AAZDictType, ".tags")
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop(
"asyncExecution", AAZBoolType, ".async_execution")
_CreateHelper._build_schema_run_command_managed_identity_create(properties.set_prop(
"errorBlobManagedIdentity", AAZObjectType, ".error_blob_managed_identity"))
properties.set_prop(
"errorBlobUri", AAZStrType, ".error_blob_uri")
_CreateHelper._build_schema_run_command_managed_identity_create(properties.set_prop(
"outputBlobManagedIdentity", AAZObjectType, ".output_blob_managed_identity"))
properties.set_prop(
"outputBlobUri", AAZStrType, ".output_blob_uri")
properties.set_prop("parameters", AAZListType, ".parameters")
properties.set_prop("protectedParameters",
AAZListType, ".protected_parameters")
properties.set_prop("runAsPassword", AAZStrType, ".run_as_password", typ_kwargs={
"flags": {"secret": True}})
properties.set_prop("runAsUser", AAZStrType, ".run_as_user")
properties.set_prop("source", AAZObjectType)
properties.set_prop("timeoutInSeconds",
AAZIntType, ".timeout_in_seconds")
parameters = _builder.get(".properties.parameters")
if parameters is not None:
_CreateHelper._build_schema_run_command_input_parameter_create(
parameters.set_elements(AAZObjectType, "."))
protected_parameters = _builder.get(
".properties.protectedParameters")
if protected_parameters is not None:
_CreateHelper._build_schema_run_command_input_parameter_create(
protected_parameters.set_elements(AAZObjectType, "."))
source = _builder.get(".properties.source")
if source is not None:
source.set_prop("commandId", AAZStrType, ".command_id")
source.set_prop("script", AAZStrType, ".script")
source.set_prop("scriptUri", AAZStrType, ".script_uri")
_CreateHelper._build_schema_run_command_managed_identity_create(source.set_prop(
"scriptUriManagedIdentity", AAZObjectType, ".script_uri_managed_identity"))
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return self.serialize_content(_content_value)
def on_200_201(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200_201
)
_schema_on_200_201 = None
@classmethod
def _build_schema_on_200_201(cls):
if cls._schema_on_200_201 is not None:
return cls._schema_on_200_201
cls._schema_on_200_201 = AAZObjectType()
_schema_on_200_201 = cls._schema_on_200_201
_schema_on_200_201.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.location = AAZStrType(
flags={"required": True},
)
_schema_on_200_201.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200_201.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200_201.tags = AAZDictType()
_schema_on_200_201.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200_201.properties
properties.async_execution = AAZBoolType(
serialized_name="asyncExecution",
)
properties.error_blob_managed_identity = AAZObjectType(
serialized_name="errorBlobManagedIdentity",
)
_CreateHelper._build_schema_run_command_managed_identity_read(
properties.error_blob_managed_identity)
properties.error_blob_uri = AAZStrType(
serialized_name="errorBlobUri",
)
properties.instance_view = AAZObjectType(
serialized_name="instanceView",
flags={"read_only": True},
)
properties.output_blob_managed_identity = AAZObjectType(
serialized_name="outputBlobManagedIdentity",
)
_CreateHelper._build_schema_run_command_managed_identity_read(
properties.output_blob_managed_identity)
properties.output_blob_uri = AAZStrType(
serialized_name="outputBlobUri",
)
properties.parameters = AAZListType()
properties.protected_parameters = AAZListType(
serialized_name="protectedParameters",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.run_as_password = AAZStrType(
serialized_name="runAsPassword",
flags={"secret": True},
)
properties.run_as_user = AAZStrType(
serialized_name="runAsUser",
)
properties.source = AAZObjectType()
properties.timeout_in_seconds = AAZIntType(
serialized_name="timeoutInSeconds",
)
instance_view = cls._schema_on_200_201.properties.instance_view
instance_view.end_time = AAZStrType(
serialized_name="endTime",
)
instance_view.error = AAZStrType()
instance_view.execution_message = AAZStrType(
serialized_name="executionMessage",
)
instance_view.execution_state = AAZStrType(
serialized_name="executionState",
)
instance_view.exit_code = AAZIntType(
serialized_name="exitCode",
)
instance_view.output = AAZStrType()
instance_view.start_time = AAZStrType(
serialized_name="startTime",
)
instance_view.statuses = AAZListType()
statuses = cls._schema_on_200_201.properties.instance_view.statuses
statuses.Element = AAZObjectType()
_element = cls._schema_on_200_201.properties.instance_view.statuses.Element
_element.code = AAZStrType()
_element.display_status = AAZStrType(
serialized_name="displayStatus",
)
_element.level = AAZStrType()
_element.message = AAZStrType()
_element.time = AAZStrType()
parameters = cls._schema_on_200_201.properties.parameters
parameters.Element = AAZObjectType()
_CreateHelper._build_schema_run_command_input_parameter_read(
parameters.Element)
protected_parameters = cls._schema_on_200_201.properties.protected_parameters
protected_parameters.Element = AAZObjectType()
_CreateHelper._build_schema_run_command_input_parameter_read(
protected_parameters.Element)
source = cls._schema_on_200_201.properties.source
source.command_id = AAZStrType(
serialized_name="commandId",
)
source.script = AAZStrType()
source.script_uri = AAZStrType(
serialized_name="scriptUri",
)
source.script_uri_managed_identity = AAZObjectType(
serialized_name="scriptUriManagedIdentity",
)
_CreateHelper._build_schema_run_command_managed_identity_read(
source.script_uri_managed_identity)
system_data = cls._schema_on_200_201.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200_201.tags
tags.Element = AAZStrType()
return cls._schema_on_200_201
|
class MachineRunCommandsCreateOrUpdate(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
@property
def content(self):
pass
def on_200_201(self, session):
pass
@classmethod
def _build_schema_on_200_201(cls):
pass
| 19 | 0 | 27 | 2 | 25 | 0 | 2 | 0 | 1 | 1 | 1 | 0 | 9 | 1 | 10 | 10 | 290 | 30 | 260 | 44 | 241 | 0 | 130 | 35 | 119 | 6 | 1 | 1 | 18 |
11,024 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/network_security_perimeter_configuration/_show.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_link_scope.network_security_perimeter_configuration._show.Show.NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScope
|
class NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScope(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"perimeterName", self.ctx.args.perimeter_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"scopeName", self.ctx.args.scope_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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(
flags={"read_only": True},
)
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.network_security_perimeter = AAZObjectType(
serialized_name="networkSecurityPerimeter",
)
properties.profile = AAZObjectType()
properties.provisioning_issues = AAZListType(
serialized_name="provisioningIssues",
flags={"read_only": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.resource_association = AAZObjectType(
serialized_name="resourceAssociation",
)
network_security_perimeter = cls._schema_on_200.properties.network_security_perimeter
network_security_perimeter.id = AAZStrType(
flags={"read_only": True},
)
network_security_perimeter.location = AAZStrType(
flags={"read_only": True},
)
network_security_perimeter.perimeter_guid = AAZStrType(
serialized_name="perimeterGuid",
flags={"read_only": True},
)
profile = cls._schema_on_200.properties.profile
profile.access_rules = AAZListType(
serialized_name="accessRules",
flags={"read_only": True},
)
profile.access_rules_version = AAZIntType(
serialized_name="accessRulesVersion",
flags={"read_only": True},
)
profile.diagnostic_settings_version = AAZIntType(
serialized_name="diagnosticSettingsVersion",
flags={"read_only": True},
)
profile.enabled_log_categories = AAZListType(
serialized_name="enabledLogCategories",
flags={"read_only": True},
)
profile.name = AAZStrType(
flags={"read_only": True},
)
access_rules = cls._schema_on_200.properties.profile.access_rules
access_rules.Element = AAZObjectType()
_ShowHelper._build_schema_access_rule_read(access_rules.Element)
enabled_log_categories = cls._schema_on_200.properties.profile.enabled_log_categories
enabled_log_categories.Element = AAZStrType()
provisioning_issues = cls._schema_on_200.properties.provisioning_issues
provisioning_issues.Element = AAZObjectType()
_element = cls._schema_on_200.properties.provisioning_issues.Element
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType(
flags={"client_flatten": True, "read_only": True},
)
properties = cls._schema_on_200.properties.provisioning_issues.Element.properties
properties.description = AAZStrType(
flags={"read_only": True},
)
properties.issue_type = AAZStrType(
serialized_name="issueType",
flags={"read_only": True},
)
properties.severity = AAZStrType(
flags={"read_only": True},
)
properties.suggested_access_rules = AAZListType(
serialized_name="suggestedAccessRules",
flags={"read_only": True},
)
properties.suggested_resource_ids = AAZListType(
serialized_name="suggestedResourceIds",
flags={"read_only": True},
)
suggested_access_rules = cls._schema_on_200.properties.provisioning_issues.Element.properties.suggested_access_rules
suggested_access_rules.Element = AAZObjectType()
_ShowHelper._build_schema_access_rule_read(
suggested_access_rules.Element)
suggested_resource_ids = cls._schema_on_200.properties.provisioning_issues.Element.properties.suggested_resource_ids
suggested_resource_ids.Element = AAZStrType()
resource_association = cls._schema_on_200.properties.resource_association
resource_association.access_mode = AAZStrType(
serialized_name="accessMode",
flags={"read_only": True},
)
resource_association.name = AAZStrType(
flags={"read_only": True},
)
return cls._schema_on_200
|
class NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScope(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
| 17 | 0 | 20 | 2 | 19 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 203 | 25 | 178 | 36 | 161 | 0 | 77 | 29 | 67 | 2 | 1 | 1 | 11 |
11,025 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/network_security_perimeter_configuration/_reconcile.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_link_scope.network_security_perimeter_configuration._reconcile.Reconcile.NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope
|
class NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope(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(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}/reconcile",
**self.url_parameters
)
@property
def method(self):
return "POST"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"perimeterName", self.ctx.args.perimeter_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"scopeName", self.ctx.args.scope_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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.location = AAZStrType()
return cls._schema_on_200
|
class NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope(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
| 17 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 1 | 9 | 9 | 104 | 14 | 90 | 27 | 73 | 0 | 36 | 19 | 26 | 3 | 1 | 1 | 12 |
11,026 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/network_security_perimeter_configuration/_list.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_link_scope.network_security_perimeter_configuration._list.List.NetworkSecurityPerimeterConfigurationsListByPrivateLinkScope
|
class NetworkSecurityPerimeterConfigurationsListByPrivateLinkScope(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"scopeName", self.ctx.args.scope_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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.next_link = AAZStrType(
serialized_name="nextLink",
flags={"read_only": True},
)
_schema_on_200.value = AAZListType(
flags={"read_only": True},
)
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType(
flags={"client_flatten": True},
)
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.network_security_perimeter = AAZObjectType(
serialized_name="networkSecurityPerimeter",
)
properties.profile = AAZObjectType()
properties.provisioning_issues = AAZListType(
serialized_name="provisioningIssues",
flags={"read_only": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.resource_association = AAZObjectType(
serialized_name="resourceAssociation",
)
network_security_perimeter = cls._schema_on_200.value.Element.properties.network_security_perimeter
network_security_perimeter.id = AAZStrType(
flags={"read_only": True},
)
network_security_perimeter.location = AAZStrType(
flags={"read_only": True},
)
network_security_perimeter.perimeter_guid = AAZStrType(
serialized_name="perimeterGuid",
flags={"read_only": True},
)
profile = cls._schema_on_200.value.Element.properties.profile
profile.access_rules = AAZListType(
serialized_name="accessRules",
flags={"read_only": True},
)
profile.access_rules_version = AAZIntType(
serialized_name="accessRulesVersion",
flags={"read_only": True},
)
profile.diagnostic_settings_version = AAZIntType(
serialized_name="diagnosticSettingsVersion",
flags={"read_only": True},
)
profile.enabled_log_categories = AAZListType(
serialized_name="enabledLogCategories",
flags={"read_only": True},
)
profile.name = AAZStrType(
flags={"read_only": True},
)
access_rules = cls._schema_on_200.value.Element.properties.profile.access_rules
access_rules.Element = AAZObjectType()
_ListHelper._build_schema_access_rule_read(access_rules.Element)
enabled_log_categories = cls._schema_on_200.value.Element.properties.profile.enabled_log_categories
enabled_log_categories.Element = AAZStrType()
provisioning_issues = cls._schema_on_200.value.Element.properties.provisioning_issues
provisioning_issues.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element.properties.provisioning_issues.Element
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType(
flags={"client_flatten": True, "read_only": True},
)
properties = cls._schema_on_200.value.Element.properties.provisioning_issues.Element.properties
properties.description = AAZStrType(
flags={"read_only": True},
)
properties.issue_type = AAZStrType(
serialized_name="issueType",
flags={"read_only": True},
)
properties.severity = AAZStrType(
flags={"read_only": True},
)
properties.suggested_access_rules = AAZListType(
serialized_name="suggestedAccessRules",
flags={"read_only": True},
)
properties.suggested_resource_ids = AAZListType(
serialized_name="suggestedResourceIds",
flags={"read_only": True},
)
suggested_access_rules = cls._schema_on_200.value.Element.properties.provisioning_issues.Element.properties.suggested_access_rules
suggested_access_rules.Element = AAZObjectType()
_ListHelper._build_schema_access_rule_read(
suggested_access_rules.Element)
suggested_resource_ids = cls._schema_on_200.value.Element.properties.provisioning_issues.Element.properties.suggested_resource_ids
suggested_resource_ids.Element = AAZStrType()
resource_association = cls._schema_on_200.value.Element.properties.resource_association
resource_association.access_mode = AAZStrType(
serialized_name="accessMode",
flags={"read_only": True},
)
resource_association.name = AAZStrType(
flags={"read_only": True},
)
return cls._schema_on_200
|
class NetworkSecurityPerimeterConfigurationsListByPrivateLinkScope(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
| 17 | 0 | 21 | 2 | 19 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 211 | 27 | 184 | 37 | 167 | 0 | 82 | 30 | 72 | 2 | 1 | 1 | 11 |
11,027 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.LinkedServiceReference
|
class LinkedServiceReference(_serialization.Model):
"""Linked service reference type.
All required parameters must be populated in order to send to server.
:ivar type: Linked service reference type. Required. "LinkedServiceReference"
:vartype type: str or ~azure.mgmt.datafactory.models.Type
:ivar reference_name: Reference LinkedService name. Required.
:vartype reference_name: str
:ivar parameters: Arguments for LinkedService.
:vartype parameters: dict[str, JSON]
"""
_validation = {
"type": {"required": True},
"reference_name": {"required": True},
}
_attribute_map = {
"type": {"key": "type", "type": "str"},
"reference_name": {"key": "referenceName", "type": "str"},
"parameters": {"key": "parameters", "type": "{object}"},
}
def __init__(
self,
*,
type: Union[str, "_models.Type"],
reference_name: str,
parameters: Optional[Dict[str, JSON]] = None,
**kwargs: Any
) -> None:
"""
:keyword type: Linked service reference type. Required. "LinkedServiceReference"
:paramtype type: str or ~azure.mgmt.datafactory.models.Type
:keyword reference_name: Reference LinkedService name. Required.
:paramtype reference_name: str
:keyword parameters: Arguments for LinkedService.
:paramtype parameters: dict[str, JSON]
"""
super().__init__(**kwargs)
self.type = type
self.reference_name = reference_name
self.parameters = parameters
|
class LinkedServiceReference(_serialization.Model):
'''Linked service reference type.
All required parameters must be populated in order to send to server.
:ivar type: Linked service reference type. Required. "LinkedServiceReference"
:vartype type: str or ~azure.mgmt.datafactory.models.Type
:ivar reference_name: Reference LinkedService name. Required.
:vartype reference_name: str
:ivar parameters: Arguments for LinkedService.
:vartype parameters: dict[str, JSON]
'''
def __init__(
self,
*,
type: Union[str, "_models.Type"],
reference_name: str,
parameters: Optional[Dict[str, JSON]] = None,
**kwargs: Any
) -> None:
'''
:keyword type: Linked service reference type. Required. "LinkedServiceReference"
:paramtype type: str or ~azure.mgmt.datafactory.models.Type
:keyword reference_name: Reference LinkedService name. Required.
:paramtype reference_name: str
:keyword parameters: Arguments for LinkedService.
:paramtype parameters: dict[str, JSON]
'''
pass
| 2 | 2 | 20 | 0 | 12 | 8 | 1 | 0.77 | 1 | 3 | 0 | 0 | 1 | 3 | 1 | 16 | 44 | 5 | 22 | 14 | 13 | 17 | 8 | 7 | 6 | 1 | 2 | 0 | 1 |
11,028 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_wait.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_link_scope._wait.Wait.PrivateLinkScopesGet
|
class PrivateLinkScopesGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"scopeName", self.ctx.args.scope_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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(
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType(
flags={"required": True},
)
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType()
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.private_endpoint_connections = AAZListType(
serialized_name="privateEndpointConnections",
flags={"read_only": True},
)
properties.private_link_scope_id = AAZStrType(
serialized_name="privateLinkScopeId",
flags={"read_only": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.public_network_access = AAZStrType(
serialized_name="publicNetworkAccess",
)
private_endpoint_connections = cls._schema_on_200.properties.private_endpoint_connections
private_endpoint_connections.Element = AAZObjectType()
_element = cls._schema_on_200.properties.private_endpoint_connections.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties.private_endpoint_connections.Element.properties
properties.group_ids = AAZListType(
serialized_name="groupIds",
flags={"read_only": True},
)
properties.private_endpoint = AAZObjectType(
serialized_name="privateEndpoint",
)
properties.private_link_service_connection_state = AAZObjectType(
serialized_name="privateLinkServiceConnectionState",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
group_ids = cls._schema_on_200.properties.private_endpoint_connections.Element.properties.group_ids
group_ids.Element = AAZStrType()
private_endpoint = cls._schema_on_200.properties.private_endpoint_connections.Element.properties.private_endpoint
private_endpoint.id = AAZStrType()
private_link_service_connection_state = cls._schema_on_200.properties.private_endpoint_connections.Element.properties.private_link_service_connection_state
private_link_service_connection_state.actions_required = AAZStrType(
serialized_name="actionsRequired",
flags={"read_only": True},
)
private_link_service_connection_state.description = AAZStrType(
flags={"required": True},
)
private_link_service_connection_state.status = AAZStrType(
flags={"required": True},
)
system_data = cls._schema_on_200.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class PrivateLinkScopesGet(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
| 17 | 0 | 19 | 1 | 17 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 190 | 23 | 167 | 34 | 150 | 0 | 74 | 27 | 64 | 2 | 1 | 1 | 11 |
11,029 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.LinkedServiceListResponse
|
class LinkedServiceListResponse(_serialization.Model):
"""A list of linked service resources.
All required parameters must be populated in order to send to server.
:ivar value: List of linked services. Required.
:vartype value: list[~azure.mgmt.datafactory.models.LinkedServiceResource]
:ivar next_link: The link to the next page of results, if any remaining results exist.
:vartype next_link: str
"""
_validation = {
"value": {"required": True},
}
_attribute_map = {
"value": {"key": "value", "type": "[LinkedServiceResource]"},
"next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
self, *, value: List["_models.LinkedServiceResource"], next_link: Optional[str] = None, **kwargs: Any
) -> None:
"""
:keyword value: List of linked services. Required.
:paramtype value: list[~azure.mgmt.datafactory.models.LinkedServiceResource]
:keyword next_link: The link to the next page of results, if any remaining results exist.
:paramtype next_link: str
"""
super().__init__(**kwargs)
self.value = value
self.next_link = next_link
|
class LinkedServiceListResponse(_serialization.Model):
'''A list of linked service resources.
All required parameters must be populated in order to send to server.
:ivar value: List of linked services. Required.
:vartype value: list[~azure.mgmt.datafactory.models.LinkedServiceResource]
:ivar next_link: The link to the next page of results, if any remaining results exist.
:vartype next_link: str
'''
def __init__(
self, *, value: List["_models.LinkedServiceResource"], next_link: Optional[str] = None, **kwargs: Any
) -> None:
'''
:keyword value: List of linked services. Required.
:paramtype value: list[~azure.mgmt.datafactory.models.LinkedServiceResource]
:keyword next_link: The link to the next page of results, if any remaining results exist.
:paramtype next_link: str
'''
pass
| 2 | 2 | 12 | 0 | 6 | 6 | 1 | 0.93 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 16 | 32 | 5 | 14 | 8 | 10 | 13 | 7 | 6 | 5 | 1 | 2 | 0 | 1 |
11,030 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.LinkedService
|
class LinkedService(_serialization.Model):
"""The nested object which contains the information and credential which can be used to connect
with related store or compute resource.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
AmazonMWSLinkedService, AmazonRdsForOracleLinkedService, AmazonRdsForSqlServerLinkedService,
AmazonRedshiftLinkedService, AmazonS3LinkedService, AmazonS3CompatibleLinkedService,
AppFiguresLinkedService, AsanaLinkedService, AzureBatchLinkedService, AzureBlobFSLinkedService,
AzureBlobStorageLinkedService, AzureDataExplorerLinkedService,
AzureDataLakeAnalyticsLinkedService, AzureDataLakeStoreLinkedService,
AzureDatabricksLinkedService, AzureDatabricksDeltaLakeLinkedService,
AzureFileStorageLinkedService, AzureFunctionLinkedService, AzureKeyVaultLinkedService,
AzureMLLinkedService, AzureMLServiceLinkedService, AzureMariaDBLinkedService,
AzureMySqlLinkedService, AzurePostgreSqlLinkedService, AzureSearchLinkedService,
AzureSqlDWLinkedService, AzureSqlDatabaseLinkedService, AzureSqlMILinkedService,
AzureStorageLinkedService, AzureSynapseArtifactsLinkedService, AzureTableStorageLinkedService,
CassandraLinkedService, CommonDataServiceForAppsLinkedService, ConcurLinkedService,
CosmosDbLinkedService, CosmosDbMongoDbApiLinkedService, CouchbaseLinkedService,
CustomDataSourceLinkedService, DataworldLinkedService, Db2LinkedService, DrillLinkedService,
DynamicsLinkedService, DynamicsAXLinkedService, DynamicsCrmLinkedService, EloquaLinkedService,
FileServerLinkedService, FtpServerLinkedService, GoogleAdWordsLinkedService,
GoogleBigQueryLinkedService, GoogleBigQueryV2LinkedService, GoogleCloudStorageLinkedService,
GoogleSheetsLinkedService, GreenplumLinkedService, HBaseLinkedService, HDInsightLinkedService,
HDInsightOnDemandLinkedService, HdfsLinkedService, HiveLinkedService, HttpLinkedService,
HubspotLinkedService, ImpalaLinkedService, InformixLinkedService, JiraLinkedService,
LakeHouseLinkedService, MagentoLinkedService, MariaDBLinkedService, MarketoLinkedService,
MicrosoftAccessLinkedService, MongoDbLinkedService, MongoDbAtlasLinkedService,
MongoDbV2LinkedService, MySqlLinkedService, NetezzaLinkedService, ODataLinkedService,
OdbcLinkedService, Office365LinkedService, OracleLinkedService,
OracleCloudStorageLinkedService, OracleServiceCloudLinkedService, PaypalLinkedService,
PhoenixLinkedService, PostgreSqlLinkedService, PostgreSqlV2LinkedService, PrestoLinkedService,
QuickBooksLinkedService, QuickbaseLinkedService, ResponsysLinkedService,
RestServiceLinkedService, SalesforceLinkedService, SalesforceMarketingCloudLinkedService,
SalesforceServiceCloudLinkedService, SalesforceServiceCloudV2LinkedService,
SalesforceV2LinkedService, SapBWLinkedService, SapCloudForCustomerLinkedService,
SapEccLinkedService, SapHanaLinkedService, SapOdpLinkedService, SapOpenHubLinkedService,
SapTableLinkedService, ServiceNowLinkedService, ServiceNowV2LinkedService,
SftpServerLinkedService, SharePointOnlineListLinkedService, ShopifyLinkedService,
SmartsheetLinkedService, SnowflakeLinkedService, SnowflakeV2LinkedService, SparkLinkedService,
SqlServerLinkedService, SquareLinkedService, SybaseLinkedService, TeamDeskLinkedService,
TeradataLinkedService, TwilioLinkedService, VerticaLinkedService, WarehouseLinkedService,
WebLinkedService, XeroLinkedService, ZendeskLinkedService, ZohoLinkedService
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, JSON]
:ivar type: Type of linked service. Required.
:vartype type: str
:ivar version: Version of the linked service.
:vartype version: str
:ivar connect_via: The integration runtime reference.
:vartype connect_via: ~azure.mgmt.datafactory.models.IntegrationRuntimeReference
:ivar description: Linked service description.
:vartype description: str
:ivar parameters: Parameters for linked service.
:vartype parameters: dict[str, ~azure.mgmt.datafactory.models.ParameterSpecification]
:ivar annotations: List of tags that can be used for describing the linked service.
:vartype annotations: list[JSON]
"""
_validation = {
"type": {"required": True},
}
_attribute_map = {
"additional_properties": {"key": "", "type": "{object}"},
"type": {"key": "type", "type": "str"},
"version": {"key": "version", "type": "str"},
"connect_via": {"key": "connectVia", "type": "IntegrationRuntimeReference"},
"description": {"key": "description", "type": "str"},
"parameters": {"key": "parameters", "type": "{ParameterSpecification}"},
"annotations": {"key": "annotations", "type": "[object]"},
}
_subtype_map = {
"type": {
"AmazonMWS": "AmazonMWSLinkedService",
"AmazonRdsForOracle": "AmazonRdsForOracleLinkedService",
"AmazonRdsForSqlServer": "AmazonRdsForSqlServerLinkedService",
"AmazonRedshift": "AmazonRedshiftLinkedService",
"AmazonS3": "AmazonS3LinkedService",
"AmazonS3Compatible": "AmazonS3CompatibleLinkedService",
"AppFigures": "AppFiguresLinkedService",
"Asana": "AsanaLinkedService",
"AzureBatch": "AzureBatchLinkedService",
"AzureBlobFS": "AzureBlobFSLinkedService",
"AzureBlobStorage": "AzureBlobStorageLinkedService",
"AzureDataExplorer": "AzureDataExplorerLinkedService",
"AzureDataLakeAnalytics": "AzureDataLakeAnalyticsLinkedService",
"AzureDataLakeStore": "AzureDataLakeStoreLinkedService",
"AzureDatabricks": "AzureDatabricksLinkedService",
"AzureDatabricksDeltaLake": "AzureDatabricksDeltaLakeLinkedService",
"AzureFileStorage": "AzureFileStorageLinkedService",
"AzureFunction": "AzureFunctionLinkedService",
"AzureKeyVault": "AzureKeyVaultLinkedService",
"AzureML": "AzureMLLinkedService",
"AzureMLService": "AzureMLServiceLinkedService",
"AzureMariaDB": "AzureMariaDBLinkedService",
"AzureMySql": "AzureMySqlLinkedService",
"AzurePostgreSql": "AzurePostgreSqlLinkedService",
"AzureSearch": "AzureSearchLinkedService",
"AzureSqlDW": "AzureSqlDWLinkedService",
"AzureSqlDatabase": "AzureSqlDatabaseLinkedService",
"AzureSqlMI": "AzureSqlMILinkedService",
"AzureStorage": "AzureStorageLinkedService",
"AzureSynapseArtifacts": "AzureSynapseArtifactsLinkedService",
"AzureTableStorage": "AzureTableStorageLinkedService",
"Cassandra": "CassandraLinkedService",
"CommonDataServiceForApps": "CommonDataServiceForAppsLinkedService",
"Concur": "ConcurLinkedService",
"CosmosDb": "CosmosDbLinkedService",
"CosmosDbMongoDbApi": "CosmosDbMongoDbApiLinkedService",
"Couchbase": "CouchbaseLinkedService",
"CustomDataSource": "CustomDataSourceLinkedService",
"Dataworld": "DataworldLinkedService",
"Db2": "Db2LinkedService",
"Drill": "DrillLinkedService",
"Dynamics": "DynamicsLinkedService",
"DynamicsAX": "DynamicsAXLinkedService",
"DynamicsCrm": "DynamicsCrmLinkedService",
"Eloqua": "EloquaLinkedService",
"FileServer": "FileServerLinkedService",
"FtpServer": "FtpServerLinkedService",
"GoogleAdWords": "GoogleAdWordsLinkedService",
"GoogleBigQuery": "GoogleBigQueryLinkedService",
"GoogleBigQueryV2": "GoogleBigQueryV2LinkedService",
"GoogleCloudStorage": "GoogleCloudStorageLinkedService",
"GoogleSheets": "GoogleSheetsLinkedService",
"Greenplum": "GreenplumLinkedService",
"HBase": "HBaseLinkedService",
"HDInsight": "HDInsightLinkedService",
"HDInsightOnDemand": "HDInsightOnDemandLinkedService",
"Hdfs": "HdfsLinkedService",
"Hive": "HiveLinkedService",
"HttpServer": "HttpLinkedService",
"Hubspot": "HubspotLinkedService",
"Impala": "ImpalaLinkedService",
"Informix": "InformixLinkedService",
"Jira": "JiraLinkedService",
"LakeHouse": "LakeHouseLinkedService",
"Magento": "MagentoLinkedService",
"MariaDB": "MariaDBLinkedService",
"Marketo": "MarketoLinkedService",
"MicrosoftAccess": "MicrosoftAccessLinkedService",
"MongoDb": "MongoDbLinkedService",
"MongoDbAtlas": "MongoDbAtlasLinkedService",
"MongoDbV2": "MongoDbV2LinkedService",
"MySql": "MySqlLinkedService",
"Netezza": "NetezzaLinkedService",
"OData": "ODataLinkedService",
"Odbc": "OdbcLinkedService",
"Office365": "Office365LinkedService",
"Oracle": "OracleLinkedService",
"OracleCloudStorage": "OracleCloudStorageLinkedService",
"OracleServiceCloud": "OracleServiceCloudLinkedService",
"Paypal": "PaypalLinkedService",
"Phoenix": "PhoenixLinkedService",
"PostgreSql": "PostgreSqlLinkedService",
"PostgreSqlV2": "PostgreSqlV2LinkedService",
"Presto": "PrestoLinkedService",
"QuickBooks": "QuickBooksLinkedService",
"Quickbase": "QuickbaseLinkedService",
"Responsys": "ResponsysLinkedService",
"RestService": "RestServiceLinkedService",
"Salesforce": "SalesforceLinkedService",
"SalesforceMarketingCloud": "SalesforceMarketingCloudLinkedService",
"SalesforceServiceCloud": "SalesforceServiceCloudLinkedService",
"SalesforceServiceCloudV2": "SalesforceServiceCloudV2LinkedService",
"SalesforceV2": "SalesforceV2LinkedService",
"SapBW": "SapBWLinkedService",
"SapCloudForCustomer": "SapCloudForCustomerLinkedService",
"SapEcc": "SapEccLinkedService",
"SapHana": "SapHanaLinkedService",
"SapOdp": "SapOdpLinkedService",
"SapOpenHub": "SapOpenHubLinkedService",
"SapTable": "SapTableLinkedService",
"ServiceNow": "ServiceNowLinkedService",
"ServiceNowV2": "ServiceNowV2LinkedService",
"Sftp": "SftpServerLinkedService",
"SharePointOnlineList": "SharePointOnlineListLinkedService",
"Shopify": "ShopifyLinkedService",
"Smartsheet": "SmartsheetLinkedService",
"Snowflake": "SnowflakeLinkedService",
"SnowflakeV2": "SnowflakeV2LinkedService",
"Spark": "SparkLinkedService",
"SqlServer": "SqlServerLinkedService",
"Square": "SquareLinkedService",
"Sybase": "SybaseLinkedService",
"TeamDesk": "TeamDeskLinkedService",
"Teradata": "TeradataLinkedService",
"Twilio": "TwilioLinkedService",
"Vertica": "VerticaLinkedService",
"Warehouse": "WarehouseLinkedService",
"Web": "WebLinkedService",
"Xero": "XeroLinkedService",
"Zendesk": "ZendeskLinkedService",
"Zoho": "ZohoLinkedService",
}
}
def __init__(
self,
*,
additional_properties: Optional[Dict[str, JSON]] = None,
version: Optional[str] = None,
connect_via: Optional["_models.IntegrationRuntimeReference"] = None,
description: Optional[str] = None,
parameters: Optional[Dict[str, "_models.ParameterSpecification"]] = None,
annotations: Optional[List[JSON]] = None,
**kwargs: Any
) -> None:
"""
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
:keyword version: Version of the linked service.
:paramtype version: str
:keyword connect_via: The integration runtime reference.
:paramtype connect_via: ~azure.mgmt.datafactory.models.IntegrationRuntimeReference
:keyword description: Linked service description.
:paramtype description: str
:keyword parameters: Parameters for linked service.
:paramtype parameters: dict[str, ~azure.mgmt.datafactory.models.ParameterSpecification]
:keyword annotations: List of tags that can be used for describing the linked service.
:paramtype annotations: list[JSON]
"""
super().__init__(**kwargs)
self.additional_properties = additional_properties
self.type: Optional[str] = None
self.version = version
self.connect_via = connect_via
self.description = description
self.parameters = parameters
self.annotations = annotations
|
class LinkedService(_serialization.Model):
'''The nested object which contains the information and credential which can be used to connect
with related store or compute resource.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
AmazonMWSLinkedService, AmazonRdsForOracleLinkedService, AmazonRdsForSqlServerLinkedService,
AmazonRedshiftLinkedService, AmazonS3LinkedService, AmazonS3CompatibleLinkedService,
AppFiguresLinkedService, AsanaLinkedService, AzureBatchLinkedService, AzureBlobFSLinkedService,
AzureBlobStorageLinkedService, AzureDataExplorerLinkedService,
AzureDataLakeAnalyticsLinkedService, AzureDataLakeStoreLinkedService,
AzureDatabricksLinkedService, AzureDatabricksDeltaLakeLinkedService,
AzureFileStorageLinkedService, AzureFunctionLinkedService, AzureKeyVaultLinkedService,
AzureMLLinkedService, AzureMLServiceLinkedService, AzureMariaDBLinkedService,
AzureMySqlLinkedService, AzurePostgreSqlLinkedService, AzureSearchLinkedService,
AzureSqlDWLinkedService, AzureSqlDatabaseLinkedService, AzureSqlMILinkedService,
AzureStorageLinkedService, AzureSynapseArtifactsLinkedService, AzureTableStorageLinkedService,
CassandraLinkedService, CommonDataServiceForAppsLinkedService, ConcurLinkedService,
CosmosDbLinkedService, CosmosDbMongoDbApiLinkedService, CouchbaseLinkedService,
CustomDataSourceLinkedService, DataworldLinkedService, Db2LinkedService, DrillLinkedService,
DynamicsLinkedService, DynamicsAXLinkedService, DynamicsCrmLinkedService, EloquaLinkedService,
FileServerLinkedService, FtpServerLinkedService, GoogleAdWordsLinkedService,
GoogleBigQueryLinkedService, GoogleBigQueryV2LinkedService, GoogleCloudStorageLinkedService,
GoogleSheetsLinkedService, GreenplumLinkedService, HBaseLinkedService, HDInsightLinkedService,
HDInsightOnDemandLinkedService, HdfsLinkedService, HiveLinkedService, HttpLinkedService,
HubspotLinkedService, ImpalaLinkedService, InformixLinkedService, JiraLinkedService,
LakeHouseLinkedService, MagentoLinkedService, MariaDBLinkedService, MarketoLinkedService,
MicrosoftAccessLinkedService, MongoDbLinkedService, MongoDbAtlasLinkedService,
MongoDbV2LinkedService, MySqlLinkedService, NetezzaLinkedService, ODataLinkedService,
OdbcLinkedService, Office365LinkedService, OracleLinkedService,
OracleCloudStorageLinkedService, OracleServiceCloudLinkedService, PaypalLinkedService,
PhoenixLinkedService, PostgreSqlLinkedService, PostgreSqlV2LinkedService, PrestoLinkedService,
QuickBooksLinkedService, QuickbaseLinkedService, ResponsysLinkedService,
RestServiceLinkedService, SalesforceLinkedService, SalesforceMarketingCloudLinkedService,
SalesforceServiceCloudLinkedService, SalesforceServiceCloudV2LinkedService,
SalesforceV2LinkedService, SapBWLinkedService, SapCloudForCustomerLinkedService,
SapEccLinkedService, SapHanaLinkedService, SapOdpLinkedService, SapOpenHubLinkedService,
SapTableLinkedService, ServiceNowLinkedService, ServiceNowV2LinkedService,
SftpServerLinkedService, SharePointOnlineListLinkedService, ShopifyLinkedService,
SmartsheetLinkedService, SnowflakeLinkedService, SnowflakeV2LinkedService, SparkLinkedService,
SqlServerLinkedService, SquareLinkedService, SybaseLinkedService, TeamDeskLinkedService,
TeradataLinkedService, TwilioLinkedService, VerticaLinkedService, WarehouseLinkedService,
WebLinkedService, XeroLinkedService, ZendeskLinkedService, ZohoLinkedService
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, JSON]
:ivar type: Type of linked service. Required.
:vartype type: str
:ivar version: Version of the linked service.
:vartype version: str
:ivar connect_via: The integration runtime reference.
:vartype connect_via: ~azure.mgmt.datafactory.models.IntegrationRuntimeReference
:ivar description: Linked service description.
:vartype description: str
:ivar parameters: Parameters for linked service.
:vartype parameters: dict[str, ~azure.mgmt.datafactory.models.ParameterSpecification]
:ivar annotations: List of tags that can be used for describing the linked service.
:vartype annotations: list[JSON]
'''
def __init__(
self,
*,
additional_properties: Optional[Dict[str, JSON]] = None,
version: Optional[str] = None,
connect_via: Optional["_models.IntegrationRuntimeReference"] = None,
description: Optional[str] = None,
parameters: Optional[Dict[str, "_models.ParameterSpecification"]] = None,
annotations: Optional[List[JSON]] = None,
**kwargs: Any
) -> None:
'''
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
:keyword version: Version of the linked service.
:paramtype version: str
:keyword connect_via: The integration runtime reference.
:paramtype connect_via: ~azure.mgmt.datafactory.models.IntegrationRuntimeReference
:keyword description: Linked service description.
:paramtype description: str
:keyword parameters: Parameters for linked service.
:paramtype parameters: dict[str, ~azure.mgmt.datafactory.models.ParameterSpecification]
:keyword annotations: List of tags that can be used for describing the linked service.
:paramtype annotations: list[JSON]
'''
pass
| 2 | 2 | 34 | 0 | 19 | 15 | 1 | 0.46 | 1 | 3 | 0 | 121 | 1 | 7 | 1 | 16 | 236 | 7 | 157 | 22 | 145 | 72 | 13 | 12 | 11 | 1 | 2 | 0 | 1 |
11,031 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py
|
azext_containerapp.tests.latest.test_containerapp_commands.ContainerappRegistryIdentityTests
|
class ContainerappRegistryIdentityTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
super().__init__(*arg, random_config_dir=True, **kwargs)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_registry_identity_user(self, resource_group):
# MSI is not available in North Central US (Stage), if the TEST_LOCATION is "northcentralusstage", use eastus as location
location = TEST_LOCATION
if format_location(location) == format_location(STAGE_LOCATION):
location = "eastus"
self.cmd('configure --defaults location={}'.format(location))
app = self.create_random_name(prefix='aca', length=24)
identity = self.create_random_name(prefix='id', length=24)
acr = self.create_random_name(prefix='acr', length=24)
image_source = "mcr.microsoft.com/k8se/quickstart:latest"
image_name = f"{acr}.azurecr.io/k8se/quickstart:latest"
env = prepare_containerapp_env_for_app_e2e_tests(
self, location=location)
identity_rid = self.cmd(
f'identity create -g {resource_group} -n {identity}').get_output_in_json()["id"]
self.cmd(
f'acr create --sku basic -n {acr} -g {resource_group} --admin-enabled')
self.cmd(f'acr import -n {acr} --source {image_source}')
with mock.patch('azure.cli.command_modules.role.custom._gen_guid', side_effect=self.create_guid):
self.cmd(
f'containerapp create -g {resource_group} -n {app} --registry-identity {identity_rid} --image {image_name} --ingress external --target-port 80 --environment {env} --registry-server {acr}.azurecr.io')
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck(
"properties.configuration.registries[0].identity", identity_rid),
JMESPathCheck(
"properties.configuration.registries[0].server", f'{acr}.azurecr.io'),
JMESPathCheck(
"properties.configuration.registries[0].username", ""),
JMESPathCheck(
"properties.configuration.registries[0].passwordSecretRef", ""),
JMESPathCheck(
"properties.template.containers[0].image", image_name),
])
app2 = self.create_random_name(prefix='aca', length=24)
with mock.patch('azure.cli.command_modules.role.custom._gen_guid', side_effect=self.create_guid):
self.cmd(
f'containerapp create -g {resource_group} -n {app2} --registry-identity {identity_rid} --image {image_name} --ingress external --target-port 80 --environment {env} --registry-server {acr}.azurecr.io --revision-suffix test1')
self.cmd(f'containerapp show -g {resource_group} -n {app2}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("properties.template.revisionSuffix", "test1"),
JMESPathCheck(
"properties.configuration.registries[0].identity", identity_rid),
JMESPathCheck(
"properties.template.containers[0].image", image_name),
])
@live_only() # Pass lively, But failed in playback mode when execute queue_acr_build
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_create_source_registry_identity_user(self, resource_group):
# MSI is not available in North Central US (Stage), if the TEST_LOCATION is "northcentralusstage", use eastus as location
location = TEST_LOCATION
if format_location(location) == format_location(STAGE_LOCATION):
location = "eastus"
self.cmd('configure --defaults location={}'.format(location))
source_path = os.path.join(TEST_DIR, os.path.join(
"data", "source_built_using_dockerfile"))
app = self.create_random_name(prefix='aca', length=24)
identity = self.create_random_name(prefix='id', length=24)
acr = self.create_random_name(prefix='acr', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(
self, location=location)
identity_rid = self.cmd(
f'identity create -g {resource_group} -n {identity}').get_output_in_json()["id"]
self.cmd(
f'acr create --sku basic -n {acr} -g {resource_group} --admin-enabled')
with mock.patch('azure.cli.command_modules.role.custom._gen_guid', side_effect=self.create_guid):
self.cmd(
f'containerapp create -g {resource_group} -n {app} --registry-identity {identity_rid} --source "{source_path}" --ingress external --target-port 80 --environment {env} --registry-server {acr}.azurecr.io')
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck(
"properties.configuration.registries[0].identity", identity_rid),
JMESPathCheck(
"properties.configuration.registries[0].server", f'{acr}.azurecr.io'),
JMESPathCheck(
"properties.configuration.registries[0].username", ""),
JMESPathCheck(
"properties.configuration.registries[0].passwordSecretRef", ""),
])
app2 = self.create_random_name(prefix='aca', length=24)
with mock.patch('azure.cli.command_modules.role.custom._gen_guid', side_effect=self.create_guid):
self.cmd(
f'containerapp create -g {resource_group} -n {app2} --registry-identity {identity_rid} --source "{source_path}" --ingress external --target-port 80 --environment {env} --registry-server {acr}.azurecr.io --revision-suffix test1')
app_json = self.cmd(f'containerapp show -g {resource_group} -n {app2}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("properties.template.revisionSuffix", "test1"),
JMESPathCheck(
"properties.configuration.registries[0].identity", identity_rid),
JMESPathCheck(
"properties.configuration.registries[0].server", f'{acr}.azurecr.io'),
JMESPathCheck(
"properties.configuration.registries[0].username", ""),
JMESPathCheck(
"properties.configuration.registries[0].passwordSecretRef", ""),
]).get_output_in_json()
image_name1 = app_json["properties"]["template"]["containers"][0]["image"]
self.assertTrue(image_name1.startswith(f'{acr}.azurecr.io'))
with mock.patch('azure.cli.command_modules.role.custom._gen_guid', side_effect=self.create_guid):
self.cmd(
f'containerapp update -g {resource_group} -n {app2} --source "{source_path}"')
app_json = self.cmd(f'containerapp show -g {resource_group} -n {app2}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck(
"properties.configuration.registries[0].identity", identity_rid),
JMESPathCheck(
"properties.configuration.registries[0].server", f'{acr}.azurecr.io'),
JMESPathCheck(
"properties.configuration.registries[0].username", ""),
JMESPathCheck(
"properties.configuration.registries[0].passwordSecretRef", ""),
]).get_output_in_json()
image_name2 = app_json["properties"]["template"]["containers"][0]["image"]
self.assertTrue(image_name2.startswith(f'{acr}.azurecr.io'))
self.assertNotEqual(image_name1, image_name2)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_registry_identity_system(self, resource_group):
# MSI is not available in North Central US (Stage), if the TEST_LOCATION is "northcentralusstage", use eastus as location
location = TEST_LOCATION
if format_location(location) == format_location(STAGE_LOCATION):
location = "eastus"
self.cmd('configure --defaults location={}'.format(location))
app = self.create_random_name(prefix='aca', length=24)
acr = self.create_random_name(prefix='acr', length=24)
image_source = "mcr.microsoft.com/k8se/quickstart:latest"
image_name = f"{acr}.azurecr.io/k8se/quickstart:latest"
env = prepare_containerapp_env_for_app_e2e_tests(
self, location=location)
self.cmd(
f'acr create --sku basic -n {acr} -g {resource_group} --admin-enabled')
self.cmd(f'acr import -n {acr} --source {image_source}')
with mock.patch('azure.cli.command_modules.role.custom._gen_guid', side_effect=self.create_guid):
self.cmd(
f'containerapp create -g {resource_group} -n {app} --registry-identity "system" --image {image_name} --ingress external --target-port 80 --environment {env} --registry-server {acr}.azurecr.io')
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck(
"properties.template.containers[0].image", image_name),
JMESPathCheck(
"properties.configuration.registries[0].identity", 'system'),
JMESPathCheck(
"properties.configuration.registries[0].server", f'{acr}.azurecr.io'),
JMESPathCheck(
"properties.configuration.registries[0].username", ""),
JMESPathCheck(
"properties.configuration.registries[0].passwordSecretRef", ""),
])
# Default use system-assign registry identity
app2 = self.create_random_name(prefix='aca', length=24)
with mock.patch('azure.cli.command_modules.role.custom._gen_guid', side_effect=self.create_guid):
self.cmd(
f'containerapp create -g {resource_group} -n {app2} --image {image_name} --ingress external --target-port 80 --environment {env} --registry-server {acr}.azurecr.io --revision-suffix test1 --no-wait')
self.cmd(f'containerapp show -g {resource_group} -n {app2}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("properties.template.revisionSuffix", "test1"),
JMESPathCheck(
"properties.template.containers[0].image", image_name),
JMESPathCheck(
"properties.configuration.registries[0].identity", 'system'),
JMESPathCheck(
"properties.configuration.registries[0].server", f'{acr}.azurecr.io'),
JMESPathCheck(
"properties.configuration.registries[0].username", ""),
JMESPathCheck(
"properties.configuration.registries[0].passwordSecretRef", ""),
])
@live_only() # Pass lively, But failed in playback mode when execute queue_acr_build
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_create_source_registry_identity_system(self, resource_group):
# MSI is not available in North Central US (Stage), if the TEST_LOCATION is "northcentralusstage", use eastus as location
location = TEST_LOCATION
if format_location(location) == format_location(STAGE_LOCATION):
location = "eastus"
self.cmd('configure --defaults location={}'.format(location))
source_path = os.path.join(TEST_DIR, os.path.join(
"data", "source_built_using_dockerfile"))
app = self.create_random_name(prefix='aca', length=24)
acr = self.create_random_name(prefix='acr', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(
self, location=location)
self.cmd(
f'acr create --sku basic -n {acr} -g {resource_group} --admin-enabled')
with mock.patch('azure.cli.command_modules.role.custom._gen_guid', side_effect=self.create_guid):
self.cmd(
f'containerapp create -g {resource_group} -n {app} --registry-identity "system" --source "{source_path}" --ingress external --target-port 80 --environment {env} --registry-server {acr}.azurecr.io')
app_json = self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck(
"properties.configuration.registries[0].identity", 'system'),
JMESPathCheck(
"properties.configuration.registries[0].server", f'{acr}.azurecr.io'),
JMESPathCheck(
"properties.configuration.registries[0].username", ""),
JMESPathCheck(
"properties.configuration.registries[0].passwordSecretRef", ""),
]).get_output_in_json()
image_name1 = app_json["properties"]["template"]["containers"][0]["image"]
self.assertTrue(image_name1.startswith(f'{acr}.azurecr.io'))
# Default use system-assign registry identity
app2 = self.create_random_name(prefix='aca', length=24)
with mock.patch('azure.cli.command_modules.role.custom._gen_guid', side_effect=self.create_guid):
self.cmd(
f'containerapp create -g {resource_group} -n {app2} --source "{source_path}" --ingress external --target-port 80 --environment {env} --registry-server {acr}.azurecr.io --revision-suffix test1 --no-wait')
app_json = self.cmd(f'containerapp show -g {resource_group} -n {app2}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("properties.template.revisionSuffix", "test1"),
JMESPathCheck(
"properties.configuration.registries[0].identity", 'system'),
JMESPathCheck(
"properties.configuration.registries[0].server", f'{acr}.azurecr.io'),
JMESPathCheck(
"properties.configuration.registries[0].username", ""),
JMESPathCheck(
"properties.configuration.registries[0].passwordSecretRef", ""),
]).get_output_in_json()
image_name2 = app_json["properties"]["template"]["containers"][0]["image"]
self.assertTrue(image_name2.startswith(f'{acr}.azurecr.io'))
self.assertNotEqual(image_name1, image_name2)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_private_registry_port(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
app = self.create_random_name(prefix='aca', length=24)
acr = self.create_random_name(prefix='acr', length=24)
image_source = "mcr.microsoft.com/k8se/quickstart:latest"
image_name = f"{acr}.azurecr.io:443/k8se/quickstart:latest"
env = prepare_containerapp_env_for_app_e2e_tests(self)
acr_location = TEST_LOCATION
if format_location(acr_location) == format_location(STAGE_LOCATION):
acr_location = "eastus"
self.cmd(
f'acr create --sku basic -n {acr} -g {resource_group} --admin-enabled -l {acr_location}')
self.cmd(f'acr import -n {acr} --source {image_source}')
password = self.cmd(
f'acr credential show -n {acr} --query passwords[0].value').get_output_in_json()
self.cmd(f'containerapp create -g {resource_group} -n {app} --image {image_name} --ingress external --target-port 80 --environment {env} --registry-server {acr}.azurecr.io:443 --registry-username {acr} --registry-password {password}')
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck(
"properties.configuration.registries[0].server", f"{acr}.azurecr.io:443"),
JMESPathCheck(
"properties.template.containers[0].image", image_name),
JMESPathCheck(
"properties.configuration.secrets[0].name", f"{acr}azurecrio-443-{acr}")
])
app2 = self.create_random_name(prefix='aca', length=24)
image_name = f"{acr}.azurecr.io/k8se/quickstart:latest"
self.cmd(
f'containerapp create -g {resource_group} -n {app2} --image {image_name} --ingress external --target-port 80 --environment {env} --registry-server {acr}.azurecr.io --registry-username {acr} --registry-password {password}')
self.cmd(f'containerapp show -g {resource_group} -n {app2}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck(
"properties.configuration.registries[0].server", f"{acr}.azurecr.io"),
JMESPathCheck(
"properties.template.containers[0].image", image_name),
JMESPathCheck(
"properties.configuration.secrets[0].name", f"{acr}azurecrio-{acr}")
])
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_registry_acr_look_up_credentical(self, resource_group):
# MSI is not available in North Central US (Stage), if the TEST_LOCATION is "northcentralusstage", use eastus as location
location = TEST_LOCATION
if format_location(location) == format_location(STAGE_LOCATION):
location = "eastus"
self.cmd('configure --defaults location={}'.format(location))
app = self.create_random_name(prefix='aca', length=24)
acr = self.create_random_name(prefix='acr', length=24)
image_source = "mcr.microsoft.com/k8se/quickstart:latest"
image_name = f"{acr}.azurecr.io/k8se/quickstart:latest"
env = prepare_containerapp_env_for_app_e2e_tests(
self, location=location)
acr_location = TEST_LOCATION
if format_location(acr_location) == format_location(STAGE_LOCATION):
acr_location = "eastus"
self.cmd(
f'acr create --sku basic -n {acr} -g {resource_group} --admin-enabled --location {acr_location}')
self.cmd(f'acr import -n {acr} --source {image_source}')
# `az containberapp create` only with `--registry-server {acr}.azurecr.io`, use SystemAssigned as default for image pull
with mock.patch('azure.cli.command_modules.role.custom._gen_guid', side_effect=self.create_guid):
self.cmd(f'containerapp create -g {resource_group} -n {app} --image {image_name} --ingress external --target-port 80 --environment {env} --registry-server {acr}.azurecr.io', checks=[
JMESPathCheck("identity.type", "SystemAssigned"),
JMESPathCheck("properties.configuration.secrets", None),
JMESPathCheck(
"length(properties.configuration.registries)", 1),
JMESPathCheck(
"properties.configuration.registries[0].identity", 'system'),
JMESPathCheck(
"properties.configuration.registries[0].server", f'{acr}.azurecr.io'),
JMESPathCheck(
"properties.configuration.registries[0].username", ""),
JMESPathCheck(
"properties.configuration.registries[0].passwordSecretRef", ""),
])
# --registry-server {acr}.azurecr.io --registry-username, auto lookup credentical
self.cmd(
f'containerapp create -g {resource_group} -n {app} --image {image_name} --ingress external --target-port 80 --environment {env} --registry-server {acr}.azurecr.io --registry-username a')
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("identity.type", "None"),
JMESPathCheck(
"properties.configuration.registries[0].server", f"{acr}.azurecr.io"),
JMESPathCheck(
"properties.template.containers[0].image", image_name),
JMESPathCheck(
"properties.configuration.secrets[0].name", f"{acr}azurecrio-{acr}")
])
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_identity_registry(self, resource_group):
# MSI is not available in North Central US (Stage), if the TEST_LOCATION is "northcentralusstage", use eastus as location
location = TEST_LOCATION
if format_location(location) == format_location(STAGE_LOCATION):
location = "eastus"
self.cmd('configure --defaults location={}'.format(location))
env_name = self.create_random_name(
prefix='containerapp-e2e-env', length=24)
ca_name = self.create_random_name(prefix='containerapp', length=24)
user_identity_name = self.create_random_name(
prefix='containerapp', length=24)
acr = self.create_random_name(prefix='acr', length=24)
image_source = "mcr.microsoft.com/k8se/quickstart:latest"
image_name = f"{acr}.azurecr.io/k8se/quickstart:latest"
# prepare env
user_identity_name = self.create_random_name(
prefix='env-msi', length=24)
identity_json = self.cmd('identity create -g {} -n {}'.format(
resource_group, user_identity_name)).get_output_in_json()
user_identity_id = identity_json["id"]
self.cmd('containerapp env create -g {} -n {} --mi-system-assigned --mi-user-assigned {} --logs-destination none'.format(
resource_group, env_name, user_identity_id))
containerapp_env = self.cmd(
'containerapp env show -g {} -n {}'.format(resource_group, env_name)).get_output_in_json()
while containerapp_env["properties"]["provisioningState"].lower() == "waiting":
time.sleep(5)
containerapp_env = self.cmd(
'containerapp env show -g {} -n {}'.format(resource_group, env_name)).get_output_in_json()
env = containerapp_env["id"]
# prepare acr
acr_id = self.cmd(
f'acr create --sku basic -n {acr} -g {resource_group} --location {location}').get_output_in_json()["id"]
# role assign
roleAssignmentName1 = self.create_guid()
roleAssignmentName2 = self.create_guid()
self.cmd(
f'role assignment create --role acrpull --assignee {containerapp_env["identity"]["principalId"]} --scope {acr_id} --name {roleAssignmentName1}')
self.cmd(
f'role assignment create --role acrpull --assignee {identity_json["principalId"]} --scope {acr_id} --name {roleAssignmentName2}')
# upload image
self.cmd(f'acr import -n {acr} --source {image_source}')
# wait for role assignment take effect
time.sleep(30)
# use env system msi to pull image
self.cmd(
f'containerapp create -g {resource_group} -n {ca_name} --image {image_name} --ingress external --target-port 80 --environment {env} --registry-server {acr}.azurecr.io --registry-identity system-environment')
self.cmd(f'containerapp show -g {resource_group} -n {ca_name}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("identity.type", "None"),
JMESPathCheck(
"properties.configuration.registries[0].server", f"{acr}.azurecr.io"),
JMESPathCheck(
"properties.configuration.registries[0].identity", "system-environment", case_sensitive=False),
JMESPathCheck(
"properties.template.containers[0].image", image_name),
])
# update use env user assigned identity
self.cmd(
f'containerapp registry set -g {resource_group} -n {ca_name} --server {acr}.azurecr.io --identity {user_identity_id}')
self.cmd(f'containerapp show -g {resource_group} -n {ca_name}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("identity.type", "None"),
JMESPathCheck(
"properties.configuration.registries[0].server", f"{acr}.azurecr.io"),
JMESPathCheck(
"properties.configuration.registries[0].identity", user_identity_id, case_sensitive=False),
JMESPathCheck(
"properties.template.containers[0].image", image_name),
])
# update containerapp to create new revision
self.cmd(
f'containerapp update -g {resource_group} -n {ca_name} --revision-suffix v2')
self.cmd(f'containerapp show -g {resource_group} -n {ca_name}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("identity.type", "None"),
JMESPathCheck(
"properties.configuration.registries[0].server", f"{acr}.azurecr.io"),
JMESPathCheck(
"properties.configuration.registries[0].identity", user_identity_id, case_sensitive=False),
JMESPathCheck(
"properties.template.containers[0].image", image_name),
JMESPathCheck("properties.template.revisionSuffix", "v2")
])
# update use env system managed identity
self.cmd(
f'containerapp registry set -g {resource_group} -n {ca_name} --server {acr}.azurecr.io --identity system-environment')
self.cmd(f'containerapp show -g {resource_group} -n {ca_name}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("identity.type", "None"),
JMESPathCheck(
"properties.configuration.registries[0].server", f"{acr}.azurecr.io"),
JMESPathCheck(
"properties.configuration.registries[0].identity", "system-environment"),
JMESPathCheck(
"properties.template.containers[0].image", image_name),
])
# update containerapp to create new revision
self.cmd(
f'containerapp update -g {resource_group} -n {ca_name} --revision-suffix v3')
self.cmd(f'containerapp show -g {resource_group} -n {ca_name}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("identity.type", "None"),
JMESPathCheck(
"properties.configuration.registries[0].server", f"{acr}.azurecr.io"),
JMESPathCheck(
"properties.configuration.registries[0].identity", "system-environment"),
JMESPathCheck(
"properties.template.containers[0].image", image_name),
JMESPathCheck("properties.template.revisionSuffix", "v3")
])
|
class ContainerappRegistryIdentityTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_registry_identity_user(self, resource_group):
pass
@live_only()
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_create_source_registry_identity_user(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_registry_identity_system(self, resource_group):
pass
@live_only()
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_create_source_registry_identity_system(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_private_registry_port(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_registry_acr_look_up_credentical(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_identity_registry(self, resource_group):
pass
| 25 | 0 | 44 | 6 | 36 | 3 | 2 | 0.07 | 1 | 1 | 0 | 0 | 8 | 0 | 8 | 8 | 376 | 54 | 302 | 81 | 277 | 22 | 167 | 74 | 158 | 3 | 1 | 1 | 17 |
11,032 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py
|
azext_containerapp.tests.latest.test_containerapp_commands.ContainerappOtherPropertyTests
|
class ContainerappOtherPropertyTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
super().__init__(*arg, random_config_dir=True, **kwargs)
@live_only() # Pass lively, failed in playback mode because in the playback mode the cloud is AzureCloud, not AzureChinaCloud
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="chinaeast3")
def test_containerapp_up_mooncake(self, resource_group):
ca_name = self.create_random_name(prefix='containerapp', length=24)
image_name = "mcr.microsoft.com/k8se/quickstart:latest"
self.cmd('az containerapp up -n {} -g {} --image {} -l chinaeast3'.format(
ca_name, resource_group, image_name))
self.cmd('az containerapp show -n {} -g {}'.format(ca_name, resource_group), checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.template.containers[0].image", image_name),
])
self.cmd('az containerapp env list -g {}'.format(resource_group), checks=[
JMESPathCheck('length(@)', 1),
])
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westus")
def test_containerapp_get_customdomainverificationid_e2e(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
env_name = self.create_random_name(
prefix='containerapp-env', length=24)
logs_workspace_name = self.create_random_name(
prefix='containerapp-env', length=24)
logs_workspace_id = self.cmd(
'monitor log-analytics workspace create -g {} -n {} -l eastus'
.format(resource_group, logs_workspace_name)
).get_output_in_json()["customerId"]
logs_workspace_key = self.cmd(
'monitor log-analytics workspace get-shared-keys -g {} -n {}'
.format(resource_group, logs_workspace_name)
).get_output_in_json()["primarySharedKey"]
verification_id = self.cmd(
f'containerapp show-custom-domain-verification-id').get_output_in_json()
self.assertEqual(len(verification_id), 64)
# create an App service domain and update its txt records
contacts = os.path.join(TEST_DIR, 'domain-contact.json')
zone_name = "{}.com".format(env_name)
subdomain_1 = "devtest"
txt_name_1 = "asuid.{}".format(subdomain_1)
hostname_1 = "{}.{}".format(subdomain_1, zone_name)
self.cmd(
"appservice domain create -g {} --hostname {} --contact-info=@'{}' --accept-terms"
.format(resource_group, zone_name, contacts)
).get_output_in_json()
self.cmd(
'network dns record-set txt add-record -g {} -z {} -n {} -v {}'
.format(resource_group, zone_name, txt_name_1, verification_id)
).get_output_in_json()
# upload cert, add hostname & binding
pfx_file = os.path.join(TEST_DIR, 'cert.pfx')
pfx_password = 'test12'
self.cmd(
'containerapp env create -g {} -n {} --logs-workspace-id {} --logs-workspace-key {} '
'--dns-suffix {} --certificate-file "{}" --certificate-password {}'
.format(resource_group, env_name, logs_workspace_id, logs_workspace_key,
hostname_1, pfx_file, pfx_password))
self.cmd(f'containerapp env show -n {env_name} -g {resource_group}', checks=[
JMESPathCheck('name', env_name),
JMESPathCheck(
'properties.customDomainConfiguration.dnsSuffix', hostname_1),
])
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_termination_grace_period_seconds(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
app = self.create_random_name(prefix='aca', length=24)
image = "mcr.microsoft.com/k8se/quickstart:latest"
terminationGracePeriodSeconds = 90
env = prepare_containerapp_env_for_app_e2e_tests(self)
self.cmd(
f'containerapp create -g {resource_group} -n {app} --image {image} --ingress external --target-port 80 --environment {env} --termination-grace-period {terminationGracePeriodSeconds}')
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[JMESPathCheck(
"properties.template.terminationGracePeriodSeconds", terminationGracePeriodSeconds)])
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_max_inactive_revisions(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
app = self.create_random_name(prefix='aca', length=24)
image = "mcr.microsoft.com/k8se/quickstart:latest"
env = prepare_containerapp_env_for_app_e2e_tests(self)
self.cmd(
f'containerapp create -g {resource_group} -n {app} --image {image} --ingress external --target-port 80 --environment {env} --cpu 0.5 --memory 1Gi')
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[
JMESPathCheck("properties.configuration.maxInactiveRevisions", 100)])
maxInactiveRevisions = 99
self.cmd(
f'containerapp create -g {resource_group} -n {app} --image {image} --ingress external --target-port 80 --environment {env} --max-inactive-revisions {maxInactiveRevisions}')
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[JMESPathCheck(
"properties.configuration.maxInactiveRevisions", maxInactiveRevisions)])
maxInactiveRevisions = 50
self.cmd(
f'containerapp update -g {resource_group} -n {app} --cpu 0.5 --memory 1Gi --max-inactive-revisions {maxInactiveRevisions}')
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[JMESPathCheck(
"properties.configuration.maxInactiveRevisions", maxInactiveRevisions)])
self.cmd(
f'containerapp update -g {resource_group} -n {app} --cpu 0.25 --memory 0.5Gi')
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[JMESPathCheck(
"properties.configuration.maxInactiveRevisions", maxInactiveRevisions)])
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="centraluseuap")
def test_containerapp_kind_functionapp(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
app = self.create_random_name(prefix='aca', length=24)
image = "mcr.microsoft.com/k8se/quickstart:latest"
env = prepare_containerapp_env_for_app_e2e_tests(self)
self.cmd(f'containerapp create -g {resource_group} -n {app} --image {image} --ingress external --target-port 80 --environment {env} --cpu 0.5 --memory 1Gi', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("kind", None)
])
self.cmd(f'containerapp create -g {resource_group} -n {app} --image {image} --ingress external --target-port 80 --environment {env} --kind functionapp', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("kind", "functionapp")
])
self.cmd(f'containerapp update -g {resource_group} -n {app} --cpu 0.25 --memory 0.5Gi', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("kind", "functionapp")
])
|
class ContainerappOtherPropertyTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
pass
@live_only()
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="chinaeast3")
def test_containerapp_up_mooncake(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westus")
def test_containerapp_get_customdomainverificationid_e2e(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_termination_grace_period_seconds(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_max_inactive_revisions(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="centraluseuap")
def test_containerapp_kind_functionapp(self, resource_group):
pass
| 18 | 0 | 19 | 4 | 15 | 0 | 1 | 0.03 | 1 | 1 | 0 | 0 | 6 | 0 | 6 | 6 | 133 | 28 | 103 | 37 | 85 | 3 | 59 | 32 | 52 | 1 | 1 | 0 | 6 |
11,033 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py
|
azext_containerapp.tests.latest.test_containerapp_commands.ContainerappIngressTests
|
class ContainerappIngressTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
super().__init__(*arg, random_config_dir=True, **kwargs)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus2")
def test_containerapp_ingress_e2e(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
ca_name = self.create_random_name(prefix='containerapp', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(self)
self.cmd('containerapp create -g {} -n {} --environment {} --ingress external --target-port 80 --allow-insecure'.format(resource_group, ca_name, env))
self.cmd('containerapp ingress show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('external', True),
JMESPathCheck('targetPort', 80),
JMESPathCheck('allowInsecure', True),
])
self.cmd(
'containerapp ingress disable -g {} -n {}'.format(resource_group, ca_name))
containerapp_def = self.cmd(
'containerapp show -g {} -n {}'.format(resource_group, ca_name)).get_output_in_json()
self.assertEqual(
"fqdn" in containerapp_def["properties"]["configuration"], False)
self.cmd('containerapp ingress enable -g {} -n {} --type internal --target-port 81 --allow-insecure --transport http2'.format(resource_group, ca_name))
self.cmd('containerapp ingress show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('external', False),
JMESPathCheck('targetPort', 81),
JMESPathCheck('allowInsecure', True),
JMESPathCheck('transport', "Http2"),
])
self.cmd('containerapp ingress update -g {} -n {} --type external --allow-insecure=False'.format(resource_group, ca_name))
self.cmd('containerapp ingress show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('external', True),
JMESPathCheck('targetPort', 81),
JMESPathCheck('allowInsecure', False),
JMESPathCheck('transport', "Http2"),
])
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus2")
def test_containerapp_ingress_traffic_e2e(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
ca_name = self.create_random_name(prefix='containerapp', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(self)
self.cmd('containerapp create -g {} -n {} --environment {} --ingress external --target-port 80 --revisions-mode multiple'.format(resource_group, ca_name, env))
self.cmd('containerapp ingress show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('external', True),
JMESPathCheck('targetPort', 80),
])
self.cmd('containerapp ingress traffic set -g {} -n {} --revision-weight latest=100'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].latestRevision', True),
JMESPathCheck('[0].weight', 100),
])
self.cmd(
'containerapp update -g {} -n {} --cpu 1.0 --memory 2Gi'.format(resource_group, ca_name))
revisions_list = self.cmd(
'containerapp revision list -g {} -n {}'.format(resource_group, ca_name)).get_output_in_json()
self.cmd('containerapp ingress traffic set -g {} -n {} --revision-weight latest=50 {}=50'.format(resource_group, ca_name, revisions_list[0]["name"]), checks=[
JMESPathCheck('[0].latestRevision', True),
JMESPathCheck('[0].weight', 50),
JMESPathCheck('[1].revisionName', revisions_list[0]["name"]),
JMESPathCheck('[1].weight', 50),
])
self.cmd('containerapp ingress traffic show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].latestRevision', True),
JMESPathCheck('[0].weight', 50),
JMESPathCheck('[1].revisionName', revisions_list[0]["name"]),
JMESPathCheck('[1].weight', 50),
])
revisions_list = self.cmd(
'containerapp revision list -g {} -n {}'.format(resource_group, ca_name)).get_output_in_json()
for revision in revisions_list:
self.assertEqual(revision["properties"]["trafficWeight"], 50)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus2")
def test_containerapp_ingress_traffic_labels_e2e(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
ca_name = self.create_random_name(prefix='containerapp', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(self)
self.cmd('containerapp create -g {} -n {} --environment {} --ingress external --target-port 0 --revisions-mode labels --target-label label1'.format(resource_group, ca_name, env))
self.cmd('containerapp ingress show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('external', True),
JMESPathCheck('targetPort', 0),
JMESPathCheck('traffic[0].weight', 100),
JMESPathCheck('traffic[0].label', "label1"),
])
self.cmd('containerapp update -g {} -n {} --cpu 1.0 --memory 2Gi --target-label label2'.format(resource_group, ca_name))
revisions_list = self.cmd(
'containerapp revision list -g {} -n {}'.format(resource_group, ca_name)).get_output_in_json()
# TODO: The revision list call isn't handled by extensions, this will only work once the core CLI updates to at least 2024-10-02-preview
# self.assertEqual(revisions_list[0]["properties"]["labels"], "label1")
# self.assertEqual(revisions_list[2]["properties"]["labels"], "label2")
self.cmd('containerapp ingress traffic show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].weight', 100),
JMESPathCheck('[0].label', "label1"),
JMESPathCheck('[0].revisionName', revisions_list[0]["name"]),
JMESPathCheck('[1].weight', 0),
JMESPathCheck('[1].label', "label2"),
JMESPathCheck('[1].revisionName', revisions_list[1]["name"]),
])
self.cmd('containerapp ingress traffic set -g {} -n {} --label-weight label1=80 label2=20'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].weight', 80),
JMESPathCheck('[0].label', "label1"),
JMESPathCheck('[0].revisionName', revisions_list[0]["name"]),
JMESPathCheck('[1].weight', 20),
JMESPathCheck('[1].label', "label2"),
JMESPathCheck('[1].revisionName', revisions_list[1]["name"]),
])
self.cmd('containerapp ingress traffic show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].weight', 80),
JMESPathCheck('[0].label', "label1"),
JMESPathCheck('[0].revisionName', revisions_list[0]["name"]),
JMESPathCheck('[1].weight', 20),
JMESPathCheck('[1].label', "label2"),
JMESPathCheck('[1].revisionName', revisions_list[1]["name"]),
])
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
@live_only() # encounters 'CannotOverwriteExistingCassetteException' only when run from recording (passes when run live) and vnet command error in cli pipeline
def test_containerapp_tcp_ingress(self, resource_group):
location = TEST_LOCATION
if format_location(location) == format_location(STAGE_LOCATION):
location = "eastus"
self.cmd('configure --defaults location={}'.format(location))
env_name = self.create_random_name(prefix='env', length=24)
logs = self.create_random_name(prefix='logs', length=24)
vnet = self.create_random_name(prefix='name', length=24)
ca_name = self.create_random_name(prefix='containerapp', length=24)
self.cmd(
f"az network vnet create --address-prefixes '14.0.0.0/23' -g {resource_group} -n {vnet}")
sub_id = self.cmd(
f"az network vnet subnet create --address-prefixes '14.0.0.0/23' --delegations Microsoft.App/environments -n sub -g {resource_group} --vnet-name {vnet}").get_output_in_json()["id"]
logs_id = self.cmd(
f"monitor log-analytics workspace create -g {resource_group} -n {logs} -l eastus").get_output_in_json()["customerId"]
logs_key = self.cmd(
f'monitor log-analytics workspace get-shared-keys -g {resource_group} -n {logs}').get_output_in_json()["primarySharedKey"]
self.cmd(
f'containerapp env create -g {resource_group} -n {env_name} --logs-workspace-id {logs_id} --logs-workspace-key {logs_key} --internal-only -s {sub_id}')
containerapp_env = self.cmd(
f'containerapp env show -g {resource_group} -n {env_name}').get_output_in_json()
while containerapp_env["properties"]["provisioningState"].lower() == "waiting":
time.sleep(5)
containerapp_env = self.cmd(
f'containerapp env show -g {resource_group} -n {env_name}').get_output_in_json()
self.cmd(f'containerapp env show -n {env_name} -g {resource_group}', checks=[
JMESPathCheck('name', env_name),
JMESPathCheck('properties.vnetConfiguration.internal', True),
])
self.cmd('containerapp create -g {} -n {} --environment {} --ingress external --transport tcp --target-port 80 --exposed-port 3000'.format(resource_group, ca_name, env_name))
self.cmd('containerapp ingress show -g {} -n {}'.format(resource_group, ca_name, env_name), checks=[
JMESPathCheck('external', True),
JMESPathCheck('targetPort', 80),
JMESPathCheck('exposedPort', 3000),
JMESPathCheck('transport', "Tcp"),
])
self.cmd('containerapp ingress enable -g {} -n {} --type internal --target-port 81 --allow-insecure --transport http2'.format(
resource_group, ca_name, env_name))
self.cmd('containerapp ingress show -g {} -n {}'.format(resource_group, ca_name, env_name), checks=[
JMESPathCheck('external', False),
JMESPathCheck('targetPort', 81),
JMESPathCheck('allowInsecure', True),
JMESPathCheck('transport', "Http2"),
])
self.cmd('containerapp ingress enable -g {} -n {} --type internal --target-port 81 --transport tcp --exposed-port 3020'.format(resource_group, ca_name, env_name))
self.cmd('containerapp ingress show -g {} -n {}'.format(resource_group, ca_name, env_name), checks=[
JMESPathCheck('external', False),
JMESPathCheck('targetPort', 81),
JMESPathCheck('transport', "Tcp"),
JMESPathCheck('exposedPort', 3020),
])
app = self.create_random_name(prefix='containerapp', length=24)
self.cmd(
f'containerapp create -g {resource_group} -n {app} --image redis --ingress external --target-port 6379 --environment {env_name} --transport tcp --scale-rule-type tcp --scale-rule-name tcp-scale-rule --scale-rule-tcp-concurrency 50 --scale-rule-auth trigger=secretref --scale-rule-metadata key=value',
checks=[
JMESPathCheck(
"properties.configuration.ingress.transport", "Tcp"),
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck(
"properties.template.scale.rules[0].name", "tcp-scale-rule"),
JMESPathCheck(
"properties.template.scale.rules[0].tcp.auth[0].triggerParameter", "trigger"),
JMESPathCheck(
"properties.template.scale.rules[0].tcp.auth[0].secretRef", "secretref"),
])
# the metadata is not returned in create/update command, we should use show command to check
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[
JMESPathCheck(
"properties.template.scale.rules[0].name", "tcp-scale-rule"),
JMESPathCheck(
"properties.template.scale.rules[0].tcp.metadata.concurrentConnections", "50"),
JMESPathCheck(
"properties.template.scale.rules[0].tcp.metadata.key", "value")
])
self.cmd(
f'containerapp update -g {resource_group} -n {app} --scale-rule-name tcp-scale-rule --scale-rule-type tcp --scale-rule-tcp-concurrency 2 --scale-rule-auth "apiKey=api-key" "appKey=app-key"',
checks=[
JMESPathCheck(
"properties.configuration.ingress.transport", "Tcp"),
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck(
"properties.template.scale.rules[0].name", "tcp-scale-rule"),
JMESPathCheck(
"properties.template.scale.rules[0].tcp.auth[0].triggerParameter", "apiKey"),
JMESPathCheck(
"properties.template.scale.rules[0].tcp.auth[0].secretRef", "api-key"),
JMESPathCheck(
"properties.template.scale.rules[0].tcp.auth[1].triggerParameter", "appKey"),
JMESPathCheck(
"properties.template.scale.rules[0].tcp.auth[1].secretRef", "app-key"),
])
# the metadata is not returned in create/update command, we should use show command to check
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[
JMESPathCheck(
"properties.template.scale.rules[0].name", "tcp-scale-rule"),
JMESPathCheck(
"properties.template.scale.rules[0].tcp.metadata.concurrentConnections", "2"),
])
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_ip_restrictions(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
ca_name = self.create_random_name(prefix='containerapp', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(self)
# self.cmd('containerapp create -g {} -n {} --environment {}'.format(resource_group, ca_name, env_name))
self.cmd('containerapp create -g {} -n {} --environment {} --ingress external --target-port 80'.format(resource_group, ca_name, env))
self.cmd('containerapp ingress access-restriction set -g {} -n {} --rule-name name --ip-address 192.168.1.1/32 --description "Description here." --action Allow'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].name', "name"),
JMESPathCheck('[0].ipAddressRange', "192.168.1.1/32"),
JMESPathCheck('[0].description', "Description here."),
JMESPathCheck('[0].action', "Allow"),
])
self.cmd('containerapp ingress access-restriction list -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].name', "name"),
JMESPathCheck('[0].ipAddressRange', "192.168.1.1/32"),
JMESPathCheck('[0].description', "Description here."),
JMESPathCheck('[0].action', "Allow"),
])
self.cmd('containerapp ingress access-restriction set -g {} -n {} --rule-name name2 --ip-address 192.168.1.1/8 --description "Description here 2." --action Allow'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].name', "name"),
JMESPathCheck('[0].ipAddressRange', "192.168.1.1/32"),
JMESPathCheck('[0].description', "Description here."),
JMESPathCheck('[0].action', "Allow"),
JMESPathCheck('[1].name', "name2"),
JMESPathCheck('[1].ipAddressRange', "192.168.1.1/8"),
JMESPathCheck('[1].description', "Description here 2."),
JMESPathCheck('[1].action', "Allow"),
])
self.cmd('containerapp ingress access-restriction list -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].name', "name"),
JMESPathCheck('[0].ipAddressRange', "192.168.1.1/32"),
JMESPathCheck('[0].description', "Description here."),
JMESPathCheck('[0].action', "Allow"),
JMESPathCheck('[1].name', "name2"),
JMESPathCheck('[1].ipAddressRange', "192.168.1.1/8"),
JMESPathCheck('[1].description', "Description here 2."),
JMESPathCheck('[1].action', "Allow"),
])
self.cmd('containerapp ingress access-restriction remove -g {} -n {} --rule-name name'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].name', "name2"),
JMESPathCheck('[0].ipAddressRange', "192.168.1.1/8"),
JMESPathCheck('[0].description', "Description here 2."),
JMESPathCheck('[0].action', "Allow"),
])
self.cmd('containerapp ingress access-restriction list -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].name', "name2"),
JMESPathCheck('[0].ipAddressRange', "192.168.1.1/8"),
JMESPathCheck('[0].description', "Description here 2."),
JMESPathCheck('[0].action', "Allow"),
])
self.cmd('containerapp ingress access-restriction remove -g {} -n {} --rule-name name2'.format(resource_group, ca_name), checks=[
JMESPathCheck('length(@)', 0),
])
self.cmd('containerapp ingress access-restriction list -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('length(@)', 0),
])
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_ip_restrictions_deny(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
env_name = self.create_random_name(
prefix='containerapp-env', length=24)
ca_name = self.create_random_name(prefix='containerapp', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(self)
# self.cmd('containerapp create -g {} -n {} --environment {}'.format(resource_group, ca_name, env_name))
self.cmd('containerapp create -g {} -n {} --environment {} --ingress external --target-port 80'.format(resource_group, ca_name, env))
self.cmd('containerapp ingress access-restriction set -g {} -n {} --rule-name name --ip-address 192.168.1.1/32 --description "Description here." --action Deny'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].name', "name"),
JMESPathCheck('[0].ipAddressRange', "192.168.1.1/32"),
JMESPathCheck('[0].description', "Description here."),
JMESPathCheck('[0].action', "Deny"),
])
self.cmd('containerapp ingress access-restriction list -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].name', "name"),
JMESPathCheck('[0].ipAddressRange', "192.168.1.1/32"),
JMESPathCheck('[0].description', "Description here."),
JMESPathCheck('[0].action', "Deny"),
])
self.cmd('containerapp ingress access-restriction set -g {} -n {} --rule-name name2 --ip-address 192.168.1.1/8 --description "Description here 2." --action Deny'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].name', "name"),
JMESPathCheck('[0].ipAddressRange', "192.168.1.1/32"),
JMESPathCheck('[0].description', "Description here."),
JMESPathCheck('[0].action', "Deny"),
JMESPathCheck('[1].name', "name2"),
JMESPathCheck('[1].ipAddressRange', "192.168.1.1/8"),
JMESPathCheck('[1].description', "Description here 2."),
JMESPathCheck('[1].action', "Deny"),
])
self.cmd('containerapp ingress access-restriction list -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].name', "name"),
JMESPathCheck('[0].ipAddressRange', "192.168.1.1/32"),
JMESPathCheck('[0].description', "Description here."),
JMESPathCheck('[0].action', "Deny"),
JMESPathCheck('[1].name', "name2"),
JMESPathCheck('[1].ipAddressRange', "192.168.1.1/8"),
JMESPathCheck('[1].description', "Description here 2."),
JMESPathCheck('[1].action', "Deny"),
])
self.cmd('containerapp ingress access-restriction remove -g {} -n {} --rule-name name'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].name', "name2"),
JMESPathCheck('[0].ipAddressRange', "192.168.1.1/8"),
JMESPathCheck('[0].description', "Description here 2."),
JMESPathCheck('[0].action', "Deny"),
])
self.cmd('containerapp ingress access-restriction list -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('[0].name', "name2"),
JMESPathCheck('[0].ipAddressRange', "192.168.1.1/8"),
JMESPathCheck('[0].description', "Description here 2."),
JMESPathCheck('[0].action', "Deny"),
])
self.cmd('containerapp ingress access-restriction remove -g {} -n {} --rule-name name2'.format(resource_group, ca_name), checks=[
JMESPathCheck('length(@)', 0),
])
self.cmd('containerapp ingress access-restriction list -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('length(@)', 0),
])
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_cors_policy(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
ca_name = self.create_random_name(prefix='containerapp', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(self)
self.cmd('containerapp create -g {} -n {} --environment {} --ingress external --target-port 80'.format(resource_group, ca_name, env))
self.cmd('containerapp ingress cors enable -g {} -n {} --allowed-origins "http://www.contoso.com" "https://www.contoso.com" --allowed-methods "GET" "POST" --allowed-headers "header1" "header2" --expose-headers "header3" "header4" --allow-credentials true --max-age 100'.format(resource_group, ca_name), checks=[
JMESPathCheck('length(allowedOrigins)', 2),
JMESPathCheck('allowedOrigins[0]', "http://www.contoso.com"),
JMESPathCheck('allowedOrigins[1]', "https://www.contoso.com"),
JMESPathCheck('length(allowedMethods)', 2),
JMESPathCheck('allowedMethods[0]', "GET"),
JMESPathCheck('allowedMethods[1]', "POST"),
JMESPathCheck('length(allowedHeaders)', 2),
JMESPathCheck('allowedHeaders[0]', "header1"),
JMESPathCheck('allowedHeaders[1]', "header2"),
JMESPathCheck('length(exposeHeaders)', 2),
JMESPathCheck('exposeHeaders[0]', "header3"),
JMESPathCheck('exposeHeaders[1]', "header4"),
JMESPathCheck('allowCredentials', True),
JMESPathCheck('maxAge', 100),
])
self.cmd('containerapp ingress cors update -g {} -n {} --allowed-origins "*" --allowed-methods "GET" --allowed-headers "header1" --expose-headers --allow-credentials false --max-age 0'.format(resource_group, ca_name), checks=[
JMESPathCheck('length(allowedOrigins)', 1),
JMESPathCheck('allowedOrigins[0]', "*"),
JMESPathCheck('length(allowedMethods)', 1),
JMESPathCheck('allowedMethods[0]', "GET"),
JMESPathCheck('length(allowedHeaders)', 1),
JMESPathCheck('allowedHeaders[0]', "header1"),
JMESPathCheck('exposeHeaders', None),
JMESPathCheck('allowCredentials', False),
JMESPathCheck('maxAge', 0),
])
self.cmd('containerapp ingress cors show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('length(allowedOrigins)', 1),
JMESPathCheck('allowedOrigins[0]', "*"),
JMESPathCheck('length(allowedMethods)', 1),
JMESPathCheck('allowedMethods[0]', "GET"),
JMESPathCheck('length(allowedHeaders)', 1),
JMESPathCheck('allowedHeaders[0]', "header1"),
JMESPathCheck('exposeHeaders', None),
JMESPathCheck('allowCredentials', False),
JMESPathCheck('maxAge', 0),
])
self.cmd('containerapp ingress cors disable -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('corsPolicy', None),
])
|
class ContainerappIngressTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus2")
def test_containerapp_ingress_e2e(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus2")
def test_containerapp_ingress_traffic_e2e(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus2")
def test_containerapp_ingress_traffic_labels_e2e(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
@live_only()
def test_containerapp_tcp_ingress(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_ip_restrictions(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_ip_restrictions_deny(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_cors_policy(self, resource_group):
pass
| 24 | 0 | 51 | 10 | 41 | 1 | 1 | 0.02 | 1 | 1 | 0 | 0 | 8 | 0 | 8 | 8 | 432 | 83 | 342 | 43 | 318 | 8 | 107 | 36 | 98 | 3 | 1 | 1 | 11 |
11,034 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py
|
azext_containerapp.tests.latest.test_containerapp_commands.ContainerappIdentityTests
|
class ContainerappIdentityTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
super().__init__(*arg, random_config_dir=True, **kwargs)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus2")
def test_containerapp_identity_e2e(self, resource_group):
# MSI is not available in North Central US (Stage), if the TEST_LOCATION is "northcentralusstage", use eastus as location
location = TEST_LOCATION
if format_location(location) == format_location(STAGE_LOCATION):
location = "eastus"
self.cmd('configure --defaults location={}'.format(location))
ca_name = self.create_random_name(prefix='containerapp', length=24)
user_identity_name = self.create_random_name(
prefix='containerapp', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(
self, location=location)
self.cmd(
'containerapp create -g {} -n {} --environment {}'.format(resource_group, ca_name, env))
self.cmd('containerapp identity assign --system-assigned -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('type', 'SystemAssigned'),
])
self.cmd(
'identity create -g {} -n {}'.format(resource_group, user_identity_name))
self.cmd('containerapp identity assign --user-assigned {} -g {} -n {}'.format(user_identity_name, resource_group, ca_name), checks=[
JMESPathCheck('type', 'SystemAssigned, UserAssigned'),
])
self.cmd('containerapp identity show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('type', 'SystemAssigned, UserAssigned'),
])
self.cmd('containerapp identity remove --user-assigned {} -g {} -n {}'.format(user_identity_name, resource_group, ca_name), checks=[
JMESPathCheck('type', 'SystemAssigned'),
])
self.cmd('containerapp identity show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('type', 'SystemAssigned'),
])
self.cmd('containerapp identity remove --system-assigned -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('type', 'None'),
])
self.cmd('containerapp identity show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('type', 'None'),
])
self.cmd('containerapp delete -g {} -n {} --yes'.format(resource_group,
ca_name), expect_failure=False)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="canadacentral")
def test_containerapp_identity_system(self, resource_group):
# MSI is not available in North Central US (Stage), if the TEST_LOCATION is "northcentralusstage", use eastus as location
location = TEST_LOCATION
if format_location(location) == format_location(STAGE_LOCATION):
location = "eastus"
self.cmd('configure --defaults location={}'.format(location))
env_name = self.create_random_name(
prefix='containerapp-env', length=24)
ca_name = self.create_random_name(prefix='containerapp', length=24)
logs_workspace_name = self.create_random_name(
prefix='containerapp-env', length=24)
logs_workspace_id = self.cmd('monitor log-analytics workspace create -g {} -n {} -l eastus'.format(
resource_group, logs_workspace_name)).get_output_in_json()["customerId"]
logs_workspace_key = self.cmd('monitor log-analytics workspace get-shared-keys -g {} -n {}'.format(
resource_group, logs_workspace_name)).get_output_in_json()["primarySharedKey"]
self.cmd('containerapp env create -g {} -n {} --logs-workspace-id {} --logs-workspace-key {}'.format(
resource_group, env_name, logs_workspace_id, logs_workspace_key))
containerapp_env = self.cmd(
'containerapp env show -g {} -n {}'.format(resource_group, env_name)).get_output_in_json()
while containerapp_env["properties"]["provisioningState"].lower() == "waiting":
time.sleep(5)
containerapp_env = self.cmd(
'containerapp env show -g {} -n {}'.format(resource_group, env_name)).get_output_in_json()
self.cmd('containerapp create -g {} -n {} --environment {} --system-assigned'.format(
resource_group, ca_name, env_name))
self.cmd('containerapp identity show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('type', 'SystemAssigned'),
])
self.cmd('containerapp identity remove --system-assigned -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('type', 'None'),
])
self.cmd('containerapp identity assign --system-assigned -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('type', 'SystemAssigned'),
])
self.cmd('containerapp identity remove --system-assigned -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('type', 'None'),
])
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_identity_user(self, resource_group):
# MSI is not available in North Central US (Stage), if the TEST_LOCATION is "northcentralusstage", use eastus as location
location = TEST_LOCATION
if format_location(location) == format_location(STAGE_LOCATION):
location = "eastus"
self.cmd('configure --defaults location={}'.format(location))
ca_name = self.create_random_name(prefix='containerapp', length=24)
user_identity_name1 = self.create_random_name(
prefix='containerapp-user1', length=24)
user_identity_name2 = self.create_random_name(
prefix='containerapp-user2', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(
self, location=location)
self.cmd(
'containerapp create -g {} -n {} --environment {}'.format(resource_group, ca_name, env))
self.cmd(
'identity create -g {} -n {}'.format(resource_group, user_identity_name1))
self.cmd(
'identity create -g {} -n {}'.format(resource_group, user_identity_name2))
self.cmd('containerapp identity assign --system-assigned -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('type', 'SystemAssigned'),
])
self.cmd('containerapp identity assign --user-assigned {} {} -g {} -n {}'.format(user_identity_name1, user_identity_name2, resource_group, ca_name), checks=[
JMESPathCheck('type', 'SystemAssigned, UserAssigned'),
])
self.cmd('containerapp identity show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('type', 'SystemAssigned, UserAssigned'),
])
self.cmd('containerapp identity remove --user-assigned {} -g {} -n {}'.format(user_identity_name1, resource_group, ca_name), checks=[
JMESPathCheck('type', 'SystemAssigned, UserAssigned'),
])
self.cmd('containerapp identity remove --user-assigned {} -g {} -n {}'.format(user_identity_name2, resource_group, ca_name), checks=[
JMESPathCheck('type', 'SystemAssigned'),
])
self.cmd('containerapp identity show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('type', 'SystemAssigned'),
])
self.cmd('containerapp identity remove --system-assigned -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('type', 'None'),
])
self.cmd('containerapp identity show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('type', 'None'),
])
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_identity_keda(self, resource_group):
# MSI is not available in North Central US (Stage), if the TEST_LOCATION is "northcentralusstage", use eastus as location
location = TEST_LOCATION
if format_location(location) == format_location(STAGE_LOCATION):
location = "eastus"
self.cmd('configure --defaults location={}'.format(location))
ca_name = self.create_random_name(prefix='containerapp', length=24)
user_identity_name1 = self.create_random_name(
prefix='containerapp-user1', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(
self, location=location)
user_identity_id = self.cmd('identity create -g {} -n {}'.format(
resource_group, user_identity_name1)).get_output_in_json()["id"]
self.cmd(f'containerapp create -g {resource_group} -n {ca_name} --environment {env} --system-assigned --user-assigned {user_identity_name1} --scale-rule-name azure-queue --scale-rule-type azure-queue --scale-rule-metadata "accountName=account1" "queueName=queue1" "queueLength=1" --scale-rule-identity {user_identity_name1}')
self.cmd(f'containerapp show -g {resource_group} -n {ca_name}', checks=[
JMESPathCheck(
"properties.template.scale.rules[0].name", "azure-queue"),
JMESPathCheck(
"properties.template.scale.rules[0].azureQueue.accountName", "account1"),
JMESPathCheck(
"properties.template.scale.rules[0].azureQueue.queueName", "queue1"),
JMESPathCheck(
"properties.template.scale.rules[0].azureQueue.queueLength", "1"),
JMESPathCheck(
"properties.template.scale.rules[0].azureQueue.identity", user_identity_id, case_sensitive=False),
])
self.cmd(f'containerapp update -g {resource_group} -n {ca_name} --scale-rule-name azure-blob --scale-rule-type azure-blob --scale-rule-metadata "accountName=account2" "blobContainerName=blob2" "blobCount=2" --scale-rule-identity {user_identity_id}')
self.cmd(f'containerapp show -g {resource_group} -n {ca_name}', checks=[
JMESPathCheck(
"properties.template.scale.rules[0].name", "azure-blob"),
JMESPathCheck(
"properties.template.scale.rules[0].custom.metadata.accountName", "account2"),
JMESPathCheck(
"properties.template.scale.rules[0].custom.metadata.blobContainerName", "blob2"),
JMESPathCheck(
"properties.template.scale.rules[0].custom.metadata.blobCount", "2"),
JMESPathCheck(
"properties.template.scale.rules[0].custom.identity", user_identity_id, case_sensitive=False),
JMESPathCheck(
"properties.template.scale.rules[0].custom.type", "azure-blob"),
])
|
class ContainerappIdentityTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus2")
def test_containerapp_identity_e2e(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="canadacentral")
def test_containerapp_identity_system(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_identity_user(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_identity_keda(self, resource_group):
pass
| 14 | 0 | 33 | 8 | 25 | 1 | 2 | 0.03 | 1 | 1 | 0 | 0 | 5 | 0 | 5 | 5 | 180 | 43 | 133 | 31 | 119 | 4 | 74 | 27 | 68 | 3 | 1 | 1 | 10 |
11,035 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py
|
azext_containerapp.tests.latest.test_containerapp_commands.ContainerappEnvStorageTests
|
class ContainerappEnvStorageTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
super().__init__(*arg, random_config_dir=True, **kwargs)
@AllowLargeResponse(8192)
@live_only() # Passes locally but fails in CI
@ResourceGroupPreparer(location="eastus")
def test_containerapp_env_storage(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
env_name = self.create_random_name(
prefix='containerapp-env', length=24)
storage_name = self.create_random_name(prefix='storage', length=24)
shares_name = self.create_random_name(prefix='share', length=24)
create_containerapp_env(self, env_name, resource_group)
storage_account_location = TEST_LOCATION
if storage_account_location == STAGE_LOCATION:
storage_account_location = "eastus"
self.cmd('storage account create -g {} -n {} --kind StorageV2 --sku Standard_LRS --enable-large-file-share --location {}'.format(
resource_group, storage_name, storage_account_location))
self.cmd('storage share-rm create -g {} -n {} --storage-account {} --access-tier "TransactionOptimized" --quota 1024'.format(
resource_group, shares_name, storage_name))
storage_keys = self.cmd('az storage account keys list -g {} -n {}'.format(
resource_group, storage_name)).get_output_in_json()[0]
self.cmd('containerapp env storage set -g {} -n {} --storage-name {} --azure-file-account-name {} --azure-file-account-key {} --access-mode ReadOnly --azure-file-share-name {}'.format(resource_group, env_name, storage_name, storage_name, storage_keys["value"], shares_name), checks=[
JMESPathCheck('name', storage_name),
])
self.cmd('containerapp env storage show -g {} -n {} --storage-name {}'.format(resource_group, env_name, storage_name), checks=[
JMESPathCheck('name', storage_name),
])
self.cmd('containerapp env storage list -g {} -n {}'.format(resource_group, env_name), checks=[
JMESPathCheck('[0].name', storage_name),
])
self.cmd('containerapp env storage remove -g {} -n {} --storage-name {} --yes'.format(
resource_group, env_name, storage_name))
self.cmd('containerapp env storage list -g {} -n {}'.format(resource_group, env_name), checks=[
JMESPathCheck('length(@)', 0),
])
|
class ContainerappEnvStorageTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
pass
@AllowLargeResponse(8192)
@live_only()
@ResourceGroupPreparer(location="eastus")
def test_containerapp_env_storage(self, resource_group):
pass
| 6 | 0 | 18 | 4 | 14 | 0 | 2 | 0.03 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 2 | 40 | 9 | 31 | 9 | 25 | 1 | 20 | 8 | 17 | 2 | 1 | 1 | 3 |
11,036 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py
|
azext_containerapp.tests.latest.test_containerapp_commands.ContainerappDaprTests
|
class ContainerappDaprTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
super().__init__(*arg, random_config_dir=True, **kwargs)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus2")
def test_containerapp_dapr_e2e(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
ca_name = self.create_random_name(prefix='containerapp', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(self)
self.cmd('containerapp create -g {} -n {} --environment {} --dapr-app-id containerapp --dapr-app-port 800 --dapr-app-protocol grpc --dhmrs 4 --dhrbs 50 --dapr-log-level debug --enable-dapr'.format(resource_group, ca_name, env), checks=[
JMESPathCheck('properties.configuration.dapr.appId',
"containerapp"),
JMESPathCheck('properties.configuration.dapr.appPort', 800),
JMESPathCheck('properties.configuration.dapr.appProtocol', "grpc"),
JMESPathCheck('properties.configuration.dapr.enabled', True),
JMESPathCheck(
'properties.configuration.dapr.httpReadBufferSize', 50),
JMESPathCheck(
'properties.configuration.dapr.httpMaxRequestSize', 4),
JMESPathCheck('properties.configuration.dapr.logLevel', "debug"),
JMESPathCheck(
'properties.configuration.dapr.enableApiLogging', False),
])
self.cmd('containerapp dapr enable -g {} -n {} --dapr-app-id containerapp1 --dapr-app-port 80 --dapr-app-protocol http --dal --dhmrs 6 --dhrbs 60 --dapr-log-level warn'.format(resource_group, ca_name, env), checks=[
JMESPathCheck('appId', "containerapp1"),
JMESPathCheck('appPort', 80),
JMESPathCheck('appProtocol', "http"),
JMESPathCheck('enabled', True),
JMESPathCheck('httpReadBufferSize', 60),
JMESPathCheck('httpMaxRequestSize', 6),
JMESPathCheck('logLevel', "warn"),
JMESPathCheck('enableApiLogging', True),
])
self.cmd('containerapp show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('properties.configuration.dapr.appId',
"containerapp1"),
JMESPathCheck('properties.configuration.dapr.appPort', 80),
JMESPathCheck('properties.configuration.dapr.appProtocol', "http"),
JMESPathCheck('properties.configuration.dapr.enabled', True),
JMESPathCheck(
'properties.configuration.dapr.httpReadBufferSize', 60),
JMESPathCheck(
'properties.configuration.dapr.httpMaxRequestSize', 6),
JMESPathCheck('properties.configuration.dapr.logLevel', "warn"),
JMESPathCheck(
'properties.configuration.dapr.enableApiLogging', True),
])
self.cmd('containerapp dapr disable -g {} -n {}'.format(resource_group, ca_name, env), checks=[
JMESPathCheck('appId', "containerapp1"),
JMESPathCheck('appPort', 80),
JMESPathCheck('appProtocol', "http"),
JMESPathCheck('enabled', False),
JMESPathCheck('httpReadBufferSize', 60),
JMESPathCheck('httpMaxRequestSize', 6),
JMESPathCheck('logLevel', "warn"),
JMESPathCheck('enableApiLogging', True),
])
self.cmd('containerapp show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('properties.configuration.dapr.appId',
"containerapp1"),
JMESPathCheck('properties.configuration.dapr.appPort', 80),
JMESPathCheck('properties.configuration.dapr.appProtocol', "http"),
JMESPathCheck('properties.configuration.dapr.enabled', False),
JMESPathCheck(
'properties.configuration.dapr.httpReadBufferSize', 60),
JMESPathCheck(
'properties.configuration.dapr.httpMaxRequestSize', 6),
JMESPathCheck('properties.configuration.dapr.logLevel', "warn"),
JMESPathCheck(
'properties.configuration.dapr.enableApiLogging', True),
])
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus2")
def test_containerapp_up_dapr_e2e(self, resource_group):
""" Ensure that dapr can be enabled if the app has been created using containerapp up """
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
image = 'mcr.microsoft.com/azuredocs/aks-helloworld:v1'
ca_name = self.create_random_name(prefix='containerapp', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(self)
self.cmd(
'containerapp up -g {} -n {} --environment {} --image {}'.format(
resource_group, ca_name, env, image))
self.cmd(
'containerapp dapr enable -g {} -n {} --dapr-app-id containerapp1 --dapr-app-port 80 '
'--dapr-app-protocol http --dal --dhmrs 6 --dhrbs 60 --dapr-log-level warn'.format(
resource_group, ca_name), checks=[
JMESPathCheck('appId', "containerapp1"),
JMESPathCheck('enabled', True)
])
|
class ContainerappDaprTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus2")
def test_containerapp_dapr_e2e(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus2")
def test_containerapp_up_dapr_e2e(self, resource_group):
''' Ensure that dapr can be enabled if the app has been created using containerapp up '''
pass
| 8 | 1 | 28 | 4 | 24 | 0 | 1 | 0.01 | 1 | 1 | 0 | 0 | 3 | 0 | 3 | 3 | 90 | 13 | 76 | 11 | 68 | 1 | 19 | 9 | 15 | 1 | 1 | 0 | 3 |
11,037 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py
|
azext_containerapp.tests.latest.test_containerapp_commands.ContainerappCustomDomainTests
|
class ContainerappCustomDomainTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
super().__init__(*arg, random_config_dir=True, **kwargs)
@AllowLargeResponse(8192)
@live_only() # encounters 'CannotOverwriteExistingCassetteException' only when run from recording (passes when run live)
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_custom_domains_e2e(self, resource_group):
location = TEST_LOCATION
if format_location(location) == format_location(STAGE_LOCATION):
location = "eastus"
self.cmd('configure --defaults location={}'.format(location))
env_name = self.create_random_name(
prefix='containerapp-env', length=24)
ca_name = self.create_random_name(prefix='containerapp', length=24)
create_containerapp_env(self, env_name, resource_group)
app = self.cmd('containerapp create -g {} -n {} --environment {} --ingress external --target-port 80'.format(
resource_group, ca_name, env_name)).get_output_in_json()
self.cmd('containerapp hostname list -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('length(@)', 0),
])
# list hostnames with a wrong location
self.cmd('containerapp hostname list -g {} -n {} -l "{}"'.format(resource_group, ca_name, "eastus2"), checks={
JMESPathCheck('length(@)', 0),
}, expect_failure=True)
# create an App service domain and update its txt records
contacts = os.path.join(TEST_DIR, 'domain-contact.json')
zone_name = "{}.com".format(ca_name)
subdomain_1 = "devtest"
subdomain_2 = "clitest"
txt_name_1 = "asuid.{}".format(subdomain_1)
txt_name_2 = "asuid.{}".format(subdomain_2)
hostname_1 = "{}.{}".format(subdomain_1, zone_name)
hostname_2 = "{}.{}".format(subdomain_2, zone_name)
verification_id = app["properties"]["customDomainVerificationId"]
self.cmd("appservice domain create -g {} --hostname {} --contact-info=@'{}' --accept-terms".format(
resource_group, zone_name, contacts)).get_output_in_json()
self.cmd('network dns record-set txt add-record -g {} -z {} -n {} -v {}'.format(
resource_group, zone_name, txt_name_1, verification_id)).get_output_in_json()
self.cmd('network dns record-set txt add-record -g {} -z {} -n {} -v {}'.format(
resource_group, zone_name, txt_name_2, verification_id)).get_output_in_json()
# upload cert, add hostname & binding
pfx_file = os.path.join(TEST_DIR, 'cert.pfx')
pfx_password = 'test12'
cert_id = self.cmd('containerapp ssl upload -n {} -g {} --environment {} --hostname {} --certificate-file "{}" --password {}'.format(ca_name, resource_group, env_name, hostname_1, pfx_file, pfx_password), checks=[
JMESPathCheck('[0].name', hostname_1),
]).get_output_in_json()[0]["certificateId"]
self.cmd('containerapp hostname list -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('length(@)', 1),
JMESPathCheck('[0].name', hostname_1),
JMESPathCheck('[0].bindingType', "SniEnabled"),
JMESPathCheck('[0].certificateId', cert_id),
])
# get cert thumbprint
cert_thumbprint = self.cmd('containerapp env certificate list -n {} -g {} -c {}'.format(env_name, resource_group, cert_id), checks=[
JMESPathCheck('length(@)', 1),
JMESPathCheck('[0].id', cert_id),
]).get_output_in_json()[0]["properties"]["thumbprint"]
# add binding by cert thumbprint
self.cmd('containerapp hostname bind -g {} -n {} --hostname {} --thumbprint {}'.format(
resource_group, ca_name, hostname_2, cert_thumbprint), expect_failure=True)
self.cmd('containerapp hostname bind -g {} -n {} --hostname {} --thumbprint {} -e {}'.format(resource_group, ca_name, hostname_2, cert_thumbprint, env_name), checks=[
JMESPathCheck('length(@)', 2),
])
self.cmd('containerapp hostname list -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('length(@)', 2),
JMESPathCheck('[0].bindingType', "SniEnabled"),
JMESPathCheck('[0].certificateId', cert_id),
JMESPathCheck('[1].bindingType', "SniEnabled"),
JMESPathCheck('[1].certificateId', cert_id),
])
# delete hostname with a wrong location
self.cmd('containerapp hostname delete -g {} -n {} --hostname {} -l "{}" --yes'.format(
resource_group, ca_name, hostname_1, "eastus2"), expect_failure=True)
self.cmd('containerapp hostname delete -g {} -n {} --hostname {} -l "{}" --yes'.format(resource_group, ca_name, hostname_1, app["location"]), checks=[
JMESPathCheck('length(@)', 1),
JMESPathCheck('[0].name', hostname_2),
JMESPathCheck('[0].bindingType', "SniEnabled"),
JMESPathCheck('[0].certificateId', cert_id),
]).get_output_in_json()
self.cmd('containerapp hostname list -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('length(@)', 1),
JMESPathCheck('[0].name', hostname_2),
JMESPathCheck('[0].bindingType', "SniEnabled"),
JMESPathCheck('[0].certificateId', cert_id),
])
self.cmd('containerapp hostname delete -g {} -n {} --hostname {} --yes'.format(resource_group, ca_name, hostname_2), checks=[
JMESPathCheck('length(@)', 0),
]).get_output_in_json()
# add binding by cert id
self.cmd('containerapp hostname bind -g {} -n {} --hostname {} --certificate {}'.format(resource_group, ca_name, hostname_2, cert_id), checks=[
JMESPathCheck('length(@)', 1),
JMESPathCheck('[0].bindingType', "SniEnabled"),
JMESPathCheck('[0].certificateId', cert_id),
JMESPathCheck('[0].name', hostname_2),
]).get_output_in_json()
self.cmd('containerapp hostname delete -g {} -n {} --hostname {} --yes'.format(resource_group, ca_name, hostname_2), checks=[
JMESPathCheck('length(@)', 0),
]).get_output_in_json()
# add binding by cert name, with and without environment
cert_name = parse_resource_id(cert_id)["resource_name"]
self.cmd('containerapp hostname bind -g {} -n {} --hostname {} --certificate {}'.format(
resource_group, ca_name, hostname_1, cert_name), expect_failure=True)
self.cmd('containerapp hostname bind -g {} -n {} --hostname {} --certificate {} -e {}'.format(resource_group, ca_name, hostname_1, cert_name, env_name), checks=[
JMESPathCheck('length(@)', 1),
JMESPathCheck('[0].bindingType', "SniEnabled"),
JMESPathCheck('[0].certificateId', cert_id),
JMESPathCheck('[0].name', hostname_1),
]).get_output_in_json()
self.cmd('containerapp hostname delete -g {} -n {} --hostname {} --yes'.format(resource_group, ca_name, hostname_1), checks=[
JMESPathCheck('length(@)', 0),
]).get_output_in_json()
|
class ContainerappCustomDomainTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
pass
@AllowLargeResponse(8192)
@live_only()
@ResourceGroupPreparer(location="westeurope")
def test_containerapp_custom_domains_e2e(self, resource_group):
pass
| 6 | 0 | 61 | 11 | 46 | 4 | 2 | 0.09 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 2 | 126 | 23 | 95 | 22 | 89 | 9 | 44 | 21 | 41 | 2 | 1 | 1 | 3 |
11,038 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py
|
azext_containerapp.tests.latest.test_containerapp_commands.ContainerappAnonymousRegistryTests
|
class ContainerappAnonymousRegistryTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
super().__init__(*arg, random_config_dir=True, **kwargs)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_anonymous_registry(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
app = self.create_random_name(prefix='aca', length=24)
image = "mcr.microsoft.com/k8se/quickstart:latest"
env = prepare_containerapp_env_for_app_e2e_tests(self)
self.cmd(
f'containerapp create -g {resource_group} -n {app} --image {image} --ingress external --target-port 80 --environment {env}')
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded")])
|
class ContainerappAnonymousRegistryTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_anonymous_registry(self, resource_group):
pass
| 5 | 0 | 7 | 2 | 5 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 2 | 17 | 5 | 12 | 7 | 7 | 0 | 10 | 6 | 7 | 1 | 1 | 0 | 2 |
11,039 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/containerapp/azext_containerapp/tests/latest/test_containerapp_azurefile.py
|
azext_containerapp.tests.latest.test_containerapp_azurefile.ContainerAppMountAzureFileTest
|
class ContainerAppMountAzureFileTest(ScenarioTest):
def __init__(self, *arg, **kwargs):
super().__init__(*arg, random_config_dir=True, **kwargs)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus")
def test_container_app_mount_azurefile_e2e(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
env = self.create_random_name(prefix='env', length=24)
app = self.create_random_name(prefix='app1', length=24)
storage = self.create_random_name(prefix='storage', length=24)
share = self.create_random_name(prefix='share', length=10)
storage_account_location = TEST_LOCATION
if format_location(storage_account_location) == format_location(STAGE_LOCATION):
storage_account_location = "eastus"
self.cmd(
f'az storage account create --resource-group {resource_group} --name {storage} --location {storage_account_location} --kind StorageV2 --sku Standard_LRS --enable-large-file-share --output none')
self.cmd(
f'az storage share-rm create --resource-group {resource_group} --storage-account {storage} --name {share} --quota 1024 --enabled-protocols SMB --output none')
create_containerapp_env(self, env, resource_group, TEST_LOCATION)
account_key = self.cmd(f'az storage account keys list -g {resource_group} -n {storage} --query "[0].value" '
'-otsv').output.strip()
self.cmd(
f'az containerapp env storage set -g {resource_group} -n {env} -a {storage} -k {account_key} -f {share} --storage-name {share} --access-mode ReadWrite')
containerapp_env = self.cmd('containerapp env show -n {} -g {}'.format(env, resource_group), checks=[
JMESPathCheck('name', env)
]).get_output_in_json()
containerapp_yaml_text = f"""
location: {TEST_LOCATION}
type: Microsoft.App/containerApps
name: {app}
resourceGroup: {resource_group}
properties:
managedEnvironmentId: {containerapp_env["id"]}
configuration:
activeRevisionsMode: Single
ingress:
external: true
allowInsecure: true
targetPort: 80
traffic:
- latestRevision: true
weight: 100
transport: Auto
template:
containers:
- image: mcr.microsoft.com/k8se/quickstart:latest
name: acamounttest
resources:
cpu: 0.5
ephemeralStorage: 1Gi
memory: 1Gi
volumeMounts:
- mountPath: /mnt/data
volumeName: azure-files-volume
subPath: sub
volumes:
- name: azure-files-volume
storageType: AzureFile
storageName: {share}
mountOptions: uid=999,gid=999
"""
containerapp_file_name = f"{self._testMethodName}_containerapp.yml"
write_test_file(containerapp_file_name, containerapp_yaml_text)
self.cmd(
f'az containerapp create -g {resource_group} --environment {env} -n {app} --yaml {containerapp_file_name}')
self.cmd('containerapp show -g {} -n {}'.format(resource_group, app), checks=[
JMESPathCheck(
'properties.template.volumes[0].storageType', 'AzureFile'),
JMESPathCheck('properties.template.volumes[0].storageName', share),
JMESPathCheck(
'properties.template.volumes[0].name', 'azure-files-volume'),
JMESPathCheck(
'properties.template.volumes[0].mountOptions', 'uid=999,gid=999'),
JMESPathCheck(
'properties.template.containers[0].volumeMounts[0].subPath', 'sub'),
JMESPathCheck(
'properties.template.containers[0].volumeMounts[0].mountPath', '/mnt/data'),
JMESPathCheck(
'properties.template.containers[0].volumeMounts[0].volumeName', 'azure-files-volume'),
])
self.cmd('az containerapp revision list -g {} -n {}'.format(resource_group, app), checks=[
JMESPathCheck(
'[0].properties.template.volumes[0].storageType', 'AzureFile'),
JMESPathCheck(
'[0].properties.template.volumes[0].storageName', share),
JMESPathCheck(
'[0].properties.template.volumes[0].name', 'azure-files-volume'),
JMESPathCheck(
'[0].properties.template.volumes[0].mountOptions', 'uid=999,gid=999'),
JMESPathCheck(
'[0].properties.template.containers[0].volumeMounts[0].subPath', 'sub'),
JMESPathCheck(
'[0].properties.template.containers[0].volumeMounts[0].mountPath', '/mnt/data'),
JMESPathCheck(
'[0].properties.template.containers[0].volumeMounts[0].volumeName', 'azure-files-volume'),
])
clean_up_test_file(containerapp_file_name)
containerapp_yaml_text = f"""
location: {TEST_LOCATION}
type: Microsoft.App/containerApps
name: {app}
resourceGroup: {resource_group}
properties:
managedEnvironmentId: {containerapp_env["id"]}
configuration:
activeRevisionsMode: Single
ingress:
external: true
allowInsecure: true
targetPort: 80
traffic:
- latestRevision: true
weight: 100
transport: Auto
template:
containers:
- image: mcr.microsoft.com/k8se/quickstart:latest
name: acamounttest
resources:
cpu: 0.5
ephemeralStorage: 1Gi
memory: 1Gi
volumeMounts:
- mountPath: /mnt/data
volumeName: azure-files-volume
subPath: sub2
volumes:
- name: azure-files-volume
storageType: AzureFile
storageName: {share}
mountOptions: uid=1000,gid=1000
"""
containerapp_file_name = f"{self._testMethodName}_containerapp_1.yml"
write_test_file(containerapp_file_name, containerapp_yaml_text)
self.cmd(
f'az containerapp update -g {resource_group} -n {app} --yaml {containerapp_file_name}')
self.cmd('containerapp show -g {} -n {}'.format(resource_group, app), checks=[
JMESPathCheck(
'properties.template.volumes[0].storageType', 'AzureFile'),
JMESPathCheck('properties.template.volumes[0].storageName', share),
JMESPathCheck(
'properties.template.volumes[0].name', 'azure-files-volume'),
JMESPathCheck(
'properties.template.volumes[0].mountOptions', 'uid=1000,gid=1000'),
JMESPathCheck(
'properties.template.containers[0].volumeMounts[0].subPath', 'sub2'),
JMESPathCheck(
'properties.template.containers[0].volumeMounts[0].mountPath', '/mnt/data'),
JMESPathCheck(
'properties.template.containers[0].volumeMounts[0].volumeName', 'azure-files-volume'),
])
self.cmd('az containerapp revision list -g {} -n {}'.format(resource_group, app), checks=[
JMESPathCheck(
'[1].properties.template.volumes[0].storageType', 'AzureFile'),
JMESPathCheck(
'[1].properties.template.volumes[0].storageName', share),
JMESPathCheck(
'[1].properties.template.volumes[0].name', 'azure-files-volume'),
JMESPathCheck(
'[1].properties.template.volumes[0].mountOptions', 'uid=1000,gid=1000'),
JMESPathCheck(
'[1].properties.template.containers[0].volumeMounts[0].subPath', 'sub2'),
JMESPathCheck(
'[1].properties.template.containers[0].volumeMounts[0].mountPath', '/mnt/data'),
JMESPathCheck(
'[1].properties.template.containers[0].volumeMounts[0].volumeName', 'azure-files-volume'),
])
clean_up_test_file(containerapp_file_name)
|
class ContainerAppMountAzureFileTest(ScenarioTest):
def __init__(self, *arg, **kwargs):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus")
def test_container_app_mount_azurefile_e2e(self, resource_group):
pass
| 5 | 0 | 75 | 6 | 69 | 0 | 2 | 0 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 2 | 154 | 13 | 141 | 13 | 136 | 0 | 32 | 12 | 29 | 2 | 1 | 1 | 3 |
11,040 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/containerapp/azext_containerapp/tests/latest/test_containerapp_auth_commands.py
|
azext_containerapp.tests.latest.test_containerapp_auth_commands.ContainerAppAuthTest
|
class ContainerAppAuthTest(ScenarioTest):
def __init__(self, *arg, **kwargs):
super().__init__(*arg, random_config_dir=True, **kwargs)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus")
def test_containerapp_auth_e2e(self, resource_group):
location = "eastus"
self.cmd('configure --defaults location={}'.format(location))
app = self.create_random_name(prefix='containerapp-auth', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(self, location)
self.cmd('containerapp create -g {} -n {} --environment {} --image mcr.microsoft.com/k8se/quickstart:latest --ingress external --target-port 80'.format(resource_group, app, env))
client_id = 'c0d23eb5-ea9f-4a4d-9519-bfa0a422c491'
client_secret = 'c0d23eb5-ea9f-4a4d-9519-bfa0a422c491'
issuer = 'https://sts.windows.net/54826b22-38d6-4fb2-bad9-b7983a3e9c5a/'
self.cmd(
'containerapp auth microsoft update -g {} --name {} --client-id {} --client-secret {} --issuer {} --yes'
.format(resource_group, app, client_id, client_secret, issuer), checks=[
JMESPathCheck('registration.clientId', client_id),
JMESPathCheck('registration.clientSecretSettingName',
"microsoft-provider-authentication-secret"),
JMESPathCheck('registration.openIdIssuer', issuer),
])
self.cmd('containerapp secret list -g {} -n {}'.format(resource_group, app), checks=[
JMESPathCheck('length(@)', 1),
JMESPathCheck(
'[0].name', "microsoft-provider-authentication-secret")
])
self.cmd('containerapp auth show -g {} -n {}'.format(resource_group, app), checks=[
JMESPathCheck(
'identityProviders.azureActiveDirectory.registration.clientId', client_id),
JMESPathCheck('identityProviders.azureActiveDirectory.registration.clientSecretSettingName',
"microsoft-provider-authentication-secret"),
JMESPathCheck(
'identityProviders.azureActiveDirectory.registration.openIdIssuer', issuer),
])
sasUrl = "sasurl"
self.cmd('containerapp auth update -g {} -n {} --unauthenticated-client-action AllowAnonymous --token-store true --sas-url-secret {} --yes'.format(resource_group, app, sasUrl), checks=[
JMESPathCheck('name', "current"),
JMESPathCheck(
'properties.globalValidation.unauthenticatedClientAction', "AllowAnonymous"),
JMESPathCheck(
'properties.identityProviders.azureActiveDirectory.registration.clientId', client_id),
JMESPathCheck('properties.identityProviders.azureActiveDirectory.registration.clientSecretSettingName',
"microsoft-provider-authentication-secret"),
JMESPathCheck(
'properties.identityProviders.azureActiveDirectory.registration.openIdIssuer', issuer),
JMESPathCheck('properties.login.tokenStore.enabled', True),
JMESPathCheck('properties.login.tokenStore.azureBlobStorage.sasUrlSettingName',
"blob-storage-token-store-sasurl-secret"),
])
self.cmd("az containerapp secret list --resource-group {} --name {}".format(resource_group, app), checks=[
JMESPathCheck('length(@)', 2),
])
self.cmd('containerapp auth show -g {} -n {}'.format(resource_group, app), checks=[
JMESPathCheck(
'globalValidation.unauthenticatedClientAction', "AllowAnonymous"),
JMESPathCheck(
'identityProviders.azureActiveDirectory.registration.clientId', client_id),
JMESPathCheck('identityProviders.azureActiveDirectory.registration.clientSecretSettingName',
"microsoft-provider-authentication-secret"),
JMESPathCheck(
'identityProviders.azureActiveDirectory.registration.openIdIssuer', issuer),
JMESPathCheck('login.tokenStore.enabled', True),
JMESPathCheck('login.tokenStore.azureBlobStorage.sasUrlSettingName',
"blob-storage-token-store-sasurl-secret"),
])
self.cmd('containerapp auth update -g {} -n {} --proxy-convention Standard --redirect-provider Facebook --unauthenticated-client-action AllowAnonymous'.format(
resource_group, app), checks=[
JMESPathCheck('name', 'current'),
JMESPathCheck(
'properties.httpSettings.forwardProxy.convention', 'Standard'),
JMESPathCheck(
'properties.globalValidation.redirectToProvider', 'Facebook'),
JMESPathCheck(
'properties.globalValidation.unauthenticatedClientAction', 'AllowAnonymous'),
JMESPathCheck(
'properties.identityProviders.azureActiveDirectory.registration.clientId', client_id),
JMESPathCheck('properties.identityProviders.azureActiveDirectory.registration.clientSecretSettingName',
"microsoft-provider-authentication-secret"),
JMESPathCheck(
'properties.identityProviders.azureActiveDirectory.registration.openIdIssuer', issuer),
])
self.cmd('containerapp show -g {} -n {}'.format(resource_group, app), checks=[
JMESPathCheck('properties.provisioningState', "Succeeded")
])
self.cmd('containerapp delete -g {} -n {} --yes'.format(resource_group,
app), expect_failure=False)
|
class ContainerAppAuthTest(ScenarioTest):
def __init__(self, *arg, **kwargs):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus")
def test_containerapp_auth_e2e(self, resource_group):
pass
| 5 | 0 | 39 | 6 | 33 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 2 | 81 | 12 | 69 | 11 | 64 | 0 | 22 | 10 | 19 | 1 | 1 | 0 | 2 |
11,041 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/containerapp/azext_containerapp/tests/latest/test_containerapp_arc_commands.py
|
azext_containerapp.tests.latest.test_containerapp_arc_commands.ContainerAppArcTest
|
class ContainerAppArcTest(ScenarioTest):
def __init__(self, *arg, **kwargs):
super().__init__(*arg, random_config_dir=True, **kwargs)
@AllowLargeResponse(8192)
def test_containerapp_arc_invalid_command(self):
with self.assertRaises(SystemExit) as cm:
self.cmd('containerapp arc setup-core-dns --yes')
self.assertNotEqual(cm.exception.code, 0)
with self.assertRaises(SystemExit) as cm:
self.cmd('containerapp arc setup-core-dns --distro Aks-Hci --yes')
self.assertNotEqual(cm.exception.code, 0)
@serial_test()
@live_only()
@ResourceGroupPreparer(location="southcentralus", random_name_length=15)
@ConnectedClusterPreparer(location="southcentralus", skip_connected_cluster=True)
def test_containerapp_arc_setup_core_dns_e2e(self, resource_group, connected_cluster_name):
self.cmd('containerapp arc setup-core-dns --distro AksAzureLocal --yes',
expect_failure=False)
|
class ContainerAppArcTest(ScenarioTest):
def __init__(self, *arg, **kwargs):
pass
@AllowLargeResponse(8192)
def test_containerapp_arc_invalid_command(self):
pass
@serial_test()
@live_only()
@ResourceGroupPreparer(location="southcentralus", random_name_length=15)
@ConnectedClusterPreparer(location="southcentralus", skip_connected_cluster=True)
def test_containerapp_arc_setup_core_dns_e2e(self, resource_group, connected_cluster_name):
pass
| 9 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 3 | 0 | 3 | 3 | 20 | 3 | 17 | 7 | 8 | 0 | 12 | 4 | 8 | 1 | 1 | 1 | 3 |
11,042 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/tests/latest/test_RunCommand_scenario.py
|
azext_connectedmachine.tests.latest.test_RunCommand_scenario.RunCommandScenarioTest
|
class RunCommandScenarioTest(ScenarioTest):
@live_only()
@ResourceGroupPreparer(name_prefix='cli_test_runcommand')
def test_run_command(self):
rand_string = 'test'
self.kwargs.update({
'machine': 'testmachine',
'rg': 'ytongtest',
'location': 'eastus',
'subscription': '00000000-0000-0000-0000-000000000000',
'runcommand': 'myRunCommand',
})
parameters_string = '''[{"name":"param1","value":"value1"}]'''
self.kwargs['parameters'] = json.dumps(parameters_string)
self.cmd('az connectedmachine run-command create '
'--resource-group "{rg}" '
'--location "{location}" '
'--script "Write-Host Hello World!" '
'--name "{runcommand}" '
'--machine-name "{machine}" '
'--parameters "{parameters}" '
'--subscription "{subscription}"',
checks=[
self.check(
'type', 'Microsoft.HybridCompute/machines/runcommands'),
self.check('instanceView.executionState', 'Succeeded')
])
self.cmd('az connectedmachine run-command list '
'--resource-group "{rg}" '
'--machine-name "{machine}"',
checks=[
self.check('length(@)', 1)
])
self.cmd('az connectedmachine run-command show '
'--resource-group "{rg}" '
'--name "{runcommand}" '
'--machine-name "{machine}"',
checks=[
self.check(
'type', 'Microsoft.HybridCompute/machines/runcommands'),
self.check('instanceView.executionState', 'Succeeded')
])
self.cmd('az connectedmachine run-command update '
'--resource-group "{rg}" '
'--name "{runcommand}" '
'--machine-name "{machine}" '
'--subscription "{subscription}" '
'--tags Tag1="Value1"',
checks=[
self.check(
'type', 'Microsoft.HybridCompute/machines/runcommands'),
self.check('instanceView.executionState', 'Succeeded')
])
self.cmd('az connectedmachine run-command delete '
'--resource-group "{rg}" '
'--name "{runcommand}" '
'--machine-name "{machine}" --yes',
checks=[])
|
class RunCommandScenarioTest(ScenarioTest):
@live_only()
@ResourceGroupPreparer(name_prefix='cli_test_runcommand')
def test_run_command(self):
pass
| 4 | 0 | 58 | 6 | 52 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 61 | 6 | 55 | 5 | 51 | 0 | 11 | 4 | 9 | 1 | 1 | 0 | 1 |
11,043 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.LinkedIntegrationRuntime
|
class LinkedIntegrationRuntime(_serialization.Model):
"""The linked integration runtime information.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar name: The name of the linked integration runtime.
:vartype name: str
:ivar subscription_id: The subscription ID for which the linked integration runtime belong to.
:vartype subscription_id: str
:ivar data_factory_name: The name of the data factory for which the linked integration runtime
belong to.
:vartype data_factory_name: str
:ivar data_factory_location: The location of the data factory for which the linked integration
runtime belong to.
:vartype data_factory_location: str
:ivar create_time: The creating time of the linked integration runtime.
:vartype create_time: ~datetime.datetime
"""
_validation = {
"name": {"readonly": True},
"subscription_id": {"readonly": True},
"data_factory_name": {"readonly": True},
"data_factory_location": {"readonly": True},
"create_time": {"readonly": True},
}
_attribute_map = {
"name": {"key": "name", "type": "str"},
"subscription_id": {"key": "subscriptionId", "type": "str"},
"data_factory_name": {"key": "dataFactoryName", "type": "str"},
"data_factory_location": {"key": "dataFactoryLocation", "type": "str"},
"create_time": {"key": "createTime", "type": "iso-8601"},
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.name = None
self.subscription_id = None
self.data_factory_name = None
self.data_factory_location = None
self.create_time = None
|
class LinkedIntegrationRuntime(_serialization.Model):
'''The linked integration runtime information.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar name: The name of the linked integration runtime.
:vartype name: str
:ivar subscription_id: The subscription ID for which the linked integration runtime belong to.
:vartype subscription_id: str
:ivar data_factory_name: The name of the data factory for which the linked integration runtime
belong to.
:vartype data_factory_name: str
:ivar data_factory_location: The location of the data factory for which the linked integration
runtime belong to.
:vartype data_factory_location: str
:ivar create_time: The creating time of the linked integration runtime.
:vartype create_time: ~datetime.datetime
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 8 | 0 | 7 | 1 | 1 | 0.73 | 1 | 2 | 0 | 0 | 1 | 5 | 1 | 16 | 43 | 5 | 22 | 9 | 20 | 16 | 10 | 9 | 8 | 1 | 2 | 0 | 1 |
11,044 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.LinkedIntegrationRuntimeKeyAuthorization
|
class LinkedIntegrationRuntimeKeyAuthorization(LinkedIntegrationRuntimeType):
"""The key authorization type integration runtime.
All required parameters must be populated in order to send to server.
:ivar authorization_type: The authorization type for integration runtime sharing. Required.
:vartype authorization_type: str
:ivar key: The key used for authorization. Required.
:vartype key: ~azure.mgmt.datafactory.models.SecureString
"""
_validation = {
"authorization_type": {"required": True},
"key": {"required": True},
}
_attribute_map = {
"authorization_type": {"key": "authorizationType", "type": "str"},
"key": {"key": "key", "type": "SecureString"},
}
def __init__(self, *, key: "_models.SecureString", **kwargs: Any) -> None:
"""
:keyword key: The key used for authorization. Required.
:paramtype key: ~azure.mgmt.datafactory.models.SecureString
"""
super().__init__(**kwargs)
self.authorization_type: str = "Key"
self.key = key
|
class LinkedIntegrationRuntimeKeyAuthorization(LinkedIntegrationRuntimeType):
'''The key authorization type integration runtime.
All required parameters must be populated in order to send to server.
:ivar authorization_type: The authorization type for integration runtime sharing. Required.
:vartype authorization_type: str
:ivar key: The key used for authorization. Required.
:vartype key: ~azure.mgmt.datafactory.models.SecureString
'''
def __init__(self, *, key: "_models.SecureString", **kwargs: Any) -> None:
'''
:keyword key: The key used for authorization. Required.
:paramtype key: ~azure.mgmt.datafactory.models.SecureString
'''
pass
| 2 | 2 | 8 | 0 | 4 | 4 | 1 | 0.85 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 17 | 29 | 5 | 13 | 6 | 11 | 11 | 7 | 6 | 5 | 1 | 3 | 0 | 1 |
11,045 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.LinkedIntegrationRuntimeRbacAuthorization
|
class LinkedIntegrationRuntimeRbacAuthorization(LinkedIntegrationRuntimeType): # pylint: disable=name-too-long
"""The role based access control (RBAC) authorization type integration runtime.
All required parameters must be populated in order to send to server.
:ivar authorization_type: The authorization type for integration runtime sharing. Required.
:vartype authorization_type: str
:ivar resource_id: The resource identifier of the integration runtime to be shared. Required.
:vartype resource_id: str
:ivar credential: The credential reference containing authentication information.
:vartype credential: ~azure.mgmt.datafactory.models.CredentialReference
"""
_validation = {
"authorization_type": {"required": True},
"resource_id": {"required": True},
}
_attribute_map = {
"authorization_type": {"key": "authorizationType", "type": "str"},
"resource_id": {"key": "resourceId", "type": "str"},
"credential": {"key": "credential", "type": "CredentialReference"},
}
def __init__(
self, *, resource_id: str, credential: Optional["_models.CredentialReference"] = None, **kwargs: Any
) -> None:
"""
:keyword resource_id: The resource identifier of the integration runtime to be shared.
Required.
:paramtype resource_id: str
:keyword credential: The credential reference containing authentication information.
:paramtype credential: ~azure.mgmt.datafactory.models.CredentialReference
"""
super().__init__(**kwargs)
self.authorization_type: str = "RBAC"
self.resource_id = resource_id
self.credential = credential
|
class LinkedIntegrationRuntimeRbacAuthorization(LinkedIntegrationRuntimeType):
'''The role based access control (RBAC) authorization type integration runtime.
All required parameters must be populated in order to send to server.
:ivar authorization_type: The authorization type for integration runtime sharing. Required.
:vartype authorization_type: str
:ivar resource_id: The resource identifier of the integration runtime to be shared. Required.
:vartype resource_id: str
:ivar credential: The credential reference containing authentication information.
:vartype credential: ~azure.mgmt.datafactory.models.CredentialReference
'''
def __init__(
self, *, resource_id: str, credential: Optional["_models.CredentialReference"] = None, **kwargs: Any
) -> None:
'''
:keyword resource_id: The resource identifier of the integration runtime to be shared.
Required.
:paramtype resource_id: str
:keyword credential: The credential reference containing authentication information.
:paramtype credential: ~azure.mgmt.datafactory.models.CredentialReference
'''
pass
| 2 | 2 | 14 | 0 | 7 | 7 | 1 | 1 | 1 | 3 | 0 | 0 | 1 | 3 | 1 | 17 | 38 | 5 | 17 | 9 | 13 | 17 | 8 | 7 | 6 | 1 | 3 | 0 | 1 |
11,046 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.LinkedIntegrationRuntimeRequest
|
class LinkedIntegrationRuntimeRequest(_serialization.Model):
"""Data factory name for linked integration runtime request.
All required parameters must be populated in order to send to server.
:ivar linked_factory_name: The data factory name for linked integration runtime. Required.
:vartype linked_factory_name: str
"""
_validation = {
"linked_factory_name": {"required": True},
}
_attribute_map = {
"linked_factory_name": {"key": "factoryName", "type": "str"},
}
def __init__(self, *, linked_factory_name: str, **kwargs: Any) -> None:
"""
:keyword linked_factory_name: The data factory name for linked integration runtime. Required.
:paramtype linked_factory_name: str
"""
super().__init__(**kwargs)
self.linked_factory_name = linked_factory_name
|
class LinkedIntegrationRuntimeRequest(_serialization.Model):
'''Data factory name for linked integration runtime request.
All required parameters must be populated in order to send to server.
:ivar linked_factory_name: The data factory name for linked integration runtime. Required.
:vartype linked_factory_name: str
'''
def __init__(self, *, linked_factory_name: str, **kwargs: Any) -> None:
'''
:keyword linked_factory_name: The data factory name for linked integration runtime. Required.
:paramtype linked_factory_name: str
'''
pass
| 2 | 2 | 7 | 0 | 3 | 4 | 1 | 0.9 | 1 | 3 | 0 | 0 | 1 | 1 | 1 | 16 | 24 | 5 | 10 | 5 | 8 | 9 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
11,047 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.LinkedIntegrationRuntimeType
|
class LinkedIntegrationRuntimeType(_serialization.Model):
"""The base definition of a linked integration runtime.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
LinkedIntegrationRuntimeKeyAuthorization, LinkedIntegrationRuntimeRbacAuthorization
All required parameters must be populated in order to send to server.
:ivar authorization_type: The authorization type for integration runtime sharing. Required.
:vartype authorization_type: str
"""
_validation = {
"authorization_type": {"required": True},
}
_attribute_map = {
"authorization_type": {"key": "authorizationType", "type": "str"},
}
_subtype_map = {
"authorization_type": {
"Key": "LinkedIntegrationRuntimeKeyAuthorization",
"RBAC": "LinkedIntegrationRuntimeRbacAuthorization",
}
}
def __init__(self, **kwargs: Any) -> None:
""" """
super().__init__(**kwargs)
self.authorization_type: Optional[str] = None
|
class LinkedIntegrationRuntimeType(_serialization.Model):
'''The base definition of a linked integration runtime.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
LinkedIntegrationRuntimeKeyAuthorization, LinkedIntegrationRuntimeRbacAuthorization
All required parameters must be populated in order to send to server.
:ivar authorization_type: The authorization type for integration runtime sharing. Required.
:vartype authorization_type: str
'''
def __init__(self, **kwargs: Any) -> None:
''' '''
pass
| 2 | 2 | 4 | 0 | 3 | 1 | 1 | 0.5 | 1 | 3 | 0 | 2 | 1 | 1 | 1 | 16 | 31 | 7 | 16 | 6 | 14 | 8 | 7 | 6 | 5 | 1 | 2 | 0 | 1 |
11,048 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.LinkedServiceDebugResource
|
class LinkedServiceDebugResource(SubResourceDebugResource):
"""Linked service debug resource.
All required parameters must be populated in order to send to server.
:ivar name: The resource name.
:vartype name: str
:ivar properties: Properties of linked service. Required.
:vartype properties: ~azure.mgmt.datafactory.models.LinkedService
"""
_validation = {
"properties": {"required": True},
}
_attribute_map = {
"name": {"key": "name", "type": "str"},
"properties": {"key": "properties", "type": "LinkedService"},
}
def __init__(self, *, properties: "_models.LinkedService", name: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword name: The resource name.
:paramtype name: str
:keyword properties: Properties of linked service. Required.
:paramtype properties: ~azure.mgmt.datafactory.models.LinkedService
"""
super().__init__(name=name, **kwargs)
self.properties = properties
|
class LinkedServiceDebugResource(SubResourceDebugResource):
'''Linked service debug resource.
All required parameters must be populated in order to send to server.
:ivar name: The resource name.
:vartype name: str
:ivar properties: Properties of linked service. Required.
:vartype properties: ~azure.mgmt.datafactory.models.LinkedService
'''
def __init__(self, *, properties: "_models.LinkedService", name: Optional[str] = None, **kwargs: Any) -> None:
'''
:keyword name: The resource name.
:paramtype name: str
:keyword properties: Properties of linked service. Required.
:paramtype properties: ~azure.mgmt.datafactory.models.LinkedService
'''
pass
| 2 | 2 | 9 | 0 | 3 | 6 | 1 | 1.18 | 1 | 3 | 0 | 0 | 1 | 1 | 1 | 17 | 29 | 5 | 11 | 5 | 9 | 13 | 6 | 5 | 4 | 1 | 3 | 0 | 1 |
11,049 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_link_scope._update.Update.PrivateLinkScopesGet
|
class PrivateLinkScopesGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"scopeName", self.ctx.args.scope_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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()
_UpdateHelper._build_schema_hybrid_compute_private_link_scope_read(
cls._schema_on_200)
return cls._schema_on_200
|
class PrivateLinkScopesGet(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
| 17 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 82 | 13 | 69 | 25 | 52 | 0 | 33 | 18 | 23 | 2 | 1 | 1 | 11 |
11,050 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_link_scope._update.Update.PrivateLinkScopesCreateOrUpdate
|
class PrivateLinkScopesCreateOrUpdate(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 [200, 201]:
return self.on_200_201(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"scopeName", self.ctx.args.scope_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
value=self.ctx.vars.instance,
)
return self.serialize_content(_content_value)
def on_200_201(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200_201
)
_schema_on_200_201 = None
@classmethod
def _build_schema_on_200_201(cls):
if cls._schema_on_200_201 is not None:
return cls._schema_on_200_201
cls._schema_on_200_201 = AAZObjectType()
_UpdateHelper._build_schema_hybrid_compute_private_link_scope_read(
cls._schema_on_200_201)
return cls._schema_on_200_201
|
class PrivateLinkScopesCreateOrUpdate(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
@property
def content(self):
pass
def on_200_201(self, session):
pass
@classmethod
def _build_schema_on_200_201(cls):
pass
| 19 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 9 | 0 | 10 | 10 | 94 | 15 | 79 | 28 | 60 | 0 | 36 | 20 | 25 | 2 | 1 | 1 | 12 |
11,051 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_link_scope._update.Update.InstanceUpdateByJson
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
self._update_instance(self.ctx.vars.instance)
def _update_instance(self, instance):
_instance_value, _builder = self.new_content_builder(
self.ctx.args,
value=instance,
typ=AAZObjectType
)
_builder.set_prop("properties", AAZObjectType)
_builder.set_prop("tags", AAZDictType, ".tags")
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("publicNetworkAccess",
AAZStrType, ".public_network_access")
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return _instance_value
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
pass
def _update_instance(self, instance):
pass
| 3 | 0 | 10 | 2 | 9 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 23 | 5 | 18 | 6 | 15 | 0 | 14 | 6 | 11 | 3 | 1 | 1 | 4 |
11,052 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license_profile/_delete.py
|
azext_connectedmachine.aaz.latest.connectedmachine.license_profile._delete.Delete.LicenseProfilesDelete
|
class LicenseProfilesDelete(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_201,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [204]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_204,
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, 201]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
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(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}",
**self.url_parameters
)
@property
def method(self):
return "DELETE"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"licenseProfileName", self.ctx.args.license_profile_name,
required=True,
),
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
def on_204(self, session):
pass
def on_200_201(self, session):
pass
|
class LicenseProfilesDelete(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
def on_204(self, session):
pass
def on_200_201(self, session):
pass
| 14 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 1 | 8 | 8 | 88 | 9 | 79 | 20 | 65 | 0 | 28 | 14 | 19 | 4 | 1 | 1 | 11 |
11,053 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license_profile/_create.py
|
azext_connectedmachine.aaz.latest.connectedmachine.license_profile._create.Create.LicenseProfilesCreateOrUpdate
|
class LicenseProfilesCreateOrUpdate(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_201,
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, 201]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
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(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"licenseProfileName", self.ctx.args.license_profile_name,
required=True,
),
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={
"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={
"flags": {"required": True}})
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
_builder.set_prop("tags", AAZDictType, ".tags")
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("esuProfile", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
properties.set_prop("productProfile", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
properties.set_prop("softwareAssurance", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
esu_profile = _builder.get(".properties.esuProfile")
if esu_profile is not None:
esu_profile.set_prop(
"assignedLicense", AAZStrType, ".assigned_license")
product_profile = _builder.get(".properties.productProfile")
if product_profile is not None:
product_profile.set_prop(
"productFeatures", AAZListType, ".product_features")
product_profile.set_prop(
"productType", AAZStrType, ".product_type")
product_profile.set_prop(
"subscriptionStatus", AAZStrType, ".subscription_status")
product_features = _builder.get(
".properties.productProfile.productFeatures")
if product_features is not None:
product_features.set_elements(AAZObjectType, ".")
_elements = _builder.get(
".properties.productProfile.productFeatures[]")
if _elements is not None:
_elements.set_prop("name", AAZStrType, ".name")
_elements.set_prop("subscriptionStatus",
AAZStrType, ".subscription_status")
software_assurance = _builder.get(".properties.softwareAssurance")
if software_assurance is not None:
software_assurance.set_prop(
"softwareAssuranceCustomer", AAZBoolType, ".software_assurance_customer")
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return self.serialize_content(_content_value)
def on_200_201(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200_201
)
_schema_on_200_201 = None
@classmethod
def _build_schema_on_200_201(cls):
if cls._schema_on_200_201 is not None:
return cls._schema_on_200_201
cls._schema_on_200_201 = AAZObjectType()
_schema_on_200_201 = cls._schema_on_200_201
_schema_on_200_201.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.location = AAZStrType(
flags={"required": True},
)
_schema_on_200_201.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200_201.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200_201.tags = AAZDictType()
_schema_on_200_201.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200_201.properties
properties.esu_profile = AAZObjectType(
serialized_name="esuProfile",
flags={"client_flatten": True},
)
properties.product_profile = AAZObjectType(
serialized_name="productProfile",
flags={"client_flatten": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.software_assurance = AAZObjectType(
serialized_name="softwareAssurance",
flags={"client_flatten": True},
)
esu_profile = cls._schema_on_200_201.properties.esu_profile
esu_profile.assigned_license = AAZStrType(
serialized_name="assignedLicense",
)
esu_profile.assigned_license_immutable_id = AAZStrType(
serialized_name="assignedLicenseImmutableId",
flags={"read_only": True},
)
esu_profile.esu_eligibility = AAZStrType(
serialized_name="esuEligibility",
flags={"read_only": True},
)
esu_profile.esu_key_state = AAZStrType(
serialized_name="esuKeyState",
flags={"read_only": True},
)
esu_profile.esu_keys = AAZListType(
serialized_name="esuKeys",
flags={"read_only": True},
)
esu_profile.server_type = AAZStrType(
serialized_name="serverType",
flags={"read_only": True},
)
esu_keys = cls._schema_on_200_201.properties.esu_profile.esu_keys
esu_keys.Element = AAZObjectType()
_element = cls._schema_on_200_201.properties.esu_profile.esu_keys.Element
_element.license_status = AAZIntType(
serialized_name="licenseStatus",
)
_element.sku = AAZStrType()
product_profile = cls._schema_on_200_201.properties.product_profile
product_profile.billing_end_date = AAZStrType(
serialized_name="billingEndDate",
flags={"read_only": True},
)
product_profile.billing_start_date = AAZStrType(
serialized_name="billingStartDate",
flags={"read_only": True},
)
product_profile.disenrollment_date = AAZStrType(
serialized_name="disenrollmentDate",
flags={"read_only": True},
)
product_profile.enrollment_date = AAZStrType(
serialized_name="enrollmentDate",
flags={"read_only": True},
)
product_profile.error = AAZObjectType(
flags={"read_only": True},
)
_CreateHelper._build_schema_error_detail_read(
product_profile.error)
product_profile.product_features = AAZListType(
serialized_name="productFeatures",
)
product_profile.product_type = AAZStrType(
serialized_name="productType",
)
product_profile.subscription_status = AAZStrType(
serialized_name="subscriptionStatus",
)
product_features = cls._schema_on_200_201.properties.product_profile.product_features
product_features.Element = AAZObjectType()
_element = cls._schema_on_200_201.properties.product_profile.product_features.Element
_element.billing_end_date = AAZStrType(
serialized_name="billingEndDate",
flags={"read_only": True},
)
_element.billing_start_date = AAZStrType(
serialized_name="billingStartDate",
flags={"read_only": True},
)
_element.disenrollment_date = AAZStrType(
serialized_name="disenrollmentDate",
flags={"read_only": True},
)
_element.enrollment_date = AAZStrType(
serialized_name="enrollmentDate",
flags={"read_only": True},
)
_element.error = AAZObjectType(
flags={"read_only": True},
)
_CreateHelper._build_schema_error_detail_read(_element.error)
_element.name = AAZStrType()
_element.subscription_status = AAZStrType(
serialized_name="subscriptionStatus",
)
software_assurance = cls._schema_on_200_201.properties.software_assurance
software_assurance.software_assurance_customer = AAZBoolType(
serialized_name="softwareAssuranceCustomer",
)
system_data = cls._schema_on_200_201.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200_201.tags
tags.Element = AAZStrType()
return cls._schema_on_200_201
|
class LicenseProfilesCreateOrUpdate(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
@property
def content(self):
pass
def on_200_201(self, session):
pass
@classmethod
def _build_schema_on_200_201(cls):
pass
| 19 | 0 | 29 | 2 | 27 | 0 | 2 | 0 | 1 | 1 | 1 | 0 | 9 | 1 | 10 | 10 | 312 | 33 | 279 | 46 | 260 | 0 | 123 | 37 | 112 | 8 | 1 | 1 | 20 |
11,054 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license/_wait.py
|
azext_connectedmachine.aaz.latest.connectedmachine.license._wait.Wait.LicensesGet
|
class LicensesGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"licenseName", self.ctx.args.license_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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(
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType(
flags={"required": True},
)
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.license_details = AAZObjectType(
serialized_name="licenseDetails",
)
properties.license_type = AAZStrType(
serialized_name="licenseType",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.tenant_id = AAZStrType(
serialized_name="tenantId",
)
license_details = cls._schema_on_200.properties.license_details
license_details.assigned_licenses = AAZIntType(
serialized_name="assignedLicenses",
flags={"read_only": True},
)
license_details.edition = AAZStrType()
license_details.immutable_id = AAZStrType(
serialized_name="immutableId",
flags={"read_only": True},
)
license_details.processors = AAZIntType()
license_details.state = AAZStrType()
license_details.target = AAZStrType()
license_details.type = AAZStrType()
license_details.volume_license_details = AAZListType(
serialized_name="volumeLicenseDetails",
)
volume_license_details = cls._schema_on_200.properties.license_details.volume_license_details
volume_license_details.Element = AAZObjectType()
_element = cls._schema_on_200.properties.license_details.volume_license_details.Element
_element.invoice_id = AAZStrType(
serialized_name="invoiceId",
)
_element.program_year = AAZStrType(
serialized_name="programYear",
)
system_data = cls._schema_on_200.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class LicensesGet(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
| 17 | 0 | 17 | 1 | 16 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 170 | 20 | 150 | 32 | 133 | 0 | 68 | 25 | 58 | 2 | 1 | 1 | 11 |
11,055 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.license._update.Update.LicensesGet
|
class LicensesGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"licenseName", self.ctx.args.license_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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()
_UpdateHelper._build_schema_license_read(cls._schema_on_200)
return cls._schema_on_200
|
class LicensesGet(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
| 17 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 82 | 13 | 69 | 25 | 52 | 0 | 33 | 18 | 23 | 2 | 1 | 1 | 11 |
11,056 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.license._update.Update.LicensesCreateOrUpdate
|
class LicensesCreateOrUpdate(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(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"licenseName", self.ctx.args.license_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
value=self.ctx.vars.instance,
)
return self.serialize_content(_content_value)
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()
_UpdateHelper._build_schema_license_read(cls._schema_on_200)
return cls._schema_on_200
|
class LicensesCreateOrUpdate(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
@property
def content(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 19 | 0 | 9 | 0 | 8 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 9 | 1 | 10 | 10 | 110 | 15 | 95 | 29 | 76 | 0 | 38 | 20 | 27 | 3 | 1 | 1 | 13 |
11,057 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.license._update.Update.InstanceUpdateByJson
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
self._update_instance(self.ctx.vars.instance)
def _update_instance(self, instance):
_instance_value, _builder = self.new_content_builder(
self.ctx.args,
value=instance,
typ=AAZObjectType
)
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
_builder.set_prop("tags", AAZDictType, ".tags")
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("licenseDetails", AAZObjectType)
properties.set_prop("licenseType", AAZStrType, ".license_type")
properties.set_prop("tenantId", AAZStrType, ".tenant_id")
license_details = _builder.get(".properties.licenseDetails")
if license_details is not None:
license_details.set_prop("edition", AAZStrType, ".edition")
license_details.set_prop(
"processors", AAZIntType, ".processors")
license_details.set_prop("state", AAZStrType, ".state")
license_details.set_prop("target", AAZStrType, ".target")
license_details.set_prop("type", AAZStrType, ".type")
license_details.set_prop(
"volumeLicenseDetails", AAZListType, ".volume_license_details")
volume_license_details = _builder.get(
".properties.licenseDetails.volumeLicenseDetails")
if volume_license_details is not None:
volume_license_details.set_elements(AAZObjectType, ".")
_elements = _builder.get(
".properties.licenseDetails.volumeLicenseDetails[]")
if _elements is not None:
_elements.set_prop("invoiceId", AAZStrType, ".invoice_id")
_elements.set_prop("programYear", AAZStrType, ".program_year")
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return _instance_value
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
pass
def _update_instance(self, instance):
pass
| 3 | 0 | 20 | 3 | 17 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 43 | 8 | 35 | 9 | 32 | 0 | 31 | 9 | 28 | 6 | 1 | 1 | 7 |
11,058 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license/_list.py
|
azext_connectedmachine.aaz.latest.connectedmachine.license._list.List.LicensesListBySubscription
|
class LicensesListBySubscription(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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.next_link = AAZStrType(
serialized_name="nextLink",
)
_schema_on_200.value = AAZListType(
flags={"required": True},
)
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.location = AAZStrType(
flags={"required": True},
)
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType(
flags={"client_flatten": True},
)
_element.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_element.tags = AAZDictType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.license_details = AAZObjectType(
serialized_name="licenseDetails",
)
properties.license_type = AAZStrType(
serialized_name="licenseType",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.tenant_id = AAZStrType(
serialized_name="tenantId",
)
license_details = cls._schema_on_200.value.Element.properties.license_details
license_details.assigned_licenses = AAZIntType(
serialized_name="assignedLicenses",
flags={"read_only": True},
)
license_details.edition = AAZStrType()
license_details.immutable_id = AAZStrType(
serialized_name="immutableId",
flags={"read_only": True},
)
license_details.processors = AAZIntType()
license_details.state = AAZStrType()
license_details.target = AAZStrType()
license_details.type = AAZStrType()
license_details.volume_license_details = AAZListType(
serialized_name="volumeLicenseDetails",
)
volume_license_details = cls._schema_on_200.value.Element.properties.license_details.volume_license_details
volume_license_details.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element.properties.license_details.volume_license_details.Element
_element.invoice_id = AAZStrType(
serialized_name="invoiceId",
)
_element.program_year = AAZStrType(
serialized_name="programYear",
)
system_data = cls._schema_on_200.value.Element.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200.value.Element.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class LicensesListBySubscription(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
| 17 | 0 | 17 | 1 | 16 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 173 | 22 | 151 | 33 | 134 | 0 | 73 | 26 | 63 | 2 | 1 | 1 | 11 |
11,059 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license/_delete.py
|
azext_connectedmachine.aaz.latest.connectedmachine.license._delete.Delete.LicensesDelete
|
class LicensesDelete(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,
)
if session.http_response.status_code in [204]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_204,
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(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}",
**self.url_parameters
)
@property
def method(self):
return "DELETE"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"licenseName", self.ctx.args.license_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
def on_200(self, session):
pass
def on_204(self, session):
pass
|
class LicensesDelete(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
def on_200(self, session):
pass
def on_204(self, session):
pass
| 14 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 1 | 8 | 8 | 84 | 9 | 75 | 20 | 61 | 0 | 28 | 14 | 19 | 4 | 1 | 1 | 11 |
11,060 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license/_create.py
|
azext_connectedmachine.aaz.latest.connectedmachine.license._create.Create.LicensesCreateOrUpdate
|
class LicensesCreateOrUpdate(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(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"licenseName", self.ctx.args.license_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={
"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={
"flags": {"required": True}})
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
_builder.set_prop("tags", AAZDictType, ".tags")
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("licenseDetails", AAZObjectType)
properties.set_prop("licenseType", AAZStrType, ".license_type")
properties.set_prop("tenantId", AAZStrType, ".tenant_id")
license_details = _builder.get(".properties.licenseDetails")
if license_details is not None:
license_details.set_prop("edition", AAZStrType, ".edition")
license_details.set_prop(
"processors", AAZIntType, ".processors")
license_details.set_prop("state", AAZStrType, ".state")
license_details.set_prop("target", AAZStrType, ".target")
license_details.set_prop("type", AAZStrType, ".type")
license_details.set_prop(
"volumeLicenseDetails", AAZListType, ".volume_license_details")
volume_license_details = _builder.get(
".properties.licenseDetails.volumeLicenseDetails")
if volume_license_details is not None:
volume_license_details.set_elements(AAZObjectType, ".")
_elements = _builder.get(
".properties.licenseDetails.volumeLicenseDetails[]")
if _elements is not None:
_elements.set_prop("invoiceId", AAZStrType, ".invoice_id")
_elements.set_prop("programYear", AAZStrType, ".program_year")
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return self.serialize_content(_content_value)
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(
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType(
flags={"required": True},
)
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.license_details = AAZObjectType(
serialized_name="licenseDetails",
)
properties.license_type = AAZStrType(
serialized_name="licenseType",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.tenant_id = AAZStrType(
serialized_name="tenantId",
)
license_details = cls._schema_on_200.properties.license_details
license_details.assigned_licenses = AAZIntType(
serialized_name="assignedLicenses",
flags={"read_only": True},
)
license_details.edition = AAZStrType()
license_details.immutable_id = AAZStrType(
serialized_name="immutableId",
flags={"read_only": True},
)
license_details.processors = AAZIntType()
license_details.state = AAZStrType()
license_details.target = AAZStrType()
license_details.type = AAZStrType()
license_details.volume_license_details = AAZListType(
serialized_name="volumeLicenseDetails",
)
volume_license_details = cls._schema_on_200.properties.license_details.volume_license_details
volume_license_details.Element = AAZObjectType()
_element = cls._schema_on_200.properties.license_details.volume_license_details.Element
_element.invoice_id = AAZStrType(
serialized_name="invoiceId",
)
_element.program_year = AAZStrType(
serialized_name="programYear",
)
system_data = cls._schema_on_200.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class LicensesCreateOrUpdate(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
@property
def content(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 19 | 0 | 21 | 2 | 19 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 9 | 1 | 10 | 10 | 230 | 27 | 203 | 41 | 184 | 0 | 99 | 32 | 88 | 6 | 1 | 1 | 18 |
11,061 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/image/_show.py
|
azext_connectedmachine.aaz.latest.connectedmachine.extension.image._show.Show.ExtensionMetadataGet
|
class ExtensionMetadataGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"extensionType", self.ctx.args.extension_type,
required=True,
),
**self.serialize_url_param(
"location", self.ctx.args.location,
required=True,
),
**self.serialize_url_param(
"publisher", self.ctx.args.publisher,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
**self.serialize_url_param(
"version", self.ctx.args.version,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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(
flags={"read_only": True},
)
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.extension_type = AAZStrType(
serialized_name="extensionType",
flags={"read_only": True},
)
properties.publisher = AAZStrType(
flags={"read_only": True},
)
properties.version = AAZStrType(
flags={"read_only": True},
)
system_data = cls._schema_on_200.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
return cls._schema_on_200
|
class ExtensionMetadataGet(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
| 17 | 0 | 13 | 1 | 13 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 139 | 16 | 123 | 28 | 106 | 0 | 49 | 21 | 39 | 2 | 1 | 1 | 11 |
11,062 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/image/_list.py
|
azext_connectedmachine.aaz.latest.connectedmachine.extension.image._list.List.ExtensionMetadataList
|
class ExtensionMetadataList(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"extensionType", self.ctx.args.extension_type,
required=True,
),
**self.serialize_url_param(
"location", self.ctx.args.location,
required=True,
),
**self.serialize_url_param(
"publisher", self.ctx.args.publisher,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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.value = AAZListType(
flags={"read_only": True},
)
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType(
flags={"client_flatten": True},
)
_element.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.extension_type = AAZStrType(
serialized_name="extensionType",
flags={"read_only": True},
)
properties.publisher = AAZStrType(
flags={"read_only": True},
)
properties.version = AAZStrType(
flags={"read_only": True},
)
system_data = cls._schema_on_200.value.Element.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
return cls._schema_on_200
|
class ExtensionMetadataList(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
| 17 | 0 | 14 | 1 | 13 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 143 | 18 | 125 | 30 | 108 | 0 | 53 | 23 | 43 | 2 | 1 | 1 | 11 |
11,063 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_wait.py
|
azext_connectedmachine.aaz.latest.connectedmachine.extension._wait.Wait.MachineExtensionsGet
|
class MachineExtensionsGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"extensionName", self.ctx.args.extension_name,
required=True,
),
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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(
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType(
flags={"required": True},
)
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType()
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.auto_upgrade_minor_version = AAZBoolType(
serialized_name="autoUpgradeMinorVersion",
)
properties.enable_automatic_upgrade = AAZBoolType(
serialized_name="enableAutomaticUpgrade",
)
properties.force_update_tag = AAZStrType(
serialized_name="forceUpdateTag",
)
properties.instance_view = AAZObjectType(
serialized_name="instanceView",
)
properties.protected_settings = AAZFreeFormDictType(
serialized_name="protectedSettings",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.publisher = AAZStrType()
properties.settings = AAZFreeFormDictType()
properties.type = AAZStrType()
properties.type_handler_version = AAZStrType(
serialized_name="typeHandlerVersion",
)
instance_view = cls._schema_on_200.properties.instance_view
instance_view.name = AAZStrType()
instance_view.status = AAZObjectType()
instance_view.type = AAZStrType()
instance_view.type_handler_version = AAZStrType(
serialized_name="typeHandlerVersion",
)
status = cls._schema_on_200.properties.instance_view.status
status.code = AAZStrType()
status.display_status = AAZStrType(
serialized_name="displayStatus",
)
status.level = AAZStrType()
status.message = AAZStrType()
status.time = AAZStrType()
system_data = cls._schema_on_200.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class MachineExtensionsGet(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
| 17 | 0 | 17 | 1 | 16 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 172 | 19 | 153 | 31 | 136 | 0 | 71 | 24 | 61 | 2 | 1 | 1 | 11 |
11,064 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.extension._update.Update.MachineExtensionsGet
|
class MachineExtensionsGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"extensionName", self.ctx.args.extension_name,
required=True,
),
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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()
_UpdateHelper._build_schema_machine_extension_read(
cls._schema_on_200)
return cls._schema_on_200
|
class MachineExtensionsGet(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
| 17 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 86 | 13 | 73 | 25 | 56 | 0 | 33 | 18 | 23 | 2 | 1 | 1 | 11 |
11,065 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.extension._update.Update.MachineExtensionsCreateOrUpdate
|
class MachineExtensionsCreateOrUpdate(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(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"extensionName", self.ctx.args.extension_name,
required=True,
),
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
value=self.ctx.vars.instance,
)
return self.serialize_content(_content_value)
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()
_UpdateHelper._build_schema_machine_extension_read(
cls._schema_on_200)
return cls._schema_on_200
|
class MachineExtensionsCreateOrUpdate(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
@property
def content(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 19 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 9 | 1 | 10 | 10 | 114 | 15 | 99 | 29 | 80 | 0 | 38 | 20 | 27 | 3 | 1 | 1 | 13 |
11,066 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.extension._update.Update.InstanceUpdateByJson
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
self._update_instance(self.ctx.vars.instance)
def _update_instance(self, instance):
_instance_value, _builder = self.new_content_builder(
self.ctx.args,
value=instance,
typ=AAZObjectType
)
_builder.set_prop("properties", AAZObjectType)
_builder.set_prop("tags", AAZDictType, ".tags")
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("autoUpgradeMinorVersion",
AAZBoolType, ".auto_upgrade_minor_version")
properties.set_prop("enableAutomaticUpgrade",
AAZBoolType, ".enable_automatic_upgrade")
properties.set_prop(
"forceUpdateTag", AAZStrType, ".force_update_tag")
properties.set_prop(
"instanceView", AAZObjectType, ".instance_view")
properties.set_prop("protectedSettings",
AAZFreeFormDictType, ".protected_settings")
properties.set_prop("publisher", AAZStrType, ".publisher")
properties.set_prop(
"settings", AAZFreeFormDictType, ".settings")
properties.set_prop("type", AAZStrType, ".type")
properties.set_prop("typeHandlerVersion",
AAZStrType, ".type_handler_version")
instance_view = _builder.get(".properties.instanceView")
if instance_view is not None:
instance_view.set_prop("name", AAZStrType, ".name")
instance_view.set_prop("status", AAZObjectType, ".status")
instance_view.set_prop("type", AAZStrType, ".type")
instance_view.set_prop(
"typeHandlerVersion", AAZStrType, ".type_handler_version")
status = _builder.get(".properties.instanceView.status")
if status is not None:
status.set_prop("code", AAZStrType, ".code")
status.set_prop("displayStatus", AAZStrType, ".display_status")
status.set_prop("level", AAZStrType, ".level")
status.set_prop("message", AAZStrType, ".message")
status.set_prop("time", AAZStrType, ".time")
protected_settings = _builder.get(".properties.protectedSettings")
if protected_settings is not None:
protected_settings.set_anytype_elements(".")
settings = _builder.get(".properties.settings")
if settings is not None:
settings.set_anytype_elements(".")
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return _instance_value
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
pass
def _update_instance(self, instance):
pass
| 3 | 0 | 26 | 4 | 22 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 54 | 9 | 45 | 10 | 42 | 0 | 41 | 10 | 38 | 7 | 1 | 1 | 8 |
11,067 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_list.py
|
azext_connectedmachine.aaz.latest.connectedmachine.extension._list.List.MachineExtensionsList
|
class MachineExtensionsList(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"$expand", self.ctx.args.expand,
),
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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.next_link = AAZStrType(
serialized_name="nextLink",
)
_schema_on_200.value = AAZListType()
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.location = AAZStrType(
flags={"required": True},
)
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType()
_element.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_element.tags = AAZDictType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.auto_upgrade_minor_version = AAZBoolType(
serialized_name="autoUpgradeMinorVersion",
)
properties.enable_automatic_upgrade = AAZBoolType(
serialized_name="enableAutomaticUpgrade",
)
properties.force_update_tag = AAZStrType(
serialized_name="forceUpdateTag",
)
properties.instance_view = AAZObjectType(
serialized_name="instanceView",
)
properties.protected_settings = AAZFreeFormDictType(
serialized_name="protectedSettings",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.publisher = AAZStrType()
properties.settings = AAZFreeFormDictType()
properties.type = AAZStrType()
properties.type_handler_version = AAZStrType(
serialized_name="typeHandlerVersion",
)
instance_view = cls._schema_on_200.value.Element.properties.instance_view
instance_view.name = AAZStrType()
instance_view.status = AAZObjectType()
instance_view.type = AAZStrType()
instance_view.type_handler_version = AAZStrType(
serialized_name="typeHandlerVersion",
)
status = cls._schema_on_200.value.Element.properties.instance_view.status
status.code = AAZStrType()
status.display_status = AAZStrType(
serialized_name="displayStatus",
)
status.level = AAZStrType()
status.message = AAZStrType()
status.time = AAZStrType()
system_data = cls._schema_on_200.value.Element.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200.value.Element.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class MachineExtensionsList(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
| 17 | 0 | 18 | 1 | 17 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 180 | 21 | 159 | 33 | 142 | 0 | 76 | 26 | 66 | 2 | 1 | 1 | 11 |
11,068 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/extension/_delete.py
|
azext_connectedmachine.aaz.latest.connectedmachine.extension._delete.Delete.MachineExtensionsDelete
|
class MachineExtensionsDelete(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,
)
if session.http_response.status_code in [204]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_204,
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(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}",
**self.url_parameters
)
@property
def method(self):
return "DELETE"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"extensionName", self.ctx.args.extension_name,
required=True,
),
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
def on_200(self, session):
pass
def on_204(self, session):
pass
|
class MachineExtensionsDelete(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
def on_200(self, session):
pass
def on_204(self, session):
pass
| 14 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 1 | 8 | 8 | 88 | 9 | 79 | 20 | 65 | 0 | 28 | 14 | 19 | 4 | 1 | 1 | 11 |
11,069 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license_profile/_list.py
|
azext_connectedmachine.aaz.latest.connectedmachine.license_profile._list.List.LicenseProfilesList
|
class LicenseProfilesList(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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.next_link = AAZStrType(
serialized_name="nextLink",
)
_schema_on_200.value = AAZListType(
flags={"required": True},
)
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.location = AAZStrType(
flags={"required": True},
)
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType(
flags={"client_flatten": True},
)
_element.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_element.tags = AAZDictType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.esu_profile = AAZObjectType(
serialized_name="esuProfile",
flags={"client_flatten": True},
)
properties.product_profile = AAZObjectType(
serialized_name="productProfile",
flags={"client_flatten": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.software_assurance = AAZObjectType(
serialized_name="softwareAssurance",
flags={"client_flatten": True},
)
esu_profile = cls._schema_on_200.value.Element.properties.esu_profile
esu_profile.assigned_license = AAZStrType(
serialized_name="assignedLicense",
)
esu_profile.assigned_license_immutable_id = AAZStrType(
serialized_name="assignedLicenseImmutableId",
flags={"read_only": True},
)
esu_profile.esu_eligibility = AAZStrType(
serialized_name="esuEligibility",
flags={"read_only": True},
)
esu_profile.esu_key_state = AAZStrType(
serialized_name="esuKeyState",
flags={"read_only": True},
)
esu_profile.esu_keys = AAZListType(
serialized_name="esuKeys",
flags={"read_only": True},
)
esu_profile.server_type = AAZStrType(
serialized_name="serverType",
flags={"read_only": True},
)
esu_keys = cls._schema_on_200.value.Element.properties.esu_profile.esu_keys
esu_keys.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element.properties.esu_profile.esu_keys.Element
_element.license_status = AAZIntType(
serialized_name="licenseStatus",
)
_element.sku = AAZStrType()
product_profile = cls._schema_on_200.value.Element.properties.product_profile
product_profile.billing_end_date = AAZStrType(
serialized_name="billingEndDate",
flags={"read_only": True},
)
product_profile.billing_start_date = AAZStrType(
serialized_name="billingStartDate",
flags={"read_only": True},
)
product_profile.disenrollment_date = AAZStrType(
serialized_name="disenrollmentDate",
flags={"read_only": True},
)
product_profile.enrollment_date = AAZStrType(
serialized_name="enrollmentDate",
flags={"read_only": True},
)
product_profile.error = AAZObjectType(
flags={"read_only": True},
)
_ListHelper._build_schema_error_detail_read(product_profile.error)
product_profile.product_features = AAZListType(
serialized_name="productFeatures",
)
product_profile.product_type = AAZStrType(
serialized_name="productType",
)
product_profile.subscription_status = AAZStrType(
serialized_name="subscriptionStatus",
)
product_features = cls._schema_on_200.value.Element.properties.product_profile.product_features
product_features.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element.properties.product_profile.product_features.Element
_element.billing_end_date = AAZStrType(
serialized_name="billingEndDate",
flags={"read_only": True},
)
_element.billing_start_date = AAZStrType(
serialized_name="billingStartDate",
flags={"read_only": True},
)
_element.disenrollment_date = AAZStrType(
serialized_name="disenrollmentDate",
flags={"read_only": True},
)
_element.enrollment_date = AAZStrType(
serialized_name="enrollmentDate",
flags={"read_only": True},
)
_element.error = AAZObjectType(
flags={"read_only": True},
)
_ListHelper._build_schema_error_detail_read(_element.error)
_element.name = AAZStrType()
_element.subscription_status = AAZStrType(
serialized_name="subscriptionStatus",
)
software_assurance = cls._schema_on_200.value.Element.properties.software_assurance
software_assurance.software_assurance_customer = AAZBoolType(
serialized_name="softwareAssuranceCustomer",
)
system_data = cls._schema_on_200.value.Element.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200.value.Element.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class LicenseProfilesList(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
| 17 | 0 | 26 | 2 | 24 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 254 | 26 | 228 | 36 | 211 | 0 | 94 | 29 | 84 | 2 | 1 | 1 | 11 |
11,070 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license_profile/_show.py
|
azext_connectedmachine.aaz.latest.connectedmachine.license_profile._show.Show.LicenseProfilesGet
|
class LicenseProfilesGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"licenseProfileName", self.ctx.args.license_profile_name,
required=True,
),
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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(
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType(
flags={"required": True},
)
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.esu_profile = AAZObjectType(
serialized_name="esuProfile",
flags={"client_flatten": True},
)
properties.product_profile = AAZObjectType(
serialized_name="productProfile",
flags={"client_flatten": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.software_assurance = AAZObjectType(
serialized_name="softwareAssurance",
flags={"client_flatten": True},
)
esu_profile = cls._schema_on_200.properties.esu_profile
esu_profile.assigned_license = AAZStrType(
serialized_name="assignedLicense",
)
esu_profile.assigned_license_immutable_id = AAZStrType(
serialized_name="assignedLicenseImmutableId",
flags={"read_only": True},
)
esu_profile.esu_eligibility = AAZStrType(
serialized_name="esuEligibility",
flags={"read_only": True},
)
esu_profile.esu_key_state = AAZStrType(
serialized_name="esuKeyState",
flags={"read_only": True},
)
esu_profile.esu_keys = AAZListType(
serialized_name="esuKeys",
flags={"read_only": True},
)
esu_profile.server_type = AAZStrType(
serialized_name="serverType",
flags={"read_only": True},
)
esu_keys = cls._schema_on_200.properties.esu_profile.esu_keys
esu_keys.Element = AAZObjectType()
_element = cls._schema_on_200.properties.esu_profile.esu_keys.Element
_element.license_status = AAZIntType(
serialized_name="licenseStatus",
)
_element.sku = AAZStrType()
product_profile = cls._schema_on_200.properties.product_profile
product_profile.billing_end_date = AAZStrType(
serialized_name="billingEndDate",
flags={"read_only": True},
)
product_profile.billing_start_date = AAZStrType(
serialized_name="billingStartDate",
flags={"read_only": True},
)
product_profile.disenrollment_date = AAZStrType(
serialized_name="disenrollmentDate",
flags={"read_only": True},
)
product_profile.enrollment_date = AAZStrType(
serialized_name="enrollmentDate",
flags={"read_only": True},
)
product_profile.error = AAZObjectType(
flags={"read_only": True},
)
_ShowHelper._build_schema_error_detail_read(product_profile.error)
product_profile.product_features = AAZListType(
serialized_name="productFeatures",
)
product_profile.product_type = AAZStrType(
serialized_name="productType",
)
product_profile.subscription_status = AAZStrType(
serialized_name="subscriptionStatus",
)
product_features = cls._schema_on_200.properties.product_profile.product_features
product_features.Element = AAZObjectType()
_element = cls._schema_on_200.properties.product_profile.product_features.Element
_element.billing_end_date = AAZStrType(
serialized_name="billingEndDate",
flags={"read_only": True},
)
_element.billing_start_date = AAZStrType(
serialized_name="billingStartDate",
flags={"read_only": True},
)
_element.disenrollment_date = AAZStrType(
serialized_name="disenrollmentDate",
flags={"read_only": True},
)
_element.enrollment_date = AAZStrType(
serialized_name="enrollmentDate",
flags={"read_only": True},
)
_element.error = AAZObjectType(
flags={"read_only": True},
)
_ShowHelper._build_schema_error_detail_read(_element.error)
_element.name = AAZStrType()
_element.subscription_status = AAZStrType(
serialized_name="subscriptionStatus",
)
software_assurance = cls._schema_on_200.properties.software_assurance
software_assurance.software_assurance_customer = AAZBoolType(
serialized_name="softwareAssuranceCustomer",
)
system_data = cls._schema_on_200.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class LicenseProfilesGet(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
| 17 | 0 | 25 | 2 | 24 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 247 | 24 | 223 | 35 | 206 | 0 | 89 | 28 | 79 | 2 | 1 | 1 | 11 |
11,071 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.LookupActivity
|
class LookupActivity(ExecutionActivity):
"""Lookup activity.
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, JSON]
:ivar name: Activity name. Required.
:vartype name: str
:ivar type: Type of activity. Required.
:vartype type: str
:ivar description: Activity description.
:vartype description: str
:ivar state: Activity state. This is an optional property and if not provided, the state will
be Active by default. Known values are: "Active" and "Inactive".
:vartype state: str or ~azure.mgmt.datafactory.models.ActivityState
:ivar on_inactive_mark_as: Status result of the activity when the state is set to Inactive.
This is an optional property and if not provided when the activity is inactive, the status will
be Succeeded by default. Known values are: "Succeeded", "Failed", and "Skipped".
:vartype on_inactive_mark_as: str or ~azure.mgmt.datafactory.models.ActivityOnInactiveMarkAs
:ivar depends_on: Activity depends on condition.
:vartype depends_on: list[~azure.mgmt.datafactory.models.ActivityDependency]
:ivar user_properties: Activity user properties.
:vartype user_properties: list[~azure.mgmt.datafactory.models.UserProperty]
:ivar linked_service_name: Linked service reference.
:vartype linked_service_name: ~azure.mgmt.datafactory.models.LinkedServiceReference
:ivar policy: Activity policy.
:vartype policy: ~azure.mgmt.datafactory.models.ActivityPolicy
:ivar source: Dataset-specific source properties, same as copy activity source. Required.
:vartype source: ~azure.mgmt.datafactory.models.CopySource
:ivar dataset: Lookup activity dataset reference. Required.
:vartype dataset: ~azure.mgmt.datafactory.models.DatasetReference
:ivar first_row_only: Whether to return first row or all rows. Default value is true. Type:
boolean (or Expression with resultType boolean).
:vartype first_row_only: JSON
"""
_validation = {
"name": {"required": True},
"type": {"required": True},
"source": {"required": True},
"dataset": {"required": True},
}
_attribute_map = {
"additional_properties": {"key": "", "type": "{object}"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"description": {"key": "description", "type": "str"},
"state": {"key": "state", "type": "str"},
"on_inactive_mark_as": {"key": "onInactiveMarkAs", "type": "str"},
"depends_on": {"key": "dependsOn", "type": "[ActivityDependency]"},
"user_properties": {"key": "userProperties", "type": "[UserProperty]"},
"linked_service_name": {"key": "linkedServiceName", "type": "LinkedServiceReference"},
"policy": {"key": "policy", "type": "ActivityPolicy"},
"source": {"key": "typeProperties.source", "type": "CopySource"},
"dataset": {"key": "typeProperties.dataset", "type": "DatasetReference"},
"first_row_only": {"key": "typeProperties.firstRowOnly", "type": "object"},
}
def __init__(
self,
*,
name: str,
source: "_models.CopySource",
dataset: "_models.DatasetReference",
additional_properties: Optional[Dict[str, JSON]] = None,
description: Optional[str] = None,
state: Optional[Union[str, "_models.ActivityState"]] = None,
on_inactive_mark_as: Optional[Union[str, "_models.ActivityOnInactiveMarkAs"]] = None,
depends_on: Optional[List["_models.ActivityDependency"]] = None,
user_properties: Optional[List["_models.UserProperty"]] = None,
linked_service_name: Optional["_models.LinkedServiceReference"] = None,
policy: Optional["_models.ActivityPolicy"] = None,
first_row_only: Optional[JSON] = None,
**kwargs: Any
) -> None:
"""
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
:keyword name: Activity name. Required.
:paramtype name: str
:keyword description: Activity description.
:paramtype description: str
:keyword state: Activity state. This is an optional property and if not provided, the state
will be Active by default. Known values are: "Active" and "Inactive".
:paramtype state: str or ~azure.mgmt.datafactory.models.ActivityState
:keyword on_inactive_mark_as: Status result of the activity when the state is set to Inactive.
This is an optional property and if not provided when the activity is inactive, the status will
be Succeeded by default. Known values are: "Succeeded", "Failed", and "Skipped".
:paramtype on_inactive_mark_as: str or ~azure.mgmt.datafactory.models.ActivityOnInactiveMarkAs
:keyword depends_on: Activity depends on condition.
:paramtype depends_on: list[~azure.mgmt.datafactory.models.ActivityDependency]
:keyword user_properties: Activity user properties.
:paramtype user_properties: list[~azure.mgmt.datafactory.models.UserProperty]
:keyword linked_service_name: Linked service reference.
:paramtype linked_service_name: ~azure.mgmt.datafactory.models.LinkedServiceReference
:keyword policy: Activity policy.
:paramtype policy: ~azure.mgmt.datafactory.models.ActivityPolicy
:keyword source: Dataset-specific source properties, same as copy activity source. Required.
:paramtype source: ~azure.mgmt.datafactory.models.CopySource
:keyword dataset: Lookup activity dataset reference. Required.
:paramtype dataset: ~azure.mgmt.datafactory.models.DatasetReference
:keyword first_row_only: Whether to return first row or all rows. Default value is true. Type:
boolean (or Expression with resultType boolean).
:paramtype first_row_only: JSON
"""
super().__init__(
additional_properties=additional_properties,
name=name,
description=description,
state=state,
on_inactive_mark_as=on_inactive_mark_as,
depends_on=depends_on,
user_properties=user_properties,
linked_service_name=linked_service_name,
policy=policy,
**kwargs
)
self.type: str = "Lookup"
self.source = source
self.dataset = dataset
self.first_row_only = first_row_only
|
class LookupActivity(ExecutionActivity):
'''Lookup activity.
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, JSON]
:ivar name: Activity name. Required.
:vartype name: str
:ivar type: Type of activity. Required.
:vartype type: str
:ivar description: Activity description.
:vartype description: str
:ivar state: Activity state. This is an optional property and if not provided, the state will
be Active by default. Known values are: "Active" and "Inactive".
:vartype state: str or ~azure.mgmt.datafactory.models.ActivityState
:ivar on_inactive_mark_as: Status result of the activity when the state is set to Inactive.
This is an optional property and if not provided when the activity is inactive, the status will
be Succeeded by default. Known values are: "Succeeded", "Failed", and "Skipped".
:vartype on_inactive_mark_as: str or ~azure.mgmt.datafactory.models.ActivityOnInactiveMarkAs
:ivar depends_on: Activity depends on condition.
:vartype depends_on: list[~azure.mgmt.datafactory.models.ActivityDependency]
:ivar user_properties: Activity user properties.
:vartype user_properties: list[~azure.mgmt.datafactory.models.UserProperty]
:ivar linked_service_name: Linked service reference.
:vartype linked_service_name: ~azure.mgmt.datafactory.models.LinkedServiceReference
:ivar policy: Activity policy.
:vartype policy: ~azure.mgmt.datafactory.models.ActivityPolicy
:ivar source: Dataset-specific source properties, same as copy activity source. Required.
:vartype source: ~azure.mgmt.datafactory.models.CopySource
:ivar dataset: Lookup activity dataset reference. Required.
:vartype dataset: ~azure.mgmt.datafactory.models.DatasetReference
:ivar first_row_only: Whether to return first row or all rows. Default value is true. Type:
boolean (or Expression with resultType boolean).
:vartype first_row_only: JSON
'''
def __init__(
self,
*,
name: str,
source: "_models.CopySource",
dataset: "_models.DatasetReference",
additional_properties: Optional[Dict[str, JSON]] = None,
description: Optional[str] = None,
state: Optional[Union[str, "_models.ActivityState"]] = None,
on_inactive_mark_as: Optional[Union[str, "_models.ActivityOnInactiveMarkAs"]] = None,
depends_on: Optional[List["_models.ActivityDependency"]] = None,
user_properties: Optional[List["_models.UserProperty"]] = None,
linked_service_name: Optional["_models.LinkedServiceReference"] = None,
policy: Optional["_models.ActivityPolicy"] = None,
first_row_only: Optional[JSON] = None,
**kwargs: Any
) -> None:
'''
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
:keyword name: Activity name. Required.
:paramtype name: str
:keyword description: Activity description.
:paramtype description: str
:keyword state: Activity state. This is an optional property and if not provided, the state
will be Active by default. Known values are: "Active" and "Inactive".
:paramtype state: str or ~azure.mgmt.datafactory.models.ActivityState
:keyword on_inactive_mark_as: Status result of the activity when the state is set to Inactive.
This is an optional property and if not provided when the activity is inactive, the status will
be Succeeded by default. Known values are: "Succeeded", "Failed", and "Skipped".
:paramtype on_inactive_mark_as: str or ~azure.mgmt.datafactory.models.ActivityOnInactiveMarkAs
:keyword depends_on: Activity depends on condition.
:paramtype depends_on: list[~azure.mgmt.datafactory.models.ActivityDependency]
:keyword user_properties: Activity user properties.
:paramtype user_properties: list[~azure.mgmt.datafactory.models.UserProperty]
:keyword linked_service_name: Linked service reference.
:paramtype linked_service_name: ~azure.mgmt.datafactory.models.LinkedServiceReference
:keyword policy: Activity policy.
:paramtype policy: ~azure.mgmt.datafactory.models.ActivityPolicy
:keyword source: Dataset-specific source properties, same as copy activity source. Required.
:paramtype source: ~azure.mgmt.datafactory.models.CopySource
:keyword dataset: Lookup activity dataset reference. Required.
:paramtype dataset: ~azure.mgmt.datafactory.models.DatasetReference
:keyword first_row_only: Whether to return first row or all rows. Default value is true. Type:
boolean (or Expression with resultType boolean).
:paramtype first_row_only: JSON
'''
pass
| 2 | 2 | 64 | 0 | 33 | 31 | 1 | 1.18 | 1 | 3 | 0 | 0 | 1 | 4 | 1 | 18 | 125 | 5 | 55 | 24 | 37 | 65 | 9 | 8 | 7 | 1 | 4 | 0 | 1 |
11,072 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.LogStorageSettings
|
class LogStorageSettings(_serialization.Model):
"""(Deprecated. Please use LogSettings) Log storage settings.
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, JSON]
:ivar linked_service_name: Log storage linked service reference. Required.
:vartype linked_service_name: ~azure.mgmt.datafactory.models.LinkedServiceReference
:ivar path: The path to storage for storing detailed logs of activity execution. Type: string
(or Expression with resultType string).
:vartype path: JSON
:ivar log_level: Gets or sets the log level, support: Info, Warning. Type: string (or
Expression with resultType string).
:vartype log_level: JSON
:ivar enable_reliable_logging: Specifies whether to enable reliable logging. Type: boolean (or
Expression with resultType boolean).
:vartype enable_reliable_logging: JSON
"""
_validation = {
"linked_service_name": {"required": True},
}
_attribute_map = {
"additional_properties": {"key": "", "type": "{object}"},
"linked_service_name": {"key": "linkedServiceName", "type": "LinkedServiceReference"},
"path": {"key": "path", "type": "object"},
"log_level": {"key": "logLevel", "type": "object"},
"enable_reliable_logging": {"key": "enableReliableLogging", "type": "object"},
}
def __init__(
self,
*,
linked_service_name: "_models.LinkedServiceReference",
additional_properties: Optional[Dict[str, JSON]] = None,
path: Optional[JSON] = None,
log_level: Optional[JSON] = None,
enable_reliable_logging: Optional[JSON] = None,
**kwargs: Any
) -> None:
"""
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
:keyword linked_service_name: Log storage linked service reference. Required.
:paramtype linked_service_name: ~azure.mgmt.datafactory.models.LinkedServiceReference
:keyword path: The path to storage for storing detailed logs of activity execution. Type:
string (or Expression with resultType string).
:paramtype path: JSON
:keyword log_level: Gets or sets the log level, support: Info, Warning. Type: string (or
Expression with resultType string).
:paramtype log_level: JSON
:keyword enable_reliable_logging: Specifies whether to enable reliable logging. Type: boolean
(or Expression with resultType boolean).
:paramtype enable_reliable_logging: JSON
"""
super().__init__(**kwargs)
self.additional_properties = additional_properties
self.linked_service_name = linked_service_name
self.path = path
self.log_level = log_level
self.enable_reliable_logging = enable_reliable_logging
|
class LogStorageSettings(_serialization.Model):
'''(Deprecated. Please use LogSettings) Log storage settings.
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, JSON]
:ivar linked_service_name: Log storage linked service reference. Required.
:vartype linked_service_name: ~azure.mgmt.datafactory.models.LinkedServiceReference
:ivar path: The path to storage for storing detailed logs of activity execution. Type: string
(or Expression with resultType string).
:vartype path: JSON
:ivar log_level: Gets or sets the log level, support: Info, Warning. Type: string (or
Expression with resultType string).
:vartype log_level: JSON
:ivar enable_reliable_logging: Specifies whether to enable reliable logging. Type: boolean (or
Expression with resultType boolean).
:vartype enable_reliable_logging: JSON
'''
def __init__(
self,
*,
linked_service_name: "_models.LinkedServiceReference",
additional_properties: Optional[Dict[str, JSON]] = None,
path: Optional[JSON] = None,
log_level: Optional[JSON] = None,
enable_reliable_logging: Optional[JSON] = None,
**kwargs: Any
) -> None:
'''
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
:keyword linked_service_name: Log storage linked service reference. Required.
:paramtype linked_service_name: ~azure.mgmt.datafactory.models.LinkedServiceReference
:keyword path: The path to storage for storing detailed logs of activity execution. Type:
string (or Expression with resultType string).
:paramtype path: JSON
:keyword log_level: Gets or sets the log level, support: Info, Warning. Type: string (or
Expression with resultType string).
:paramtype log_level: JSON
:keyword enable_reliable_logging: Specifies whether to enable reliable logging. Type: boolean
(or Expression with resultType boolean).
:paramtype enable_reliable_logging: JSON
'''
pass
| 2 | 2 | 32 | 0 | 16 | 16 | 1 | 1.22 | 1 | 3 | 0 | 0 | 1 | 5 | 1 | 16 | 65 | 5 | 27 | 18 | 16 | 33 | 10 | 9 | 8 | 1 | 2 | 0 | 1 |
11,073 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_list.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_link_scope._list.List.PrivateLinkScopesListByResourceGroup
|
class PrivateLinkScopesListByResourceGroup(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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.next_link = AAZStrType(
serialized_name="nextLink",
)
_schema_on_200.value = AAZListType(
flags={"required": True},
)
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.location = AAZStrType(
flags={"required": True},
)
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType()
_element.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_element.tags = AAZDictType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.private_endpoint_connections = AAZListType(
serialized_name="privateEndpointConnections",
flags={"read_only": True},
)
properties.private_link_scope_id = AAZStrType(
serialized_name="privateLinkScopeId",
flags={"read_only": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.public_network_access = AAZStrType(
serialized_name="publicNetworkAccess",
)
private_endpoint_connections = cls._schema_on_200.value.Element.properties.private_endpoint_connections
private_endpoint_connections.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties
properties.group_ids = AAZListType(
serialized_name="groupIds",
flags={"read_only": True},
)
properties.private_endpoint = AAZObjectType(
serialized_name="privateEndpoint",
)
properties.private_link_service_connection_state = AAZObjectType(
serialized_name="privateLinkServiceConnectionState",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
group_ids = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties.group_ids
group_ids.Element = AAZStrType()
private_endpoint = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties.private_endpoint
private_endpoint.id = AAZStrType()
private_link_service_connection_state = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties.private_link_service_connection_state
private_link_service_connection_state.actions_required = AAZStrType(
serialized_name="actionsRequired",
flags={"read_only": True},
)
private_link_service_connection_state.description = AAZStrType(
flags={"required": True},
)
private_link_service_connection_state.status = AAZStrType(
flags={"required": True},
)
system_data = cls._schema_on_200.value.Element.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200.value.Element.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class PrivateLinkScopesListByResourceGroup(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
| 17 | 0 | 20 | 2 | 18 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 197 | 25 | 172 | 35 | 155 | 0 | 79 | 28 | 69 | 2 | 1 | 1 | 11 |
11,074 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_list.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_link_scope._list.List.PrivateLinkScopesList
|
class PrivateLinkScopesList(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/privateLinkScopes",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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.next_link = AAZStrType(
serialized_name="nextLink",
)
_schema_on_200.value = AAZListType(
flags={"required": True},
)
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.location = AAZStrType(
flags={"required": True},
)
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType()
_element.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_element.tags = AAZDictType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.private_endpoint_connections = AAZListType(
serialized_name="privateEndpointConnections",
flags={"read_only": True},
)
properties.private_link_scope_id = AAZStrType(
serialized_name="privateLinkScopeId",
flags={"read_only": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.public_network_access = AAZStrType(
serialized_name="publicNetworkAccess",
)
private_endpoint_connections = cls._schema_on_200.value.Element.properties.private_endpoint_connections
private_endpoint_connections.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties
properties.group_ids = AAZListType(
serialized_name="groupIds",
flags={"read_only": True},
)
properties.private_endpoint = AAZObjectType(
serialized_name="privateEndpoint",
)
properties.private_link_service_connection_state = AAZObjectType(
serialized_name="privateLinkServiceConnectionState",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
group_ids = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties.group_ids
group_ids.Element = AAZStrType()
private_endpoint = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties.private_endpoint
private_endpoint.id = AAZStrType()
private_link_service_connection_state = cls._schema_on_200.value.Element.properties.private_endpoint_connections.Element.properties.private_link_service_connection_state
private_link_service_connection_state.actions_required = AAZStrType(
serialized_name="actionsRequired",
flags={"read_only": True},
)
private_link_service_connection_state.description = AAZStrType(
flags={"required": True},
)
private_link_service_connection_state.status = AAZStrType(
flags={"required": True},
)
system_data = cls._schema_on_200.value.Element.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200.value.Element.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class PrivateLinkScopesList(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
| 17 | 0 | 19 | 2 | 18 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 193 | 25 | 168 | 35 | 151 | 0 | 79 | 28 | 69 | 2 | 1 | 1 | 11 |
11,075 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_delete.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_link_scope._delete.Delete.PrivateLinkScopesDelete
|
class PrivateLinkScopesDelete(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,
)
if session.http_response.status_code in [204]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_204,
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(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}",
**self.url_parameters
)
@property
def method(self):
return "DELETE"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"scopeName", self.ctx.args.scope_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
def on_200(self, session):
pass
def on_204(self, session):
pass
|
class PrivateLinkScopesDelete(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
def on_200(self, session):
pass
def on_204(self, session):
pass
| 14 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 1 | 8 | 8 | 84 | 9 | 75 | 20 | 61 | 0 | 28 | 14 | 19 | 4 | 1 | 1 | 11 |
11,076 |
Azure/azure-cli-extensions
|
src/securityinsight/azext_sentinel/aaz/latest/sentinel/alert_rule/action/__cmd_group.py
|
azext_sentinel.aaz.latest.sentinel.alert_rule.action.__cmd_group.__CMDGroup
|
class __CMDGroup(AAZCommandGroup):
"""Manage alert rule action with sentinel.
"""
pass
|
class __CMDGroup(AAZCommandGroup):
'''Manage alert rule action with sentinel.
'''
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 |
11,077 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_scope/_create.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_link_scope._create.Create.PrivateLinkScopesCreateOrUpdate
|
class PrivateLinkScopesCreateOrUpdate(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 [200, 201]:
return self.on_200_201(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"scopeName", self.ctx.args.scope_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
typ=AAZObjectType,
typ_kwargs={
"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={
"flags": {"required": True}})
_builder.set_prop("properties", AAZObjectType)
_builder.set_prop("tags", AAZDictType, ".tags")
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("publicNetworkAccess",
AAZStrType, ".public_network_access")
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return self.serialize_content(_content_value)
def on_200_201(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200_201
)
_schema_on_200_201 = None
@classmethod
def _build_schema_on_200_201(cls):
if cls._schema_on_200_201 is not None:
return cls._schema_on_200_201
cls._schema_on_200_201 = AAZObjectType()
_schema_on_200_201 = cls._schema_on_200_201
_schema_on_200_201.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.location = AAZStrType(
flags={"required": True},
)
_schema_on_200_201.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.properties = AAZObjectType()
_schema_on_200_201.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200_201.tags = AAZDictType()
_schema_on_200_201.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200_201.properties
properties.private_endpoint_connections = AAZListType(
serialized_name="privateEndpointConnections",
flags={"read_only": True},
)
properties.private_link_scope_id = AAZStrType(
serialized_name="privateLinkScopeId",
flags={"read_only": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.public_network_access = AAZStrType(
serialized_name="publicNetworkAccess",
)
private_endpoint_connections = cls._schema_on_200_201.properties.private_endpoint_connections
private_endpoint_connections.Element = AAZObjectType()
_element = cls._schema_on_200_201.properties.private_endpoint_connections.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType()
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200_201.properties.private_endpoint_connections.Element.properties
properties.group_ids = AAZListType(
serialized_name="groupIds",
flags={"read_only": True},
)
properties.private_endpoint = AAZObjectType(
serialized_name="privateEndpoint",
)
properties.private_link_service_connection_state = AAZObjectType(
serialized_name="privateLinkServiceConnectionState",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
group_ids = cls._schema_on_200_201.properties.private_endpoint_connections.Element.properties.group_ids
group_ids.Element = AAZStrType()
private_endpoint = cls._schema_on_200_201.properties.private_endpoint_connections.Element.properties.private_endpoint
private_endpoint.id = AAZStrType()
private_link_service_connection_state = cls._schema_on_200_201.properties.private_endpoint_connections.Element.properties.private_link_service_connection_state
private_link_service_connection_state.actions_required = AAZStrType(
serialized_name="actionsRequired",
flags={"read_only": True},
)
private_link_service_connection_state.description = AAZStrType(
flags={"required": True},
)
private_link_service_connection_state.status = AAZStrType(
flags={"required": True},
)
system_data = cls._schema_on_200_201.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200_201.tags
tags.Element = AAZStrType()
return cls._schema_on_200_201
|
class PrivateLinkScopesCreateOrUpdate(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
@property
def content(self):
pass
def on_200_201(self, session):
pass
@classmethod
def _build_schema_on_200_201(cls):
pass
| 19 | 0 | 19 | 2 | 18 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 9 | 0 | 10 | 10 | 214 | 27 | 187 | 39 | 168 | 0 | 86 | 31 | 75 | 3 | 1 | 1 | 14 |
11,078 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_resource/_show.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_link_resource._show.Show.PrivateLinkResourcesGet
|
class PrivateLinkResourcesGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"groupName", self.ctx.args.group_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"scopeName", self.ctx.args.scope_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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(
flags={"read_only": True},
)
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType()
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.group_id = AAZStrType(
serialized_name="groupId",
flags={"read_only": True},
)
properties.required_members = AAZListType(
serialized_name="requiredMembers",
flags={"read_only": True},
)
properties.required_zone_names = AAZListType(
serialized_name="requiredZoneNames",
flags={"read_only": True},
)
required_members = cls._schema_on_200.properties.required_members
required_members.Element = AAZStrType()
required_zone_names = cls._schema_on_200.properties.required_zone_names
required_zone_names.Element = AAZStrType()
system_data = cls._schema_on_200.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
return cls._schema_on_200
|
class PrivateLinkResourcesGet(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
| 17 | 0 | 13 | 1 | 13 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 141 | 18 | 123 | 30 | 106 | 0 | 53 | 23 | 43 | 2 | 1 | 1 | 11 |
11,079 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_link_resource/_list.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_link_resource._list.List.PrivateLinkResourcesListByPrivateLinkScope
|
class PrivateLinkResourcesListByPrivateLinkScope(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"scopeName", self.ctx.args.scope_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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.next_link = AAZStrType(
serialized_name="nextLink",
flags={"read_only": True},
)
_schema_on_200.value = AAZListType(
flags={"read_only": True},
)
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType()
_element.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.group_id = AAZStrType(
serialized_name="groupId",
flags={"read_only": True},
)
properties.required_members = AAZListType(
serialized_name="requiredMembers",
flags={"read_only": True},
)
properties.required_zone_names = AAZListType(
serialized_name="requiredZoneNames",
flags={"read_only": True},
)
required_members = cls._schema_on_200.value.Element.properties.required_members
required_members.Element = AAZStrType()
required_zone_names = cls._schema_on_200.value.Element.properties.required_zone_names
required_zone_names.Element = AAZStrType()
system_data = cls._schema_on_200.value.Element.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
return cls._schema_on_200
|
class PrivateLinkResourcesListByPrivateLinkScope(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
| 17 | 0 | 14 | 1 | 13 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 149 | 20 | 129 | 32 | 112 | 0 | 58 | 25 | 48 | 2 | 1 | 1 | 11 |
11,080 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_wait.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_endpoint_connection._wait.Wait.PrivateEndpointConnectionsGet
|
class PrivateEndpointConnectionsGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"privateEndpointConnectionName", self.ctx.args.private_endpoint_connection_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"scopeName", self.ctx.args.scope_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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(
flags={"read_only": True},
)
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType()
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.group_ids = AAZListType(
serialized_name="groupIds",
flags={"read_only": True},
)
properties.private_endpoint = AAZObjectType(
serialized_name="privateEndpoint",
)
properties.private_link_service_connection_state = AAZObjectType(
serialized_name="privateLinkServiceConnectionState",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
group_ids = cls._schema_on_200.properties.group_ids
group_ids.Element = AAZStrType()
private_endpoint = cls._schema_on_200.properties.private_endpoint
private_endpoint.id = AAZStrType()
private_link_service_connection_state = cls._schema_on_200.properties.private_link_service_connection_state
private_link_service_connection_state.actions_required = AAZStrType(
serialized_name="actionsRequired",
flags={"read_only": True},
)
private_link_service_connection_state.description = AAZStrType(
flags={"required": True},
)
private_link_service_connection_state.status = AAZStrType(
flags={"required": True},
)
system_data = cls._schema_on_200.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
return cls._schema_on_200
|
class PrivateEndpointConnectionsGet(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
| 17 | 0 | 15 | 1 | 14 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 155 | 19 | 136 | 31 | 119 | 0 | 58 | 24 | 48 | 2 | 1 | 1 | 11 |
11,081 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py
|
azext_containerapp.tests.latest.test_containerapp_commands.ContainerappRevisionTests
|
class ContainerappRevisionTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
super().__init__(*arg, random_config_dir=True, **kwargs)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_revision_label_e2e(self, resource_group):
self.cmd(f"configure --defaults location={TEST_LOCATION}")
ca_name = self.create_random_name(prefix='containerapp', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(self)
self.cmd(
f"containerapp create -g {resource_group} -n {ca_name} --environment {env} --image mcr.microsoft.com/k8se/quickstart:latest --ingress external --target-port 80")
self.cmd(f"containerapp ingress show -g {resource_group} -n {ca_name}", checks=[
JMESPathCheck('external', True),
JMESPathCheck('targetPort', 80),
])
self.cmd(
f"containerapp create -g {resource_group} -n {ca_name} --environment {env} --ingress external --target-port 80 --image nginx")
self.cmd(
f"containerapp revision set-mode -g {resource_group} -n {ca_name} --mode multiple")
revision_names = self.cmd(
f"containerapp revision list -g {resource_group} -n {ca_name} --all --query '[].name'").get_output_in_json()
self.assertEqual(len(revision_names), 2)
labels = []
for revision in revision_names:
label = self.create_random_name(prefix='label', length=12)
labels.append(label)
self.cmd(
f"containerapp revision label add -g {resource_group} -n {ca_name} --revision {revision} --label {label}")
traffic_weight = self.cmd(
f"containerapp ingress traffic show -g {resource_group} -n {ca_name} --query '[].name'").get_output_in_json()
for traffic in traffic_weight:
if "label" in traffic:
self.assertEqual(traffic["label"] in labels, True)
self.cmd(
f"containerapp ingress traffic set -g {resource_group} -n {ca_name} --revision-weight latest=50 --label-weight {labels[0]}=25 {labels[1]}=25")
traffic_weight = self.cmd(
f"containerapp ingress traffic show -g {resource_group} -n {ca_name} --query '[].name'").get_output_in_json()
for traffic in traffic_weight:
if "label" in traffic:
self.assertEqual(traffic["weight"], 25)
else:
self.assertEqual(traffic["weight"], 50)
traffic_weight = self.cmd(
f"containerapp revision label swap -g {resource_group} -n {ca_name} --source {labels[0]} --target {labels[1]}").get_output_in_json()
for revision in revision_names:
traffic = [
w for w in traffic_weight if "revisionName" in w and w["revisionName"] == revision][0]
self.assertEqual(traffic["label"], labels[(
revision_names.index(revision) + 1) % 2])
self.cmd(f"containerapp revision label remove -g {resource_group} -n {ca_name} --label {labels[0]}", checks=[
JMESPathCheck('length(@)', 3),
])
self.cmd(f"containerapp revision label remove -g {resource_group} -n {ca_name} --label {labels[1]}", checks=[
JMESPathCheck('length(@)', 3),
])
traffic_weight = self.cmd(
f"containerapp ingress traffic show -g {resource_group} -n {ca_name}").get_output_in_json()
self.assertEqual(len([w for w in traffic_weight if "label" in w]), 0)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_revision_labels_mode_e2e(self, resource_group):
self.cmd(f"configure --defaults location={TEST_LOCATION}")
ca_name = self.create_random_name(prefix='containerapp', length=24)
env = prepare_containerapp_env_for_app_e2e_tests(self)
self.cmd(
f"containerapp create -g {resource_group} -n {ca_name} --environment {env} --image mcr.microsoft.com/k8se/quickstart:latest --ingress external --target-port 80")
self.cmd(f"containerapp ingress show -g {resource_group} -n {ca_name}", checks=[
JMESPathCheck('external', True),
JMESPathCheck('targetPort', 80),
])
label0 = 'label0'
self.cmd(
f"containerapp revision set-mode -g {resource_group} -n {ca_name} --mode labels --target-label {label0}")
label1 = 'label1'
self.cmd(
f"containerapp update -g {resource_group} -n {ca_name} --image mcr.microsoft.com/azuredocs/containerapps-helloworld:latest --target-label {label1}")
revision_names = self.cmd(
f"containerapp revision list -g {resource_group} -n {ca_name} --all --query '[].name'").get_output_in_json()
self.assertEqual(len(revision_names), 2)
# Traffic may not be updated immidately
traffic_weight = self.cmd(
f"containerapp ingress traffic show -g {resource_group} -n {ca_name}").get_output_in_json()
for retry in range(100):
if len(traffic_weight) >= 2:
break
time.sleep(5)
traffic_weight = self.cmd(
f"containerapp ingress traffic show -g {resource_group} -n {ca_name}").get_output_in_json()
self.assertEqual(traffic_weight[0]["label"], label0)
self.assertEqual(traffic_weight[0]["revisionName"], revision_names[0])
self.assertEqual(traffic_weight[0]["weight"], 100)
self.assertEqual(traffic_weight[1]["label"], label1)
self.assertEqual(traffic_weight[1]["revisionName"], revision_names[1])
self.assertEqual(traffic_weight[1]["weight"], 0)
self.assertEqual(len(traffic_weight), 2)
self.cmd(
f"containerapp ingress traffic set -g {resource_group} -n {ca_name} --label-weight {label0}=75 {label1}=25")
traffic_weight = self.cmd(
f"containerapp ingress traffic show -g {resource_group} -n {ca_name}").get_output_in_json()
self.assertEqual(traffic_weight[0]["label"], label0)
self.assertEqual(traffic_weight[0]["revisionName"], revision_names[0])
self.assertEqual(traffic_weight[0]["weight"], 75)
self.assertEqual(traffic_weight[1]["label"], label1)
self.assertEqual(traffic_weight[1]["revisionName"], revision_names[1])
self.assertEqual(traffic_weight[1]["weight"], 25)
self.assertEqual(len(traffic_weight), 2)
traffic_weight = self.cmd(
f"containerapp revision label swap -g {resource_group} -n {ca_name} --source {label0} --target {label1}").get_output_in_json()
self.assertEqual(traffic_weight[0]["label"], label1)
self.assertEqual(traffic_weight[0]["revisionName"], revision_names[0])
self.assertEqual(traffic_weight[0]["weight"], 75)
self.assertEqual(traffic_weight[1]["label"], label0)
self.assertEqual(traffic_weight[1]["revisionName"], revision_names[1])
self.assertEqual(traffic_weight[1]["weight"], 25)
self.assertEqual(len(traffic_weight), 2)
# make both labels point at the same revision
self.cmd(
f"containerapp revision label add -g {resource_group} -n {ca_name} --label {label0} --revision {revision_names[0]} --yes")
traffic_weight = self.cmd(
f"containerapp ingress traffic show -g {resource_group} -n {ca_name}").get_output_in_json()
self.assertEqual(traffic_weight[0]["label"], label1)
self.assertEqual(traffic_weight[0]["revisionName"], revision_names[0])
self.assertEqual(traffic_weight[0]["weight"], 75)
self.assertEqual(traffic_weight[1]["label"], label0)
self.assertEqual(traffic_weight[1]["revisionName"], revision_names[0])
self.assertEqual(traffic_weight[1]["weight"], 25)
self.assertEqual(len(traffic_weight), 2)
# Make them different again. There's a bug in `containerapp ingress traffic set` that can't handle updating weights in multiple sections with the same revision
traffic_weight = self.cmd(
f"containerapp revision label add -g {resource_group} -n {ca_name} --label {label1} --revision {revision_names[1]} --yes").get_output_in_json()
self.assertEqual(traffic_weight[0]["label"], label1)
self.assertEqual(traffic_weight[0]["revisionName"], revision_names[1])
self.assertEqual(traffic_weight[0]["weight"], 75)
self.assertEqual(traffic_weight[1]["label"], label0)
self.assertEqual(traffic_weight[1]["revisionName"], revision_names[0])
self.assertEqual(traffic_weight[1]["weight"], 25)
self.assertEqual(len(traffic_weight), 2)
self.cmd(
f"containerapp ingress traffic set -g {resource_group} -n {ca_name} --label-weight {label0}=100 {label1}=0")
traffic_weight = self.cmd(
f"containerapp ingress traffic show -g {resource_group} -n {ca_name}").get_output_in_json()
self.assertEqual(traffic_weight[0]["label"], label1)
self.assertEqual(traffic_weight[0]["revisionName"], revision_names[1])
self.assertEqual(traffic_weight[0]["weight"], 0)
self.assertEqual(traffic_weight[1]["label"], label0)
self.assertEqual(traffic_weight[1]["revisionName"], revision_names[0])
self.assertEqual(traffic_weight[1]["weight"], 100)
self.assertEqual(len(traffic_weight), 2)
traffic_weight = self.cmd(
f"containerapp revision label remove -g {resource_group} -n {ca_name} --label {label1}").get_output_in_json()
self.assertEqual(traffic_weight[0]["label"], label0)
self.assertEqual(traffic_weight[0]["revisionName"], revision_names[0])
self.assertEqual(traffic_weight[0]["weight"], 100)
self.assertEqual(len(traffic_weight), 1)
|
class ContainerappRevisionTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_revision_label_e2e(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northeurope")
def test_containerapp_revision_labels_mode_e2e(self, resource_group):
pass
| 8 | 0 | 53 | 13 | 40 | 1 | 4 | 0.02 | 1 | 2 | 0 | 0 | 3 | 0 | 3 | 3 | 167 | 40 | 124 | 21 | 116 | 3 | 109 | 19 | 105 | 7 | 1 | 2 | 11 |
11,082 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_endpoint_connection._update.Update.PrivateEndpointConnectionsGet
|
class PrivateEndpointConnectionsGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"privateEndpointConnectionName", self.ctx.args.private_endpoint_connection_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"scopeName", self.ctx.args.scope_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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()
_UpdateHelper._build_schema_private_endpoint_connection_read(
cls._schema_on_200)
return cls._schema_on_200
|
class PrivateEndpointConnectionsGet(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
| 17 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 86 | 13 | 73 | 25 | 56 | 0 | 33 | 18 | 23 | 2 | 1 | 1 | 11 |
11,083 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_endpoint_connection._update.Update.InstanceUpdateByJson
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
self._update_instance(self.ctx.vars.instance)
def _update_instance(self, instance):
_instance_value, _builder = self.new_content_builder(
self.ctx.args,
value=instance,
typ=AAZObjectType
)
_builder.set_prop("properties", AAZObjectType)
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("privateEndpoint",
AAZObjectType, ".private_endpoint")
properties.set_prop(
"privateLinkServiceConnectionState", AAZObjectType)
private_endpoint = _builder.get(".properties.privateEndpoint")
if private_endpoint is not None:
private_endpoint.set_prop("id", AAZStrType, ".id")
private_link_service_connection_state = _builder.get(
".properties.privateLinkServiceConnectionState")
if private_link_service_connection_state is not None:
private_link_service_connection_state.set_prop(
"description", AAZStrType, ".description", typ_kwargs={"flags": {"required": True}})
private_link_service_connection_state.set_prop(
"status", AAZStrType, ".status", typ_kwargs={"flags": {"required": True}})
return _instance_value
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
pass
def _update_instance(self, instance):
pass
| 3 | 0 | 13 | 2 | 11 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 28 | 6 | 22 | 7 | 19 | 0 | 18 | 7 | 15 | 4 | 1 | 1 | 5 |
11,084 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_list.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_endpoint_connection._list.List.PrivateEndpointConnectionsListByPrivateLinkScope
|
class PrivateEndpointConnectionsListByPrivateLinkScope(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"scopeName", self.ctx.args.scope_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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.next_link = AAZStrType(
serialized_name="nextLink",
flags={"read_only": True},
)
_schema_on_200.value = AAZListType(
flags={"read_only": True},
)
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType()
_element.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.group_ids = AAZListType(
serialized_name="groupIds",
flags={"read_only": True},
)
properties.private_endpoint = AAZObjectType(
serialized_name="privateEndpoint",
)
properties.private_link_service_connection_state = AAZObjectType(
serialized_name="privateLinkServiceConnectionState",
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
group_ids = cls._schema_on_200.value.Element.properties.group_ids
group_ids.Element = AAZStrType()
private_endpoint = cls._schema_on_200.value.Element.properties.private_endpoint
private_endpoint.id = AAZStrType()
private_link_service_connection_state = cls._schema_on_200.value.Element.properties.private_link_service_connection_state
private_link_service_connection_state.actions_required = AAZStrType(
serialized_name="actionsRequired",
flags={"read_only": True},
)
private_link_service_connection_state.description = AAZStrType(
flags={"required": True},
)
private_link_service_connection_state.status = AAZStrType(
flags={"required": True},
)
system_data = cls._schema_on_200.value.Element.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
return cls._schema_on_200
|
class PrivateEndpointConnectionsListByPrivateLinkScope(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
| 17 | 0 | 16 | 1 | 15 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 9 | 163 | 21 | 142 | 33 | 125 | 0 | 63 | 26 | 53 | 2 | 1 | 1 | 11 |
11,085 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_delete.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_endpoint_connection._delete.Delete.PrivateEndpointConnectionsDelete
|
class PrivateEndpointConnectionsDelete(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,
)
if session.http_response.status_code in [204]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_204,
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(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}",
**self.url_parameters
)
@property
def method(self):
return "DELETE"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"privateEndpointConnectionName", self.ctx.args.private_endpoint_connection_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"scopeName", self.ctx.args.scope_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
def on_200(self, session):
pass
def on_204(self, session):
pass
|
class PrivateEndpointConnectionsDelete(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
def on_200(self, session):
pass
def on_204(self, session):
pass
| 14 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 8 | 1 | 8 | 8 | 88 | 9 | 79 | 20 | 65 | 0 | 28 | 14 | 19 | 4 | 1 | 1 | 11 |
11,086 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license_profile/_wait.py
|
azext_connectedmachine.aaz.latest.connectedmachine.license_profile._wait.Wait.LicenseProfilesGet
|
class LicenseProfilesGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"licenseProfileName", self.ctx.args.license_profile_name,
required=True,
),
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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(
flags={"read_only": True},
)
_schema_on_200.location = AAZStrType(
flags={"required": True},
)
_schema_on_200.name = AAZStrType(
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"client_flatten": True},
)
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200.tags = AAZDictType()
_schema_on_200.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.properties
properties.esu_profile = AAZObjectType(
serialized_name="esuProfile",
flags={"client_flatten": True},
)
properties.product_profile = AAZObjectType(
serialized_name="productProfile",
flags={"client_flatten": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.software_assurance = AAZObjectType(
serialized_name="softwareAssurance",
flags={"client_flatten": True},
)
esu_profile = cls._schema_on_200.properties.esu_profile
esu_profile.assigned_license = AAZStrType(
serialized_name="assignedLicense",
)
esu_profile.assigned_license_immutable_id = AAZStrType(
serialized_name="assignedLicenseImmutableId",
flags={"read_only": True},
)
esu_profile.esu_eligibility = AAZStrType(
serialized_name="esuEligibility",
flags={"read_only": True},
)
esu_profile.esu_key_state = AAZStrType(
serialized_name="esuKeyState",
flags={"read_only": True},
)
esu_profile.esu_keys = AAZListType(
serialized_name="esuKeys",
flags={"read_only": True},
)
esu_profile.server_type = AAZStrType(
serialized_name="serverType",
flags={"read_only": True},
)
esu_keys = cls._schema_on_200.properties.esu_profile.esu_keys
esu_keys.Element = AAZObjectType()
_element = cls._schema_on_200.properties.esu_profile.esu_keys.Element
_element.license_status = AAZIntType(
serialized_name="licenseStatus",
)
_element.sku = AAZStrType()
product_profile = cls._schema_on_200.properties.product_profile
product_profile.billing_end_date = AAZStrType(
serialized_name="billingEndDate",
flags={"read_only": True},
)
product_profile.billing_start_date = AAZStrType(
serialized_name="billingStartDate",
flags={"read_only": True},
)
product_profile.disenrollment_date = AAZStrType(
serialized_name="disenrollmentDate",
flags={"read_only": True},
)
product_profile.enrollment_date = AAZStrType(
serialized_name="enrollmentDate",
flags={"read_only": True},
)
product_profile.error = AAZObjectType(
flags={"read_only": True},
)
_WaitHelper._build_schema_error_detail_read(product_profile.error)
product_profile.product_features = AAZListType(
serialized_name="productFeatures",
)
product_profile.product_type = AAZStrType(
serialized_name="productType",
)
product_profile.subscription_status = AAZStrType(
serialized_name="subscriptionStatus",
)
product_features = cls._schema_on_200.properties.product_profile.product_features
product_features.Element = AAZObjectType()
_element = cls._schema_on_200.properties.product_profile.product_features.Element
_element.billing_end_date = AAZStrType(
serialized_name="billingEndDate",
flags={"read_only": True},
)
_element.billing_start_date = AAZStrType(
serialized_name="billingStartDate",
flags={"read_only": True},
)
_element.disenrollment_date = AAZStrType(
serialized_name="disenrollmentDate",
flags={"read_only": True},
)
_element.enrollment_date = AAZStrType(
serialized_name="enrollmentDate",
flags={"read_only": True},
)
_element.error = AAZObjectType(
flags={"read_only": True},
)
_WaitHelper._build_schema_error_detail_read(_element.error)
_element.name = AAZStrType()
_element.subscription_status = AAZStrType(
serialized_name="subscriptionStatus",
)
software_assurance = cls._schema_on_200.properties.software_assurance
software_assurance.software_assurance_customer = AAZBoolType(
serialized_name="softwareAssuranceCustomer",
)
system_data = cls._schema_on_200.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)
tags = cls._schema_on_200.tags
tags.Element = AAZStrType()
return cls._schema_on_200
|
class LicenseProfilesGet(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
| 17 | 0 | 25 | 2 | 24 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 247 | 24 | 223 | 35 | 206 | 0 | 89 | 28 | 79 | 2 | 1 | 1 | 11 |
11,087 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license_profile/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.license_profile._update.Update.LicenseProfilesGet
|
class LicenseProfilesGet(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}",
**self.url_parameters
)
@property
def method(self):
return "GET"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"licenseProfileName", self.ctx.args.license_profile_name,
required=True,
),
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
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()
_UpdateHelper._build_schema_license_profile_read(
cls._schema_on_200)
return cls._schema_on_200
|
class LicenseProfilesGet(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
| 17 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 8 | 0 | 9 | 9 | 86 | 13 | 73 | 25 | 56 | 0 | 33 | 18 | 23 | 2 | 1 | 1 | 11 |
11,088 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license_profile/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.license_profile._update.Update.LicenseProfilesCreateOrUpdate
|
class LicenseProfilesCreateOrUpdate(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_201,
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, 201]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
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(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"licenseProfileName", self.ctx.args.license_profile_name,
required=True,
),
**self.serialize_url_param(
"machineName", self.ctx.args.machine_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
value=self.ctx.vars.instance,
)
return self.serialize_content(_content_value)
def on_200_201(self, session):
data = self.deserialize_http_content(session)
self.ctx.set_var(
"instance",
data,
schema_builder=self._build_schema_on_200_201
)
_schema_on_200_201 = None
@classmethod
def _build_schema_on_200_201(cls):
if cls._schema_on_200_201 is not None:
return cls._schema_on_200_201
cls._schema_on_200_201 = AAZObjectType()
_UpdateHelper._build_schema_license_profile_read(
cls._schema_on_200_201)
return cls._schema_on_200_201
|
class LicenseProfilesCreateOrUpdate(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
@property
def content(self):
pass
def on_200_201(self, session):
pass
@classmethod
def _build_schema_on_200_201(cls):
pass
| 19 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 9 | 1 | 10 | 10 | 114 | 15 | 99 | 29 | 80 | 0 | 38 | 20 | 27 | 3 | 1 | 1 | 13 |
11,089 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license_profile/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.license_profile._update.Update.InstanceUpdateByJson
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
self._update_instance(self.ctx.vars.instance)
def _update_instance(self, instance):
_instance_value, _builder = self.new_content_builder(
self.ctx.args,
value=instance,
typ=AAZObjectType
)
_builder.set_prop("properties", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
_builder.set_prop("tags", AAZDictType, ".tags")
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("esuProfile", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
properties.set_prop("productProfile", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
properties.set_prop("softwareAssurance", AAZObjectType, typ_kwargs={
"flags": {"client_flatten": True}})
esu_profile = _builder.get(".properties.esuProfile")
if esu_profile is not None:
esu_profile.set_prop(
"assignedLicense", AAZStrType, ".assigned_license")
product_profile = _builder.get(".properties.productProfile")
if product_profile is not None:
product_profile.set_prop(
"productFeatures", AAZListType, ".product_features")
product_profile.set_prop(
"productType", AAZStrType, ".product_type")
product_profile.set_prop(
"subscriptionStatus", AAZStrType, ".subscription_status")
product_features = _builder.get(
".properties.productProfile.productFeatures")
if product_features is not None:
product_features.set_elements(AAZObjectType, ".")
_elements = _builder.get(
".properties.productProfile.productFeatures[]")
if _elements is not None:
_elements.set_prop("name", AAZStrType, ".name")
_elements.set_prop("subscriptionStatus",
AAZStrType, ".subscription_status")
software_assurance = _builder.get(".properties.softwareAssurance")
if software_assurance is not None:
software_assurance.set_prop(
"softwareAssuranceCustomer", AAZBoolType, ".software_assurance_customer")
tags = _builder.get(".tags")
if tags is not None:
tags.set_elements(AAZStrType, ".")
return _instance_value
|
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation):
def __call__(self, *args, **kwargs):
pass
def _update_instance(self, instance):
pass
| 3 | 0 | 23 | 4 | 19 | 0 | 5 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 48 | 10 | 38 | 11 | 35 | 0 | 34 | 11 | 31 | 8 | 1 | 1 | 9 |
11,090 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.LogSettings
|
class LogSettings(_serialization.Model):
"""Log settings.
All required parameters must be populated in order to send to server.
:ivar enable_copy_activity_log: Specifies whether to enable copy activity log. Type: boolean
(or Expression with resultType boolean).
:vartype enable_copy_activity_log: JSON
:ivar copy_activity_log_settings: Specifies settings for copy activity log.
:vartype copy_activity_log_settings: ~azure.mgmt.datafactory.models.CopyActivityLogSettings
:ivar log_location_settings: Log location settings customer needs to provide when enabling log.
Required.
:vartype log_location_settings: ~azure.mgmt.datafactory.models.LogLocationSettings
"""
_validation = {
"log_location_settings": {"required": True},
}
_attribute_map = {
"enable_copy_activity_log": {"key": "enableCopyActivityLog", "type": "object"},
"copy_activity_log_settings": {"key": "copyActivityLogSettings", "type": "CopyActivityLogSettings"},
"log_location_settings": {"key": "logLocationSettings", "type": "LogLocationSettings"},
}
def __init__(
self,
*,
log_location_settings: "_models.LogLocationSettings",
enable_copy_activity_log: Optional[JSON] = None,
copy_activity_log_settings: Optional["_models.CopyActivityLogSettings"] = None,
**kwargs: Any
) -> None:
"""
:keyword enable_copy_activity_log: Specifies whether to enable copy activity log. Type: boolean
(or Expression with resultType boolean).
:paramtype enable_copy_activity_log: JSON
:keyword copy_activity_log_settings: Specifies settings for copy activity log.
:paramtype copy_activity_log_settings: ~azure.mgmt.datafactory.models.CopyActivityLogSettings
:keyword log_location_settings: Log location settings customer needs to provide when enabling
log. Required.
:paramtype log_location_settings: ~azure.mgmt.datafactory.models.LogLocationSettings
"""
super().__init__(**kwargs)
self.enable_copy_activity_log = enable_copy_activity_log
self.copy_activity_log_settings = copy_activity_log_settings
self.log_location_settings = log_location_settings
|
class LogSettings(_serialization.Model):
'''Log settings.
All required parameters must be populated in order to send to server.
:ivar enable_copy_activity_log: Specifies whether to enable copy activity log. Type: boolean
(or Expression with resultType boolean).
:vartype enable_copy_activity_log: JSON
:ivar copy_activity_log_settings: Specifies settings for copy activity log.
:vartype copy_activity_log_settings: ~azure.mgmt.datafactory.models.CopyActivityLogSettings
:ivar log_location_settings: Log location settings customer needs to provide when enabling log.
Required.
:vartype log_location_settings: ~azure.mgmt.datafactory.models.LogLocationSettings
'''
def __init__(
self,
*,
log_location_settings: "_models.LogLocationSettings",
enable_copy_activity_log: Optional[JSON] = None,
copy_activity_log_settings: Optional["_models.CopyActivityLogSettings"] = None,
**kwargs: Any
) -> None:
'''
:keyword enable_copy_activity_log: Specifies whether to enable copy activity log. Type: boolean
(or Expression with resultType boolean).
:paramtype enable_copy_activity_log: JSON
:keyword copy_activity_log_settings: Specifies settings for copy activity log.
:paramtype copy_activity_log_settings: ~azure.mgmt.datafactory.models.CopyActivityLogSettings
:keyword log_location_settings: Log location settings customer needs to provide when enabling
log. Required.
:paramtype log_location_settings: ~azure.mgmt.datafactory.models.LogLocationSettings
'''
pass
| 2 | 2 | 22 | 0 | 12 | 10 | 1 | 1 | 1 | 2 | 0 | 0 | 1 | 3 | 1 | 16 | 47 | 5 | 21 | 14 | 12 | 21 | 8 | 7 | 6 | 1 | 2 | 0 | 1 |
11,091 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/private_endpoint_connection/_update.py
|
azext_connectedmachine.aaz.latest.connectedmachine.private_endpoint_connection._update.Update.PrivateEndpointConnectionsCreateOrUpdate
|
class PrivateEndpointConnectionsCreateOrUpdate(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(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}",
**self.url_parameters
)
@property
def method(self):
return "PUT"
@property
def error_format(self):
return "MgmtErrorFormat"
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"privateEndpointConnectionName", self.ctx.args.private_endpoint_connection_name,
required=True,
),
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"scopeName", self.ctx.args.scope_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
required=True,
),
}
return parameters
@property
def header_parameters(self):
parameters = {
**self.serialize_header_param(
"Content-Type", "application/json",
),
**self.serialize_header_param(
"Accept", "application/json",
),
}
return parameters
@property
def content(self):
_content_value, _builder = self.new_content_builder(
self.ctx.args,
value=self.ctx.vars.instance,
)
return self.serialize_content(_content_value)
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()
_UpdateHelper._build_schema_private_endpoint_connection_read(
cls._schema_on_200)
return cls._schema_on_200
|
class PrivateEndpointConnectionsCreateOrUpdate(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
@property
def content(self):
pass
def on_200(self, session):
pass
@classmethod
def _build_schema_on_200(cls):
pass
| 19 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 9 | 1 | 10 | 10 | 114 | 15 | 99 | 29 | 80 | 0 | 38 | 20 | 27 | 3 | 1 | 1 | 13 |
11,092 |
Azure/azure-cli-extensions
|
src/securityinsight/azext_sentinel/aaz/latest/sentinel/alert_rule/action/_list.py
|
azext_sentinel.aaz.latest.sentinel.alert_rule.action._list.List
|
class List(AAZCommand):
"""Get all actions of alert rule.
"""
_aaz_info = {
"version": "2022-06-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/providers/microsoft.securityinsights/alertrules/{}/actions", "2022-06-01-preview"],
]
}
def _handler(self, command_args):
super()._handler(command_args)
return self.build_paging(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.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.rule_name = AAZStrArg(
options=["--rule-name"],
help="Name of alert rule.",
required=True,
is_experimental=True,
)
_args_schema.workspace_name = AAZStrArg(
options=["-w", "--workspace-name"],
help="The name of the workspace.",
required=True,
is_experimental=True,
)
return cls._args_schema
def _execute_operations(self):
self.ActionsListByAlertRule(ctx=self.ctx)()
def _output(self, *args, **kwargs):
result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True)
next_link = self.deserialize_output(self.ctx.vars.instance.next_link)
return result, next_link
class ActionsListByAlertRule(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 [200]:
return self.on_200(session)
return self.on_error(session.http_response)
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions",
**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(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"ruleId", self.ctx.args.rule_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
**self.serialize_url_param(
"workspaceName", self.ctx.args.workspace_name,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-06-01-preview",
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.next_link = AAZStrType(
serialized_name="nextLink",
flags={"read_only": True},
)
_schema_on_200.value = AAZListType(
flags={"required": True},
)
value = cls._schema_on_200.value
value.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element
_element.etag = AAZStrType()
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.name = AAZStrType(
flags={"read_only": True},
)
_element.properties = AAZObjectType(
flags={"client_flatten": True},
)
_element.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_element.type = AAZStrType(
flags={"read_only": True},
)
properties = cls._schema_on_200.value.Element.properties
properties.logic_app_resource_id = AAZStrType(
serialized_name="logicAppResourceId",
flags={"required": True},
)
properties.workflow_id = AAZStrType(
serialized_name="workflowId",
)
system_data = cls._schema_on_200.value.Element.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
flags={"read_only": True},
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
flags={"read_only": True},
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
flags={"read_only": True},
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
flags={"read_only": True},
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
flags={"read_only": True},
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
flags={"read_only": True},
)
return cls._schema_on_200
|
class List(AAZCommand):
'''Get all actions of alert rule.
'''
def _handler(self, command_args):
pass
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
pass
def _execute_operations(self):
pass
def _output(self, *args, **kwargs):
pass
class ActionsListByAlertRule(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
| 23 | 1 | 13 | 1 | 12 | 0 | 1 | 0.02 | 1 | 2 | 1 | 0 | 3 | 0 | 4 | 4 | 202 | 27 | 172 | 41 | 149 | 3 | 75 | 33 | 60 | 2 | 1 | 1 | 16 |
11,093 |
Azure/azure-cli-extensions
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py
|
azext_containerapp.tests.latest.test_containerapp_commands.ContainerappRuntimeTests
|
class ContainerappRuntimeTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
super().__init__(*arg, random_config_dir=True, **kwargs)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northcentralus")
def test_containerapp_runtime_java_metrics_create(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
app = self.create_random_name(prefix='aca', length=24)
image = "mcr.microsoft.com/azurespringapps/samples/hello-world:0.0.1"
env = prepare_containerapp_env_for_app_e2e_tests(self)
def create_containerapp_with_runtime_java_metrics_args_and_check(args, expect_failure=False, checks=[]):
self.cmd(
f'containerapp create -g {resource_group} -n {app} --image {image} --environment {env} {args}', expect_failure=expect_failure)
if not expect_failure:
self.cmd(
f'containerapp show -g {resource_group} -n {app}', checks=checks)
# Delete container app
self.cmd(
f'containerapp delete -g {resource_group} -n {app} --yes')
# Create container app without runtime settings
create_containerapp_with_runtime_java_metrics_args_and_check('', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck("properties.configuration.runtime", None)
])
# Create container app with runtime=generic, it should not have runtime settings
create_containerapp_with_runtime_java_metrics_args_and_check('--runtime=generic', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck("properties.configuration.runtime", None)
])
# Create container app with runtime=java, it should have default java runtime settings
create_containerapp_with_runtime_java_metrics_args_and_check('--runtime=java', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True)
])
# Create container app with runtime=java and disable java metrics
create_containerapp_with_runtime_java_metrics_args_and_check('--runtime=java --enable-java-metrics=false', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", False)
])
# Create container app with runtime=java and enable java metrics
create_containerapp_with_runtime_java_metrics_args_and_check('--runtime=java --enable-java-metrics', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True)
])
# Create container app with enable java metrics without setting runtime explicitly
create_containerapp_with_runtime_java_metrics_args_and_check('--runtime=java --enable-java-metrics', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True)
])
# Unmatched runtime, runtime should be java when enable-java-metrics is set
create_containerapp_with_runtime_java_metrics_args_and_check(
'--runtime=generic --enable-java-metrics', expect_failure=True)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northcentralus")
def test_containerapp_runtime_java_metrics_update(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
app = self.create_random_name(prefix='aca', length=24)
image = "mcr.microsoft.com/azurespringapps/samples/hello-world:0.0.1"
env = prepare_containerapp_env_for_app_e2e_tests(self)
# Create container app without enabling java metrics
self.cmd(
f'containerapp create -g {resource_group} -n {app} --image {image} --environment {env}')
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck("properties.configuration.runtime", None)
])
# Update contaier app without runtime settings, it should keep the same runtime settings
self.cmd(f'containerapp update -g {resource_group} -n {app} --cpu 0.5 --memory 1Gi', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck("properties.configuration.runtime", None)
])
self.cmd(f'containerapp update -g {resource_group} -n {app} --enable-java-metrics', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True)
])
self.cmd(f'containerapp update -g {resource_group} -n {app} --cpu 0.25 --memory 0.5Gi', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True)
])
# Update container app with runtime=generic, it should erase runtime settings
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=generic', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck("properties.configuration.runtime", None)
])
# Update container app with runtime=java, it should setup default java runtime settings if not set before
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=java', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True)
])
# Update container app with only runtime=java will keep the previous settings if set before
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=java', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True)
])
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=java --enable-java-metrics', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True)
])
# Update container app with runtime=java, it should keep the same runtime settings
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=java', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True)
])
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=java --enable-java-metrics=false', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", False)
])
# Update container app with only runtime=java will keep the previous settings if set before
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=java', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", False)
])
# It will imply runtime=java when enable-java-metrics is set
self.cmd(f'containerapp update -g {resource_group} -n {app} --enable-java-metrics', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True)
])
self.cmd(f'containerapp update -g {resource_group} -n {app} --enable-java-metrics=false', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", False)
])
# Update container app failed with wrong runtime
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=generic --enable-java-metrics',
expect_failure=True)
# Delete container app
self.cmd(f'containerapp delete -g {resource_group} -n {app} --yes')
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northcentralus")
def test_containerapp_runtime_java_create(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
app = self.create_random_name(prefix='aca', length=24)
image = "mcr.microsoft.com/azurespringapps/samples/hello-world:0.0.1"
env = prepare_containerapp_env_for_app_e2e_tests(self)
def create_containerapp_with_runtime_java_agent_args_and_check(args, expect_failure=False, checks=[]):
self.cmd(f'containerapp create -g {resource_group} -n {app} --image {image} --environment {env} {args}',
expect_failure=expect_failure)
if not expect_failure:
self.cmd(
f'containerapp show -g {resource_group} -n {app}', checks=checks)
# Delete container app
self.cmd(
f'containerapp delete -g {resource_group} -n {app} --yes')
create_containerapp_with_runtime_java_agent_args_and_check('', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck("properties.configuration.runtime", None)
])
# Create container app with runtime=java, it should have default java runtime settings
create_containerapp_with_runtime_java_agent_args_and_check('--runtime=java', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True),
])
# Create container app with runtime=java and enable java agent
create_containerapp_with_runtime_java_agent_args_and_check('--runtime=java --enable-java-agent', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", True)
])
# Create container app with runtime=java and enable java metrics
create_containerapp_with_runtime_java_agent_args_and_check('--runtime=java --enable-java-metrics', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", True)
])
# Create container app with runtime=java and disable java agent
create_containerapp_with_runtime_java_agent_args_and_check('--runtime=java --enable-java-agent=false', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", False)
])
# Create container app with runtime=java and disable java metrics
create_containerapp_with_runtime_java_agent_args_and_check('--runtime=java --enable-java-metrics=false', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", False),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", False)
])
# Create container app with runtime=java and enable java metrics and disable java agent
create_containerapp_with_runtime_java_agent_args_and_check('--runtime=java --enable-java-metrics=true --enable-java-agent=false', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", False)
])
# Create container app with runtime=java and disable java metrics and enable java agent
create_containerapp_with_runtime_java_agent_args_and_check('--runtime=java --enable-java-metrics=false --enable-java-agent=true', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", False),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", True)
])
# Create container app with runtime=java and enable java metrics and enable java agent
create_containerapp_with_runtime_java_agent_args_and_check('--runtime=java --enable-java-metrics=true --enable-java-agent=true', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", True)
])
# Create container app with runtime=java and disable java metrics and disable java agent
create_containerapp_with_runtime_java_agent_args_and_check('--runtime=java --enable-java-metrics=false --enable-java-agent=false', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", False),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", False)
])
# Unmatched runtime, runtime should be java when enable-java-agent is set
create_containerapp_with_runtime_java_agent_args_and_check('--runtime=generic --enable-java-agent',
expect_failure=True)
# Unmatched runtime, runtime should be java when enable-java-metrics is set
create_containerapp_with_runtime_java_agent_args_and_check('--runtime=generic --enable-java-metrics',
expect_failure=True)
# Unmatched runtime, runtime should be java when enable-java-metrics and enable-java-agent are set
create_containerapp_with_runtime_java_agent_args_and_check('--runtime=generic --enable-java-metrics --enable-java-agent',
expect_failure=True)
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northcentralus")
def test_containerapp_runtime_java_update(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
app = self.create_random_name(prefix='aca', length=24)
image = "mcr.microsoft.com/azurespringapps/samples/hello-world:0.0.1"
env = prepare_containerapp_env_for_app_e2e_tests(self)
# Create container app without enabling java metrics
self.cmd(
f'containerapp create -g {resource_group} -n {app} --image {image} --environment {env}')
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck("properties.configuration.runtime", None)
])
# Update contaier app without runtime settings, it should keep the same runtime settings
self.cmd(f'containerapp update -g {resource_group} -n {app} --cpu 0.5 --memory 1Gi', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck("properties.configuration.runtime", None)
])
self.cmd(f'containerapp update -g {resource_group} -n {app} --enable-java-metrics --enable-java-agent', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", True)
])
self.cmd(f'containerapp update -g {resource_group} -n {app} --cpu 0.25 --memory 0.5Gi', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", True)
])
self.cmd(f'containerapp update -g {resource_group} -n {app} --enable-java-agent=false', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", False)
])
self.cmd(f'containerapp update -g {resource_group} -n {app} --enable-java-metrics=false', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", False),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", False)
])
# Update container app with runtime=generic, it should erase runtime settings
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=generic', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck("properties.configuration.runtime", None)
])
# Update container app with runtime=java, it should setup default java runtime settings if not set before
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=java', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True),
JMESPathCheckNotExists(
"properties.configuration.runtime.java.javaAgent")
])
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=java --enable-java-metrics', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True),
JMESPathCheckNotExists(
"properties.configuration.runtime.java.javaAgent")
])
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=java --enable-java-agent', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", True)
])
# Update container app with runtime=java, it should keep the same runtime settings
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=java', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", True)
])
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=java --enable-java-metrics=false',
checks=[
JMESPathCheck(
'properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", False),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", True)
])
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=java', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", False),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", True)
])
# It will imply runtime=java when enable-java-metrics is set
self.cmd(f'containerapp update -g {resource_group} -n {app} --enable-java-metrics', checks=[
JMESPathCheck('properties.provisioningState', "Succeeded"),
JMESPathCheck(
"properties.configuration.runtime.java.enableMetrics", True),
JMESPathCheck(
"properties.configuration.runtime.java.javaAgent.enabled", True)
])
# Update container app failed with wrong runtime
self.cmd(f'containerapp update -g {resource_group} -n {app} --runtime=generic --enable-java-metrics',
expect_failure=True)
# Delete container app
self.cmd(f'containerapp delete -g {resource_group} -n {app} --yes')
|
class ContainerappRuntimeTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northcentralus")
def test_containerapp_runtime_java_metrics_create(self, resource_group):
pass
def create_containerapp_with_runtime_java_metrics_args_and_check(args, expect_failure=False, checks=[]):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northcentralus")
def test_containerapp_runtime_java_metrics_update(self, resource_group):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northcentralus")
def test_containerapp_runtime_java_create(self, resource_group):
pass
def create_containerapp_with_runtime_java_agent_args_and_check(args, expect_failure=False, checks=[]):
pass
@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="northcentralus")
def test_containerapp_runtime_java_update(self, resource_group):
pass
| 16 | 0 | 51 | 9 | 36 | 6 | 1 | 0.16 | 1 | 1 | 0 | 0 | 5 | 0 | 5 | 5 | 355 | 67 | 249 | 24 | 233 | 39 | 86 | 20 | 78 | 2 | 1 | 1 | 9 |
11,094 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.LakeHouseTableSource
|
class LakeHouseTableSource(CopySource):
"""A copy activity source for Microsoft Fabric LakeHouse Table.
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, JSON]
:ivar type: Copy source type. Required.
:vartype type: str
:ivar source_retry_count: Source retry count. Type: integer (or Expression with resultType
integer).
:vartype source_retry_count: JSON
:ivar source_retry_wait: Source retry wait. Type: string (or Expression with resultType
string), pattern: ((\\d+).)?(\\d\\d):(60|([0-5][0-9])):(60|([0-5][0-9])).
:vartype source_retry_wait: JSON
:ivar max_concurrent_connections: The maximum concurrent connection count for the source data
store. Type: integer (or Expression with resultType integer).
:vartype max_concurrent_connections: JSON
:ivar disable_metrics_collection: If true, disable data store metrics collection. Default is
false. Type: boolean (or Expression with resultType boolean).
:vartype disable_metrics_collection: JSON
:ivar timestamp_as_of: Query an older snapshot by timestamp. Type: string (or Expression with
resultType string).
:vartype timestamp_as_of: JSON
:ivar version_as_of: Query an older snapshot by version. Type: integer (or Expression with
resultType integer).
:vartype version_as_of: JSON
:ivar additional_columns: Specifies the additional columns to be added to source data. Type:
array of objects(AdditionalColumns) (or Expression with resultType array of objects).
:vartype additional_columns: JSON
"""
_validation = {
"type": {"required": True},
}
_attribute_map = {
"additional_properties": {"key": "", "type": "{object}"},
"type": {"key": "type", "type": "str"},
"source_retry_count": {"key": "sourceRetryCount", "type": "object"},
"source_retry_wait": {"key": "sourceRetryWait", "type": "object"},
"max_concurrent_connections": {"key": "maxConcurrentConnections", "type": "object"},
"disable_metrics_collection": {"key": "disableMetricsCollection", "type": "object"},
"timestamp_as_of": {"key": "timestampAsOf", "type": "object"},
"version_as_of": {"key": "versionAsOf", "type": "object"},
"additional_columns": {"key": "additionalColumns", "type": "object"},
}
def __init__(
self,
*,
additional_properties: Optional[Dict[str, JSON]] = None,
source_retry_count: Optional[JSON] = None,
source_retry_wait: Optional[JSON] = None,
max_concurrent_connections: Optional[JSON] = None,
disable_metrics_collection: Optional[JSON] = None,
timestamp_as_of: Optional[JSON] = None,
version_as_of: Optional[JSON] = None,
additional_columns: Optional[JSON] = None,
**kwargs: Any
) -> None:
"""
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
:keyword source_retry_count: Source retry count. Type: integer (or Expression with resultType
integer).
:paramtype source_retry_count: JSON
:keyword source_retry_wait: Source retry wait. Type: string (or Expression with resultType
string), pattern: ((\\d+).)?(\\d\\d):(60|([0-5][0-9])):(60|([0-5][0-9])).
:paramtype source_retry_wait: JSON
:keyword max_concurrent_connections: The maximum concurrent connection count for the source
data store. Type: integer (or Expression with resultType integer).
:paramtype max_concurrent_connections: JSON
:keyword disable_metrics_collection: If true, disable data store metrics collection. Default is
false. Type: boolean (or Expression with resultType boolean).
:paramtype disable_metrics_collection: JSON
:keyword timestamp_as_of: Query an older snapshot by timestamp. Type: string (or Expression
with resultType string).
:paramtype timestamp_as_of: JSON
:keyword version_as_of: Query an older snapshot by version. Type: integer (or Expression with
resultType integer).
:paramtype version_as_of: JSON
:keyword additional_columns: Specifies the additional columns to be added to source data. Type:
array of objects(AdditionalColumns) (or Expression with resultType array of objects).
:paramtype additional_columns: JSON
"""
super().__init__(
additional_properties=additional_properties,
source_retry_count=source_retry_count,
source_retry_wait=source_retry_wait,
max_concurrent_connections=max_concurrent_connections,
disable_metrics_collection=disable_metrics_collection,
**kwargs
)
self.type: str = "LakeHouseTableSource"
self.timestamp_as_of = timestamp_as_of
self.version_as_of = version_as_of
self.additional_columns = additional_columns
|
class LakeHouseTableSource(CopySource):
'''A copy activity source for Microsoft Fabric LakeHouse Table.
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, JSON]
:ivar type: Copy source type. Required.
:vartype type: str
:ivar source_retry_count: Source retry count. Type: integer (or Expression with resultType
integer).
:vartype source_retry_count: JSON
:ivar source_retry_wait: Source retry wait. Type: string (or Expression with resultType
string), pattern: ((\d+).)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])).
:vartype source_retry_wait: JSON
:ivar max_concurrent_connections: The maximum concurrent connection count for the source data
store. Type: integer (or Expression with resultType integer).
:vartype max_concurrent_connections: JSON
:ivar disable_metrics_collection: If true, disable data store metrics collection. Default is
false. Type: boolean (or Expression with resultType boolean).
:vartype disable_metrics_collection: JSON
:ivar timestamp_as_of: Query an older snapshot by timestamp. Type: string (or Expression with
resultType string).
:vartype timestamp_as_of: JSON
:ivar version_as_of: Query an older snapshot by version. Type: integer (or Expression with
resultType integer).
:vartype version_as_of: JSON
:ivar additional_columns: Specifies the additional columns to be added to source data. Type:
array of objects(AdditionalColumns) (or Expression with resultType array of objects).
:vartype additional_columns: JSON
'''
def __init__(
self,
*,
additional_properties: Optional[Dict[str, JSON]] = None,
source_retry_count: Optional[JSON] = None,
source_retry_wait: Optional[JSON] = None,
max_concurrent_connections: Optional[JSON] = None,
disable_metrics_collection: Optional[JSON] = None,
timestamp_as_of: Optional[JSON] = None,
version_as_of: Optional[JSON] = None,
additional_columns: Optional[JSON] = None,
**kwargs: Any
) -> None:
'''
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
:keyword source_retry_count: Source retry count. Type: integer (or Expression with resultType
integer).
:paramtype source_retry_count: JSON
:keyword source_retry_wait: Source retry wait. Type: string (or Expression with resultType
string), pattern: ((\d+).)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])).
:paramtype source_retry_wait: JSON
:keyword max_concurrent_connections: The maximum concurrent connection count for the source
data store. Type: integer (or Expression with resultType integer).
:paramtype max_concurrent_connections: JSON
:keyword disable_metrics_collection: If true, disable data store metrics collection. Default is
false. Type: boolean (or Expression with resultType boolean).
:paramtype disable_metrics_collection: JSON
:keyword timestamp_as_of: Query an older snapshot by timestamp. Type: string (or Expression
with resultType string).
:paramtype timestamp_as_of: JSON
:keyword version_as_of: Query an older snapshot by version. Type: integer (or Expression with
resultType integer).
:paramtype version_as_of: JSON
:keyword additional_columns: Specifies the additional columns to be added to source data. Type:
array of objects(AdditionalColumns) (or Expression with resultType array of objects).
:paramtype additional_columns: JSON
'''
pass
| 2 | 2 | 51 | 0 | 25 | 26 | 1 | 1.38 | 1 | 3 | 0 | 0 | 1 | 4 | 1 | 17 | 100 | 5 | 40 | 20 | 26 | 55 | 9 | 8 | 7 | 1 | 3 | 0 | 1 |
11,095 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.IntegrationRuntime
|
class IntegrationRuntime(_serialization.Model):
"""Azure Data Factory nested object which serves as a compute resource for activities.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
ManagedIntegrationRuntime, SelfHostedIntegrationRuntime
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, JSON]
:ivar type: Type of integration runtime. Required. Known values are: "Managed" and
"SelfHosted".
:vartype type: str or ~azure.mgmt.datafactory.models.IntegrationRuntimeType
:ivar description: Integration runtime description.
:vartype description: str
"""
_validation = {
"type": {"required": True},
}
_attribute_map = {
"additional_properties": {"key": "", "type": "{object}"},
"type": {"key": "type", "type": "str"},
"description": {"key": "description", "type": "str"},
}
_subtype_map = {"type": {"Managed": "ManagedIntegrationRuntime", "SelfHosted": "SelfHostedIntegrationRuntime"}}
def __init__(
self,
*,
additional_properties: Optional[Dict[str, JSON]] = None,
description: Optional[str] = None,
**kwargs: Any
) -> None:
"""
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
:keyword description: Integration runtime description.
:paramtype description: str
"""
super().__init__(**kwargs)
self.additional_properties = additional_properties
self.type: Optional[str] = None
self.description = description
|
class IntegrationRuntime(_serialization.Model):
'''Azure Data Factory nested object which serves as a compute resource for activities.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
ManagedIntegrationRuntime, SelfHostedIntegrationRuntime
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, JSON]
:ivar type: Type of integration runtime. Required. Known values are: "Managed" and
"SelfHosted".
:vartype type: str or ~azure.mgmt.datafactory.models.IntegrationRuntimeType
:ivar description: Integration runtime description.
:vartype description: str
'''
def __init__(
self,
*,
additional_properties: Optional[Dict[str, JSON]] = None,
description: Optional[str] = None,
**kwargs: Any
) -> None:
'''
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
:keyword description: Integration runtime description.
:paramtype description: str
'''
pass
| 2 | 2 | 18 | 0 | 11 | 7 | 1 | 0.95 | 1 | 3 | 0 | 2 | 1 | 3 | 1 | 16 | 48 | 7 | 21 | 14 | 13 | 20 | 9 | 8 | 7 | 1 | 2 | 0 | 1 |
11,096 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.IntegrationRuntimeAuthKeys
|
class IntegrationRuntimeAuthKeys(_serialization.Model):
"""The integration runtime authentication keys.
:ivar auth_key1: The primary integration runtime authentication key.
:vartype auth_key1: str
:ivar auth_key2: The secondary integration runtime authentication key.
:vartype auth_key2: str
"""
_attribute_map = {
"auth_key1": {"key": "authKey1", "type": "str"},
"auth_key2": {"key": "authKey2", "type": "str"},
}
def __init__(self, *, auth_key1: Optional[str] = None, auth_key2: Optional[str] = None, **kwargs: Any) -> None:
"""
:keyword auth_key1: The primary integration runtime authentication key.
:paramtype auth_key1: str
:keyword auth_key2: The secondary integration runtime authentication key.
:paramtype auth_key2: str
"""
super().__init__(**kwargs)
self.auth_key1 = auth_key1
self.auth_key2 = auth_key2
|
class IntegrationRuntimeAuthKeys(_serialization.Model):
'''The integration runtime authentication keys.
:ivar auth_key1: The primary integration runtime authentication key.
:vartype auth_key1: str
:ivar auth_key2: The secondary integration runtime authentication key.
:vartype auth_key2: str
'''
def __init__(self, *, auth_key1: Optional[str] = None, auth_key2: Optional[str] = None, **kwargs: Any) -> None:
'''
:keyword auth_key1: The primary integration runtime authentication key.
:paramtype auth_key1: str
:keyword auth_key2: The secondary integration runtime authentication key.
:paramtype auth_key2: 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 |
11,097 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.IntegrationRuntimeComputeProperties
|
class IntegrationRuntimeComputeProperties(_serialization.Model):
"""The compute resource properties for managed integration runtime.
:ivar additional_properties: Unmatched properties from the message are deserialized to this
collection.
:vartype additional_properties: dict[str, JSON]
:ivar location: The location for managed integration runtime. The supported regions could be
found on
https://docs.microsoft.com/en-us/azure/data-factory/data-factory-data-movement-activities.
:vartype location: str
:ivar node_size: The node size requirement to managed integration runtime.
:vartype node_size: str
:ivar number_of_nodes: The required number of nodes for managed integration runtime.
:vartype number_of_nodes: int
:ivar max_parallel_executions_per_node: Maximum parallel executions count per node for managed
integration runtime.
:vartype max_parallel_executions_per_node: int
:ivar data_flow_properties: Data flow properties for managed integration runtime.
:vartype data_flow_properties:
~azure.mgmt.datafactory.models.IntegrationRuntimeDataFlowProperties
:ivar v_net_properties: VNet properties for managed integration runtime.
:vartype v_net_properties: ~azure.mgmt.datafactory.models.IntegrationRuntimeVNetProperties
:ivar copy_compute_scale_properties: CopyComputeScale properties for managed integration
runtime.
:vartype copy_compute_scale_properties:
~azure.mgmt.datafactory.models.CopyComputeScaleProperties
:ivar pipeline_external_compute_scale_properties: PipelineExternalComputeScale properties for
managed integration runtime.
:vartype pipeline_external_compute_scale_properties:
~azure.mgmt.datafactory.models.PipelineExternalComputeScaleProperties
"""
_validation = {
"number_of_nodes": {"minimum": 1},
"max_parallel_executions_per_node": {"minimum": 1},
}
_attribute_map = {
"additional_properties": {"key": "", "type": "{object}"},
"location": {"key": "location", "type": "str"},
"node_size": {"key": "nodeSize", "type": "str"},
"number_of_nodes": {"key": "numberOfNodes", "type": "int"},
"max_parallel_executions_per_node": {"key": "maxParallelExecutionsPerNode", "type": "int"},
"data_flow_properties": {"key": "dataFlowProperties", "type": "IntegrationRuntimeDataFlowProperties"},
"v_net_properties": {"key": "vNetProperties", "type": "IntegrationRuntimeVNetProperties"},
"copy_compute_scale_properties": {"key": "copyComputeScaleProperties", "type": "CopyComputeScaleProperties"},
"pipeline_external_compute_scale_properties": {
"key": "pipelineExternalComputeScaleProperties",
"type": "PipelineExternalComputeScaleProperties",
},
}
def __init__(
self,
*,
additional_properties: Optional[Dict[str, JSON]] = None,
location: Optional[str] = None,
node_size: Optional[str] = None,
number_of_nodes: Optional[int] = None,
max_parallel_executions_per_node: Optional[int] = None,
data_flow_properties: Optional["_models.IntegrationRuntimeDataFlowProperties"] = None,
v_net_properties: Optional["_models.IntegrationRuntimeVNetProperties"] = None,
copy_compute_scale_properties: Optional["_models.CopyComputeScaleProperties"] = None,
pipeline_external_compute_scale_properties: Optional["_models.PipelineExternalComputeScaleProperties"] = None,
**kwargs: Any
) -> None:
"""
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
:keyword location: The location for managed integration runtime. The supported regions could be
found on
https://docs.microsoft.com/en-us/azure/data-factory/data-factory-data-movement-activities.
:paramtype location: str
:keyword node_size: The node size requirement to managed integration runtime.
:paramtype node_size: str
:keyword number_of_nodes: The required number of nodes for managed integration runtime.
:paramtype number_of_nodes: int
:keyword max_parallel_executions_per_node: Maximum parallel executions count per node for
managed integration runtime.
:paramtype max_parallel_executions_per_node: int
:keyword data_flow_properties: Data flow properties for managed integration runtime.
:paramtype data_flow_properties:
~azure.mgmt.datafactory.models.IntegrationRuntimeDataFlowProperties
:keyword v_net_properties: VNet properties for managed integration runtime.
:paramtype v_net_properties: ~azure.mgmt.datafactory.models.IntegrationRuntimeVNetProperties
:keyword copy_compute_scale_properties: CopyComputeScale properties for managed integration
runtime.
:paramtype copy_compute_scale_properties:
~azure.mgmt.datafactory.models.CopyComputeScaleProperties
:keyword pipeline_external_compute_scale_properties: PipelineExternalComputeScale properties
for managed integration runtime.
:paramtype pipeline_external_compute_scale_properties:
~azure.mgmt.datafactory.models.PipelineExternalComputeScaleProperties
"""
super().__init__(**kwargs)
self.additional_properties = additional_properties
self.location = location
self.node_size = node_size
self.number_of_nodes = number_of_nodes
self.max_parallel_executions_per_node = max_parallel_executions_per_node
self.data_flow_properties = data_flow_properties
self.v_net_properties = v_net_properties
self.copy_compute_scale_properties = copy_compute_scale_properties
self.pipeline_external_compute_scale_properties = pipeline_external_compute_scale_properties
|
class IntegrationRuntimeComputeProperties(_serialization.Model):
'''The compute resource properties for managed integration runtime.
:ivar additional_properties: Unmatched properties from the message are deserialized to this
collection.
:vartype additional_properties: dict[str, JSON]
:ivar location: The location for managed integration runtime. The supported regions could be
found on
https://docs.microsoft.com/en-us/azure/data-factory/data-factory-data-movement-activities.
:vartype location: str
:ivar node_size: The node size requirement to managed integration runtime.
:vartype node_size: str
:ivar number_of_nodes: The required number of nodes for managed integration runtime.
:vartype number_of_nodes: int
:ivar max_parallel_executions_per_node: Maximum parallel executions count per node for managed
integration runtime.
:vartype max_parallel_executions_per_node: int
:ivar data_flow_properties: Data flow properties for managed integration runtime.
:vartype data_flow_properties:
~azure.mgmt.datafactory.models.IntegrationRuntimeDataFlowProperties
:ivar v_net_properties: VNet properties for managed integration runtime.
:vartype v_net_properties: ~azure.mgmt.datafactory.models.IntegrationRuntimeVNetProperties
:ivar copy_compute_scale_properties: CopyComputeScale properties for managed integration
runtime.
:vartype copy_compute_scale_properties:
~azure.mgmt.datafactory.models.CopyComputeScaleProperties
:ivar pipeline_external_compute_scale_properties: PipelineExternalComputeScale properties for
managed integration runtime.
:vartype pipeline_external_compute_scale_properties:
~azure.mgmt.datafactory.models.PipelineExternalComputeScaleProperties
'''
def __init__(
self,
*,
additional_properties: Optional[Dict[str, JSON]] = None,
location: Optional[str] = None,
node_size: Optional[str] = None,
number_of_nodes: Optional[int] = None,
max_parallel_executions_per_node: Optional[int] = None,
data_flow_properties: Optional["_models.IntegrationRuntimeDataFlowProperties"] = None,
v_net_properties: Optional["_models.IntegrationRuntimeVNetProperties"] = None,
copy_compute_scale_properties: Optional["_models.CopyComputeScaleProperties"] = None,
pipeline_external_compute_scale_properties: Optional["_models.PipelineExternalComputeScaleProperties"] = None,
**kwargs: Any
) -> None:
'''
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
:keyword location: The location for managed integration runtime. The supported regions could be
found on
https://docs.microsoft.com/en-us/azure/data-factory/data-factory-data-movement-activities.
:paramtype location: str
:keyword node_size: The node size requirement to managed integration runtime.
:paramtype node_size: str
:keyword number_of_nodes: The required number of nodes for managed integration runtime.
:paramtype number_of_nodes: int
:keyword max_parallel_executions_per_node: Maximum parallel executions count per node for
managed integration runtime.
:paramtype max_parallel_executions_per_node: int
:keyword data_flow_properties: Data flow properties for managed integration runtime.
:paramtype data_flow_properties:
~azure.mgmt.datafactory.models.IntegrationRuntimeDataFlowProperties
:keyword v_net_properties: VNet properties for managed integration runtime.
:paramtype v_net_properties: ~azure.mgmt.datafactory.models.IntegrationRuntimeVNetProperties
:keyword copy_compute_scale_properties: CopyComputeScale properties for managed integration
runtime.
:paramtype copy_compute_scale_properties:
~azure.mgmt.datafactory.models.CopyComputeScaleProperties
:keyword pipeline_external_compute_scale_properties: PipelineExternalComputeScale properties
for managed integration runtime.
:paramtype pipeline_external_compute_scale_properties:
~azure.mgmt.datafactory.models.PipelineExternalComputeScaleProperties
'''
pass
| 2 | 2 | 53 | 0 | 24 | 29 | 1 | 1.35 | 1 | 4 | 0 | 0 | 1 | 9 | 1 | 16 | 105 | 4 | 43 | 26 | 28 | 58 | 14 | 13 | 12 | 1 | 2 | 0 | 1 |
11,098 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.IntegrationRuntimeConnectionInfo
|
class IntegrationRuntimeConnectionInfo(_serialization.Model):
"""Connection information for encrypting the on-premises data source credentials.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar additional_properties: Unmatched properties from the message are deserialized to this
collection.
:vartype additional_properties: dict[str, JSON]
:ivar service_token: The token generated in service. Callers use this token to authenticate to
integration runtime.
:vartype service_token: str
:ivar identity_cert_thumbprint: The integration runtime SSL certificate thumbprint. Click-Once
application uses it to do server validation.
:vartype identity_cert_thumbprint: str
:ivar host_service_uri: The on-premises integration runtime host URL.
:vartype host_service_uri: str
:ivar version: The integration runtime version.
:vartype version: str
:ivar public_key: The public key for encrypting a credential when transferring the credential
to the integration runtime.
:vartype public_key: str
:ivar is_identity_cert_exprired: Whether the identity certificate is expired.
:vartype is_identity_cert_exprired: bool
"""
_validation = {
"service_token": {"readonly": True},
"identity_cert_thumbprint": {"readonly": True},
"host_service_uri": {"readonly": True},
"version": {"readonly": True},
"public_key": {"readonly": True},
"is_identity_cert_exprired": {"readonly": True},
}
_attribute_map = {
"additional_properties": {"key": "", "type": "{object}"},
"service_token": {"key": "serviceToken", "type": "str"},
"identity_cert_thumbprint": {"key": "identityCertThumbprint", "type": "str"},
"host_service_uri": {"key": "hostServiceUri", "type": "str"},
"version": {"key": "version", "type": "str"},
"public_key": {"key": "publicKey", "type": "str"},
"is_identity_cert_exprired": {"key": "isIdentityCertExprired", "type": "bool"},
}
def __init__(self, *, additional_properties: Optional[Dict[str, JSON]] = None, **kwargs: Any) -> None:
"""
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
"""
super().__init__(**kwargs)
self.additional_properties = additional_properties
self.service_token = None
self.identity_cert_thumbprint = None
self.host_service_uri = None
self.version = None
self.public_key = None
self.is_identity_cert_exprired = None
|
class IntegrationRuntimeConnectionInfo(_serialization.Model):
'''Connection information for encrypting the on-premises data source credentials.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar additional_properties: Unmatched properties from the message are deserialized to this
collection.
:vartype additional_properties: dict[str, JSON]
:ivar service_token: The token generated in service. Callers use this token to authenticate to
integration runtime.
:vartype service_token: str
:ivar identity_cert_thumbprint: The integration runtime SSL certificate thumbprint. Click-Once
application uses it to do server validation.
:vartype identity_cert_thumbprint: str
:ivar host_service_uri: The on-premises integration runtime host URL.
:vartype host_service_uri: str
:ivar version: The integration runtime version.
:vartype version: str
:ivar public_key: The public key for encrypting a credential when transferring the credential
to the integration runtime.
:vartype public_key: str
:ivar is_identity_cert_exprired: Whether the identity certificate is expired.
:vartype is_identity_cert_exprired: bool
'''
def __init__(self, *, additional_properties: Optional[Dict[str, JSON]] = None, **kwargs: Any) -> None:
'''
:keyword additional_properties: Unmatched properties from the message are deserialized to this
collection.
:paramtype additional_properties: dict[str, JSON]
'''
pass
| 2 | 2 | 14 | 0 | 9 | 5 | 1 | 0.96 | 1 | 3 | 0 | 0 | 1 | 7 | 1 | 16 | 58 | 5 | 27 | 11 | 25 | 26 | 12 | 11 | 10 | 1 | 2 | 0 | 1 |
11,099 |
Azure/azure-cli-extensions
|
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_models_py3.py
|
azext_datafactory.vendored_sdks.datafactory.models._models_py3.IntegrationRuntimeCustomSetupScriptProperties
|
class IntegrationRuntimeCustomSetupScriptProperties(_serialization.Model): # pylint: disable=name-too-long
"""Custom setup script properties for a managed dedicated integration runtime.
:ivar blob_container_uri: The URI of the Azure blob container that contains the custom setup
script.
:vartype blob_container_uri: str
:ivar sas_token: The SAS token of the Azure blob container.
:vartype sas_token: ~azure.mgmt.datafactory.models.SecureString
"""
_attribute_map = {
"blob_container_uri": {"key": "blobContainerUri", "type": "str"},
"sas_token": {"key": "sasToken", "type": "SecureString"},
}
def __init__(
self,
*,
blob_container_uri: Optional[str] = None,
sas_token: Optional["_models.SecureString"] = None,
**kwargs: Any
) -> None:
"""
:keyword blob_container_uri: The URI of the Azure blob container that contains the custom setup
script.
:paramtype blob_container_uri: str
:keyword sas_token: The SAS token of the Azure blob container.
:paramtype sas_token: ~azure.mgmt.datafactory.models.SecureString
"""
super().__init__(**kwargs)
self.blob_container_uri = blob_container_uri
self.sas_token = sas_token
|
class IntegrationRuntimeCustomSetupScriptProperties(_serialization.Model):
'''Custom setup script properties for a managed dedicated integration runtime.
:ivar blob_container_uri: The URI of the Azure blob container that contains the custom setup
script.
:vartype blob_container_uri: str
:ivar sas_token: The SAS token of the Azure blob container.
:vartype sas_token: ~azure.mgmt.datafactory.models.SecureString
'''
def __init__(
self,
*,
blob_container_uri: Optional[str] = None,
sas_token: Optional["_models.SecureString"] = None,
**kwargs: Any
) -> None:
'''
:keyword blob_container_uri: The URI of the Azure blob container that contains the custom setup
script.
:paramtype blob_container_uri: str
:keyword sas_token: The SAS token of the Azure blob container.
:paramtype sas_token: ~azure.mgmt.datafactory.models.SecureString
'''
pass
| 2 | 2 | 17 | 0 | 10 | 7 | 1 | 1 | 1 | 3 | 0 | 0 | 1 | 2 | 1 | 16 | 32 | 3 | 15 | 11 | 7 | 15 | 6 | 5 | 4 | 1 | 2 | 0 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.