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
9,400
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/volume/_migrate_backup.py
azext_netappfiles_preview.aaz.latest.netappfiles.volume._migrate_backup.MigrateBackup.BackupsUnderVolumeMigrateBackups
class BackupsUnderVolumeMigrateBackups(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, None, 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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/migrateBackups", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "poolName", self.ctx.args.pool_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, ), **self.serialize_url_param( "volumeName", self.ctx.args.volume_name, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2024-03-01-preview", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Content-Type", "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("backupVaultId", AAZStrType, ".backup_vault_id", typ_kwargs={ "flags": {"required": True}}) return self.serialize_content(_content_value)
class BackupsUnderVolumeMigrateBackups(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
16
0
9
0
9
0
1
0
1
0
0
0
8
1
8
8
88
10
78
24
62
0
27
16
18
2
1
1
9
9,401
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/volume/_list_quota_report.py
azext_netappfiles_preview.aaz.latest.netappfiles.volume._list_quota_report.ListQuotaReport.VolumesListQuotaReport
class VolumesListQuotaReport(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": "location"}, 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": "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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/listQuotaReport", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "poolName", self.ctx.args.pool_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, ), **self.serialize_url_param( "volumeName", self.ctx.args.volume_name, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2024-03-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", ) _schema_on_200.value = AAZListType() value = cls._schema_on_200.value value.Element = AAZObjectType() _element = cls._schema_on_200.value.Element _element.is_derived_quota = AAZBoolType( serialized_name="isDerivedQuota", ) _element.percentage_used = AAZFloatType( serialized_name="percentageUsed", ) _element.quota_limit_total_in_ki_bs = AAZIntType( serialized_name="quotaLimitTotalInKiBs", ) _element.quota_limit_used_in_ki_bs = AAZIntType( serialized_name="quotaLimitUsedInKiBs", ) _element.quota_target = AAZStrType( serialized_name="quotaTarget", ) _element.quota_type = AAZStrType( serialized_name="quotaType", ) return cls._schema_on_200
class VolumesListQuotaReport(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
12
0
1
0
1
0
0
0
8
1
9
9
134
16
118
29
101
0
46
21
36
3
1
1
12
9,402
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/volume/_list.py
azext_netappfiles_preview.aaz.latest.netappfiles.volume._list.List.VolumesList
class VolumesList(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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "poolName", self.ctx.args.pool_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-03-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", ) _schema_on_200.value = AAZListType() value = cls._schema_on_200.value value.Element = AAZObjectType() _element = cls._schema_on_200.value.Element _element.etag = AAZStrType( flags={"read_only": True}, ) _element.id = AAZStrType( flags={"read_only": True}, ) _element.location = AAZStrType( flags={"required": True}, ) _element.name = AAZStrType( flags={"read_only": True}, ) _element.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _element.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) _element.tags = AAZDictType() _element.type = AAZStrType( flags={"read_only": True}, ) _element.zones = AAZListType() properties = cls._schema_on_200.value.Element.properties properties.accept_grow_capacity_pool_for_short_term_clone_split = AAZStrType( serialized_name="acceptGrowCapacityPoolForShortTermCloneSplit", ) properties.actual_throughput_mibps = AAZFloatType( serialized_name="actualThroughputMibps", flags={"read_only": True}, ) properties.avs_data_store = AAZStrType( serialized_name="avsDataStore", ) properties.backup_id = AAZStrType( serialized_name="backupId", nullable=True, ) properties.baremetal_tenant_id = AAZStrType( serialized_name="baremetalTenantId", flags={"read_only": True}, ) properties.capacity_pool_resource_id = AAZStrType( serialized_name="capacityPoolResourceId", ) properties.clone_progress = AAZIntType( serialized_name="cloneProgress", nullable=True, flags={"read_only": True}, ) properties.cool_access = AAZBoolType( serialized_name="coolAccess", ) properties.cool_access_retrieval_policy = AAZStrType( serialized_name="coolAccessRetrievalPolicy", ) properties.coolness_period = AAZIntType( serialized_name="coolnessPeriod", ) properties.creation_token = AAZStrType( serialized_name="creationToken", flags={"required": True}, ) properties.data_protection = AAZObjectType( serialized_name="dataProtection", ) properties.data_store_resource_id = AAZListType( serialized_name="dataStoreResourceId", flags={"read_only": True}, ) properties.default_group_quota_in_ki_bs = AAZIntType( serialized_name="defaultGroupQuotaInKiBs", ) properties.default_user_quota_in_ki_bs = AAZIntType( serialized_name="defaultUserQuotaInKiBs", ) properties.delete_base_snapshot = AAZBoolType( serialized_name="deleteBaseSnapshot", ) properties.enable_subvolumes = AAZStrType( serialized_name="enableSubvolumes", ) properties.encrypted = AAZBoolType( flags={"read_only": True}, ) properties.encryption_key_source = AAZStrType( serialized_name="encryptionKeySource", ) properties.export_policy = AAZObjectType( serialized_name="exportPolicy", ) properties.file_access_logs = AAZStrType( serialized_name="fileAccessLogs", flags={"read_only": True}, ) properties.file_system_id = AAZStrType( serialized_name="fileSystemId", flags={"read_only": True}, ) properties.inherited_size_in_bytes = AAZIntType( serialized_name="inheritedSizeInBytes", nullable=True, flags={"read_only": True}, ) properties.is_default_quota_enabled = AAZBoolType( serialized_name="isDefaultQuotaEnabled", ) properties.is_large_volume = AAZBoolType( serialized_name="isLargeVolume", ) properties.is_restoring = AAZBoolType( serialized_name="isRestoring", ) properties.kerberos_enabled = AAZBoolType( serialized_name="kerberosEnabled", ) properties.key_vault_private_endpoint_resource_id = AAZStrType( serialized_name="keyVaultPrivateEndpointResourceId", ) properties.language = AAZStrType( nullable=True, ) properties.ldap_enabled = AAZBoolType( serialized_name="ldapEnabled", ) properties.maximum_number_of_files = AAZIntType( serialized_name="maximumNumberOfFiles", flags={"read_only": True}, ) properties.mount_targets = AAZListType( serialized_name="mountTargets", flags={"read_only": True}, ) properties.network_features = AAZStrType( serialized_name="networkFeatures", ) properties.network_sibling_set_id = AAZStrType( serialized_name="networkSiblingSetId", flags={"read_only": True}, ) properties.originating_resource_id = AAZStrType( serialized_name="originatingResourceId", nullable=True, flags={"read_only": True}, ) properties.placement_rules = AAZListType( serialized_name="placementRules", ) properties.protocol_types = AAZListType( serialized_name="protocolTypes", ) properties.provisioned_availability_zone = AAZStrType( serialized_name="provisionedAvailabilityZone", nullable=True, flags={"read_only": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.proximity_placement_group = AAZStrType( serialized_name="proximityPlacementGroup", ) properties.security_style = AAZStrType( serialized_name="securityStyle", ) properties.service_level = AAZStrType( serialized_name="serviceLevel", ) properties.smb_access_based_enumeration = AAZStrType( serialized_name="smbAccessBasedEnumeration", nullable=True, ) properties.smb_continuously_available = AAZBoolType( serialized_name="smbContinuouslyAvailable", ) properties.smb_encryption = AAZBoolType( serialized_name="smbEncryption", ) properties.smb_non_browsable = AAZStrType( serialized_name="smbNonBrowsable", ) properties.snapshot_directory_visible = AAZBoolType( serialized_name="snapshotDirectoryVisible", ) properties.snapshot_id = AAZStrType( serialized_name="snapshotId", nullable=True, ) properties.storage_to_network_proximity = AAZStrType( serialized_name="storageToNetworkProximity", flags={"read_only": True}, ) properties.subnet_id = AAZStrType( serialized_name="subnetId", flags={"required": True}, ) properties.t2_network = AAZStrType( serialized_name="t2Network", flags={"read_only": True}, ) properties.throughput_mibps = AAZFloatType( serialized_name="throughputMibps", nullable=True, ) properties.unix_permissions = AAZStrType( serialized_name="unixPermissions", nullable=True, ) properties.usage_threshold = AAZIntType( serialized_name="usageThreshold", flags={"required": True}, ) properties.volume_group_name = AAZStrType( serialized_name="volumeGroupName", flags={"read_only": True}, ) properties.volume_spec_name = AAZStrType( serialized_name="volumeSpecName", ) properties.volume_type = AAZStrType( serialized_name="volumeType", ) data_protection = cls._schema_on_200.value.Element.properties.data_protection data_protection.backup = AAZObjectType() data_protection.replication = AAZObjectType() data_protection.snapshot = AAZObjectType() data_protection.volume_relocation = AAZObjectType( serialized_name="volumeRelocation", ) backup = cls._schema_on_200.value.Element.properties.data_protection.backup backup.backup_policy_id = AAZStrType( serialized_name="backupPolicyId", ) backup.backup_vault_id = AAZStrType( serialized_name="backupVaultId", ) backup.policy_enforced = AAZBoolType( serialized_name="policyEnforced", ) replication = cls._schema_on_200.value.Element.properties.data_protection.replication replication.destination_replications = AAZListType( serialized_name="destinationReplications", flags={"read_only": True}, ) replication.endpoint_type = AAZStrType( serialized_name="endpointType", ) replication.remote_path = AAZObjectType( serialized_name="remotePath", ) replication.remote_volume_region = AAZStrType( serialized_name="remoteVolumeRegion", ) replication.remote_volume_resource_id = AAZStrType( serialized_name="remoteVolumeResourceId", flags={"required": True}, ) replication.replication_id = AAZStrType( serialized_name="replicationId", flags={"read_only": True}, ) replication.replication_schedule = AAZStrType( serialized_name="replicationSchedule", ) destination_replications = cls._schema_on_200.value.Element.properties.data_protection.replication.destination_replications destination_replications.Element = AAZObjectType() _element = cls._schema_on_200.value.Element.properties.data_protection.replication.destination_replications.Element _element.region = AAZStrType() _element.replication_type = AAZStrType( serialized_name="replicationType", ) _element.resource_id = AAZStrType( serialized_name="resourceId", ) _element.zone = AAZStrType() remote_path = cls._schema_on_200.value.Element.properties.data_protection.replication.remote_path remote_path.external_host_name = AAZStrType( serialized_name="externalHostName", flags={"required": True}, ) remote_path.server_name = AAZStrType( serialized_name="serverName", flags={"required": True}, ) remote_path.volume_name = AAZStrType( serialized_name="volumeName", flags={"required": True}, ) snapshot = cls._schema_on_200.value.Element.properties.data_protection.snapshot snapshot.snapshot_policy_id = AAZStrType( serialized_name="snapshotPolicyId", ) volume_relocation = cls._schema_on_200.value.Element.properties.data_protection.volume_relocation volume_relocation.ready_to_be_finalized = AAZBoolType( serialized_name="readyToBeFinalized", flags={"read_only": True}, ) volume_relocation.relocation_requested = AAZBoolType( serialized_name="relocationRequested", ) data_store_resource_id = cls._schema_on_200.value.Element.properties.data_store_resource_id data_store_resource_id.Element = AAZStrType() export_policy = cls._schema_on_200.value.Element.properties.export_policy export_policy.rules = AAZListType() rules = cls._schema_on_200.value.Element.properties.export_policy.rules rules.Element = AAZObjectType() _element = cls._schema_on_200.value.Element.properties.export_policy.rules.Element _element.allowed_clients = AAZStrType( serialized_name="allowedClients", ) _element.chown_mode = AAZStrType( serialized_name="chownMode", ) _element.cifs = AAZBoolType() _element.has_root_access = AAZBoolType( serialized_name="hasRootAccess", ) _element.kerberos5_read_only = AAZBoolType( serialized_name="kerberos5ReadOnly", ) _element.kerberos5_read_write = AAZBoolType( serialized_name="kerberos5ReadWrite", ) _element.kerberos5i_read_only = AAZBoolType( serialized_name="kerberos5iReadOnly", ) _element.kerberos5i_read_write = AAZBoolType( serialized_name="kerberos5iReadWrite", ) _element.kerberos5p_read_only = AAZBoolType( serialized_name="kerberos5pReadOnly", ) _element.kerberos5p_read_write = AAZBoolType( serialized_name="kerberos5pReadWrite", ) _element.nfsv3 = AAZBoolType() _element.nfsv41 = AAZBoolType() _element.rule_index = AAZIntType( serialized_name="ruleIndex", ) _element.unix_read_only = AAZBoolType( serialized_name="unixReadOnly", ) _element.unix_read_write = AAZBoolType( serialized_name="unixReadWrite", ) mount_targets = cls._schema_on_200.value.Element.properties.mount_targets mount_targets.Element = AAZObjectType() _element = cls._schema_on_200.value.Element.properties.mount_targets.Element _element.file_system_id = AAZStrType( serialized_name="fileSystemId", flags={"required": True}, ) _element.ip_address = AAZStrType( serialized_name="ipAddress", flags={"read_only": True}, ) _element.mount_target_id = AAZStrType( serialized_name="mountTargetId", flags={"read_only": True}, ) _element.smb_server_fqdn = AAZStrType( serialized_name="smbServerFqdn", ) placement_rules = cls._schema_on_200.value.Element.properties.placement_rules placement_rules.Element = AAZObjectType() _element = cls._schema_on_200.value.Element.properties.placement_rules.Element _element.key = AAZStrType( flags={"required": True}, ) _element.value = AAZStrType( flags={"required": True}, ) protocol_types = cls._schema_on_200.value.Element.properties.protocol_types protocol_types.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", ) tags = cls._schema_on_200.value.Element.tags tags.Element = AAZStrType() zones = cls._schema_on_200.value.Element.zones zones.Element = AAZStrType() return cls._schema_on_200
class VolumesList(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
55
3
52
0
1
0
1
0
0
0
8
0
9
9
517
37
480
45
463
0
185
38
175
2
1
1
11
9,403
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/volume/_delete.py
azext_netappfiles_preview.aaz.latest.netappfiles.volume._delete.Delete.VolumesDelete
class VolumesDelete(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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "poolName", self.ctx.args.pool_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, ), **self.serialize_url_param( "volumeName", self.ctx.args.volume_name, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "forceDelete", self.ctx.args.force_delete, ), **self.serialize_query_param( "api-version", "2024-03-01-preview", required=True, ), } return parameters def on_204(self, session): pass def on_200_201(self, session): pass
class VolumesDelete(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
10
0
10
0
1
0
1
0
0
0
8
1
8
8
95
9
86
20
72
0
28
14
19
4
1
1
11
9,404
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/volume/_create.py
azext_netappfiles_preview.aaz.latest.netappfiles.volume._create.Create.VolumesCreateOrUpdate
class VolumesCreateOrUpdate(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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "poolName", self.ctx.args.pool_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, ), **self.serialize_url_param( "volumeName", self.ctx.args.volume_name, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2024-03-01-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": {"required": True, "client_flatten": True}}) _builder.set_prop("tags", AAZDictType, ".tags") _builder.set_prop("zones", AAZListType, ".zones") properties = _builder.get(".properties") if properties is not None: properties.set_prop("acceptGrowCapacityPoolForShortTermCloneSplit", AAZStrType, ".accept_grow_capacity_pool_for_short_term_clone_split") properties.set_prop( "avsDataStore", AAZStrType, ".avs_data_store") properties.set_prop("backupId", AAZStrType, ".backup_id", typ_kwargs={"nullable": True}) properties.set_prop("capacityPoolResourceId", AAZStrType, ".capacity_pool_resource_id") properties.set_prop("coolAccess", AAZBoolType, ".cool_access") properties.set_prop("coolAccessRetrievalPolicy", AAZStrType, ".cool_access_retrieval_policy") properties.set_prop( "coolnessPeriod", AAZIntType, ".coolness_period") properties.set_prop("creationToken", AAZStrType, ".creation_token", typ_kwargs={ "flags": {"required": True}}) properties.set_prop("dataProtection", AAZObjectType) properties.set_prop("defaultGroupQuotaInKiBs", AAZIntType, ".default_group_quota_in_ki_bs") properties.set_prop("defaultUserQuotaInKiBs", AAZIntType, ".default_user_quota_in_ki_bs") properties.set_prop("deleteBaseSnapshot", AAZBoolType, ".delete_base_snapshot") properties.set_prop("enableSubvolumes", AAZStrType, ".enable_subvolumes") properties.set_prop("encryptionKeySource", AAZStrType, ".encryption_key_source") properties.set_prop("exportPolicy", AAZObjectType) properties.set_prop("isDefaultQuotaEnabled", AAZBoolType, ".is_default_quota_enabled") properties.set_prop( "isLargeVolume", AAZBoolType, ".is_large_volume") properties.set_prop( "isRestoring", AAZBoolType, ".is_restoring") properties.set_prop("kerberosEnabled", AAZBoolType, ".kerberos_enabled") properties.set_prop("keyVaultPrivateEndpointResourceId", AAZStrType, ".key_vault_private_endpoint_resource_id") properties.set_prop("language", AAZStrType, ".language", typ_kwargs={"nullable": True}) properties.set_prop( "ldapEnabled", AAZBoolType, ".ldap_enabled") properties.set_prop("networkFeatures", AAZStrType, ".network_features") properties.set_prop( "placementRules", AAZListType, ".placement_rules") properties.set_prop( "protocolTypes", AAZListType, ".protocol_types") properties.set_prop("proximityPlacementGroup", AAZStrType, ".proximity_placement_group") properties.set_prop( "securityStyle", AAZStrType, ".security_style") properties.set_prop( "serviceLevel", AAZStrType, ".service_level") properties.set_prop("smbAccessBasedEnumeration", AAZStrType, ".smb_access_based_enumeration", typ_kwargs={"nullable": True}) properties.set_prop("smbContinuouslyAvailable", AAZBoolType, ".smb_continuously_available") properties.set_prop( "smbEncryption", AAZBoolType, ".smb_encryption") properties.set_prop("smbNonBrowsable", AAZStrType, ".smb_non_browsable") properties.set_prop("snapshotDirectoryVisible", AAZBoolType, ".snapshot_directory_visible") properties.set_prop("snapshotId", AAZStrType, ".snapshot_id", typ_kwargs={"nullable": True}) properties.set_prop("subnetId", AAZStrType, ".subnet_id", typ_kwargs={ "flags": {"required": True}}) properties.set_prop("throughputMibps", AAZFloatType, ".throughput_mibps", typ_kwargs={"nullable": True}) properties.set_prop("unixPermissions", AAZStrType, ".unix_permissions", typ_kwargs={"nullable": True}) properties.set_prop("usageThreshold", AAZIntType, ".usage_threshold", typ_kwargs={ "flags": {"required": True}}) properties.set_prop( "volumeSpecName", AAZStrType, ".volume_spec_name") properties.set_prop("volumeType", AAZStrType, ".volume_type") data_protection = _builder.get(".properties.dataProtection") if data_protection is not None: data_protection.set_prop("backup", AAZObjectType) data_protection.set_prop("replication", AAZObjectType) data_protection.set_prop("snapshot", AAZObjectType) data_protection.set_prop("volumeRelocation", AAZObjectType) backup = _builder.get(".properties.dataProtection.backup") if backup is not None: backup.set_prop("backupPolicyId", AAZStrType, ".backup_policy_id") backup.set_prop("backupVaultId", AAZStrType, ".backup_vault_id") backup.set_prop("policyEnforced", AAZBoolType, ".policy_enforced") replication = _builder.get( ".properties.dataProtection.replication") if replication is not None: replication.set_prop( "endpointType", AAZStrType, ".endpoint_type") replication.set_prop( "remotePath", AAZObjectType, ".remote_path") replication.set_prop("remoteVolumeRegion", AAZStrType, ".remote_volume_region") replication.set_prop("remoteVolumeResourceId", AAZStrType, ".remote_volume_resource_id", typ_kwargs={ "flags": {"required": True}}) replication.set_prop("replicationSchedule", AAZStrType, ".replication_schedule") remote_path = _builder.get( ".properties.dataProtection.replication.remotePath") if remote_path is not None: remote_path.set_prop("externalHostName", AAZStrType, ".external_host_name", typ_kwargs={ "flags": {"required": True}}) remote_path.set_prop("serverName", AAZStrType, ".server_name", typ_kwargs={ "flags": {"required": True}}) remote_path.set_prop("volumeName", AAZStrType, ".volume_name", typ_kwargs={ "flags": {"required": True}}) snapshot = _builder.get(".properties.dataProtection.snapshot") if snapshot is not None: snapshot.set_prop("snapshotPolicyId", AAZStrType, ".snapshot_policy_id") volume_relocation = _builder.get( ".properties.dataProtection.volumeRelocation") if volume_relocation is not None: volume_relocation.set_prop( "relocationRequested", AAZBoolType, ".relocation_requested") export_policy = _builder.get(".properties.exportPolicy") if export_policy is not None: export_policy.set_prop( "rules", AAZListType, ".export_policy_rules") rules = _builder.get(".properties.exportPolicy.rules") if rules is not None: rules.set_elements(AAZObjectType, ".") _elements = _builder.get(".properties.exportPolicy.rules[]") if _elements is not None: _elements.set_prop( "allowedClients", AAZStrType, ".allowed_clients") _elements.set_prop("chownMode", AAZStrType, ".chown_mode") _elements.set_prop("cifs", AAZBoolType, ".cifs") _elements.set_prop( "hasRootAccess", AAZBoolType, ".has_root_access") _elements.set_prop("kerberos5ReadOnly", AAZBoolType, ".kerberos5_read_only") _elements.set_prop("kerberos5ReadWrite", AAZBoolType, ".kerberos5_read_write") _elements.set_prop("kerberos5iReadOnly", AAZBoolType, ".kerberos5i_read_only") _elements.set_prop("kerberos5iReadWrite", AAZBoolType, ".kerberos5i_read_write") _elements.set_prop("kerberos5pReadOnly", AAZBoolType, ".kerberos5p_read_only") _elements.set_prop("kerberos5pReadWrite", AAZBoolType, ".kerberos5p_read_write") _elements.set_prop("nfsv3", AAZBoolType, ".nfsv3") _elements.set_prop("nfsv41", AAZBoolType, ".nfsv41") _elements.set_prop("ruleIndex", AAZIntType, ".rule_index") _elements.set_prop( "unixReadOnly", AAZBoolType, ".unix_read_only") _elements.set_prop( "unixReadWrite", AAZBoolType, ".unix_read_write") placement_rules = _builder.get(".properties.placementRules") if placement_rules is not None: placement_rules.set_elements(AAZObjectType, ".") _elements = _builder.get(".properties.placementRules[]") if _elements is not None: _elements.set_prop("key", AAZStrType, ".key", typ_kwargs={ "flags": {"required": True}}) _elements.set_prop("value", AAZStrType, ".value", typ_kwargs={ "flags": {"required": True}}) protocol_types = _builder.get(".properties.protocolTypes") if protocol_types is not None: protocol_types.set_elements(AAZStrType, ".") tags = _builder.get(".tags") if tags is not None: tags.set_elements(AAZStrType, ".") zones = _builder.get(".zones") if zones is not None: zones.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.etag = AAZStrType( flags={"read_only": True}, ) _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={"required": True, "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}, ) _schema_on_200_201.zones = AAZListType() properties = cls._schema_on_200_201.properties properties.accept_grow_capacity_pool_for_short_term_clone_split = AAZStrType( serialized_name="acceptGrowCapacityPoolForShortTermCloneSplit", ) properties.actual_throughput_mibps = AAZFloatType( serialized_name="actualThroughputMibps", flags={"read_only": True}, ) properties.avs_data_store = AAZStrType( serialized_name="avsDataStore", ) properties.backup_id = AAZStrType( serialized_name="backupId", nullable=True, ) properties.baremetal_tenant_id = AAZStrType( serialized_name="baremetalTenantId", flags={"read_only": True}, ) properties.capacity_pool_resource_id = AAZStrType( serialized_name="capacityPoolResourceId", ) properties.clone_progress = AAZIntType( serialized_name="cloneProgress", nullable=True, flags={"read_only": True}, ) properties.cool_access = AAZBoolType( serialized_name="coolAccess", ) properties.cool_access_retrieval_policy = AAZStrType( serialized_name="coolAccessRetrievalPolicy", ) properties.coolness_period = AAZIntType( serialized_name="coolnessPeriod", ) properties.creation_token = AAZStrType( serialized_name="creationToken", flags={"required": True}, ) properties.data_protection = AAZObjectType( serialized_name="dataProtection", ) properties.data_store_resource_id = AAZListType( serialized_name="dataStoreResourceId", flags={"read_only": True}, ) properties.default_group_quota_in_ki_bs = AAZIntType( serialized_name="defaultGroupQuotaInKiBs", ) properties.default_user_quota_in_ki_bs = AAZIntType( serialized_name="defaultUserQuotaInKiBs", ) properties.delete_base_snapshot = AAZBoolType( serialized_name="deleteBaseSnapshot", ) properties.enable_subvolumes = AAZStrType( serialized_name="enableSubvolumes", ) properties.encrypted = AAZBoolType( flags={"read_only": True}, ) properties.encryption_key_source = AAZStrType( serialized_name="encryptionKeySource", ) properties.export_policy = AAZObjectType( serialized_name="exportPolicy", ) properties.file_access_logs = AAZStrType( serialized_name="fileAccessLogs", flags={"read_only": True}, ) properties.file_system_id = AAZStrType( serialized_name="fileSystemId", flags={"read_only": True}, ) properties.inherited_size_in_bytes = AAZIntType( serialized_name="inheritedSizeInBytes", nullable=True, flags={"read_only": True}, ) properties.is_default_quota_enabled = AAZBoolType( serialized_name="isDefaultQuotaEnabled", ) properties.is_large_volume = AAZBoolType( serialized_name="isLargeVolume", ) properties.is_restoring = AAZBoolType( serialized_name="isRestoring", ) properties.kerberos_enabled = AAZBoolType( serialized_name="kerberosEnabled", ) properties.key_vault_private_endpoint_resource_id = AAZStrType( serialized_name="keyVaultPrivateEndpointResourceId", ) properties.language = AAZStrType( nullable=True, ) properties.ldap_enabled = AAZBoolType( serialized_name="ldapEnabled", ) properties.maximum_number_of_files = AAZIntType( serialized_name="maximumNumberOfFiles", flags={"read_only": True}, ) properties.mount_targets = AAZListType( serialized_name="mountTargets", flags={"read_only": True}, ) properties.network_features = AAZStrType( serialized_name="networkFeatures", ) properties.network_sibling_set_id = AAZStrType( serialized_name="networkSiblingSetId", flags={"read_only": True}, ) properties.originating_resource_id = AAZStrType( serialized_name="originatingResourceId", nullable=True, flags={"read_only": True}, ) properties.placement_rules = AAZListType( serialized_name="placementRules", ) properties.protocol_types = AAZListType( serialized_name="protocolTypes", ) properties.provisioned_availability_zone = AAZStrType( serialized_name="provisionedAvailabilityZone", nullable=True, flags={"read_only": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.proximity_placement_group = AAZStrType( serialized_name="proximityPlacementGroup", ) properties.security_style = AAZStrType( serialized_name="securityStyle", ) properties.service_level = AAZStrType( serialized_name="serviceLevel", ) properties.smb_access_based_enumeration = AAZStrType( serialized_name="smbAccessBasedEnumeration", nullable=True, ) properties.smb_continuously_available = AAZBoolType( serialized_name="smbContinuouslyAvailable", ) properties.smb_encryption = AAZBoolType( serialized_name="smbEncryption", ) properties.smb_non_browsable = AAZStrType( serialized_name="smbNonBrowsable", ) properties.snapshot_directory_visible = AAZBoolType( serialized_name="snapshotDirectoryVisible", ) properties.snapshot_id = AAZStrType( serialized_name="snapshotId", nullable=True, ) properties.storage_to_network_proximity = AAZStrType( serialized_name="storageToNetworkProximity", flags={"read_only": True}, ) properties.subnet_id = AAZStrType( serialized_name="subnetId", flags={"required": True}, ) properties.t2_network = AAZStrType( serialized_name="t2Network", flags={"read_only": True}, ) properties.throughput_mibps = AAZFloatType( serialized_name="throughputMibps", nullable=True, ) properties.unix_permissions = AAZStrType( serialized_name="unixPermissions", nullable=True, ) properties.usage_threshold = AAZIntType( serialized_name="usageThreshold", flags={"required": True}, ) properties.volume_group_name = AAZStrType( serialized_name="volumeGroupName", flags={"read_only": True}, ) properties.volume_spec_name = AAZStrType( serialized_name="volumeSpecName", ) properties.volume_type = AAZStrType( serialized_name="volumeType", ) data_protection = cls._schema_on_200_201.properties.data_protection data_protection.backup = AAZObjectType() data_protection.replication = AAZObjectType() data_protection.snapshot = AAZObjectType() data_protection.volume_relocation = AAZObjectType( serialized_name="volumeRelocation", ) backup = cls._schema_on_200_201.properties.data_protection.backup backup.backup_policy_id = AAZStrType( serialized_name="backupPolicyId", ) backup.backup_vault_id = AAZStrType( serialized_name="backupVaultId", ) backup.policy_enforced = AAZBoolType( serialized_name="policyEnforced", ) replication = cls._schema_on_200_201.properties.data_protection.replication replication.destination_replications = AAZListType( serialized_name="destinationReplications", flags={"read_only": True}, ) replication.endpoint_type = AAZStrType( serialized_name="endpointType", ) replication.remote_path = AAZObjectType( serialized_name="remotePath", ) replication.remote_volume_region = AAZStrType( serialized_name="remoteVolumeRegion", ) replication.remote_volume_resource_id = AAZStrType( serialized_name="remoteVolumeResourceId", flags={"required": True}, ) replication.replication_id = AAZStrType( serialized_name="replicationId", flags={"read_only": True}, ) replication.replication_schedule = AAZStrType( serialized_name="replicationSchedule", ) destination_replications = cls._schema_on_200_201.properties.data_protection.replication.destination_replications destination_replications.Element = AAZObjectType() _element = cls._schema_on_200_201.properties.data_protection.replication.destination_replications.Element _element.region = AAZStrType() _element.replication_type = AAZStrType( serialized_name="replicationType", ) _element.resource_id = AAZStrType( serialized_name="resourceId", ) _element.zone = AAZStrType() remote_path = cls._schema_on_200_201.properties.data_protection.replication.remote_path remote_path.external_host_name = AAZStrType( serialized_name="externalHostName", flags={"required": True}, ) remote_path.server_name = AAZStrType( serialized_name="serverName", flags={"required": True}, ) remote_path.volume_name = AAZStrType( serialized_name="volumeName", flags={"required": True}, ) snapshot = cls._schema_on_200_201.properties.data_protection.snapshot snapshot.snapshot_policy_id = AAZStrType( serialized_name="snapshotPolicyId", ) volume_relocation = cls._schema_on_200_201.properties.data_protection.volume_relocation volume_relocation.ready_to_be_finalized = AAZBoolType( serialized_name="readyToBeFinalized", flags={"read_only": True}, ) volume_relocation.relocation_requested = AAZBoolType( serialized_name="relocationRequested", ) data_store_resource_id = cls._schema_on_200_201.properties.data_store_resource_id data_store_resource_id.Element = AAZStrType() export_policy = cls._schema_on_200_201.properties.export_policy export_policy.rules = AAZListType() rules = cls._schema_on_200_201.properties.export_policy.rules rules.Element = AAZObjectType() _element = cls._schema_on_200_201.properties.export_policy.rules.Element _element.allowed_clients = AAZStrType( serialized_name="allowedClients", ) _element.chown_mode = AAZStrType( serialized_name="chownMode", ) _element.cifs = AAZBoolType() _element.has_root_access = AAZBoolType( serialized_name="hasRootAccess", ) _element.kerberos5_read_only = AAZBoolType( serialized_name="kerberos5ReadOnly", ) _element.kerberos5_read_write = AAZBoolType( serialized_name="kerberos5ReadWrite", ) _element.kerberos5i_read_only = AAZBoolType( serialized_name="kerberos5iReadOnly", ) _element.kerberos5i_read_write = AAZBoolType( serialized_name="kerberos5iReadWrite", ) _element.kerberos5p_read_only = AAZBoolType( serialized_name="kerberos5pReadOnly", ) _element.kerberos5p_read_write = AAZBoolType( serialized_name="kerberos5pReadWrite", ) _element.nfsv3 = AAZBoolType() _element.nfsv41 = AAZBoolType() _element.rule_index = AAZIntType( serialized_name="ruleIndex", ) _element.unix_read_only = AAZBoolType( serialized_name="unixReadOnly", ) _element.unix_read_write = AAZBoolType( serialized_name="unixReadWrite", ) mount_targets = cls._schema_on_200_201.properties.mount_targets mount_targets.Element = AAZObjectType() _element = cls._schema_on_200_201.properties.mount_targets.Element _element.file_system_id = AAZStrType( serialized_name="fileSystemId", flags={"required": True}, ) _element.ip_address = AAZStrType( serialized_name="ipAddress", flags={"read_only": True}, ) _element.mount_target_id = AAZStrType( serialized_name="mountTargetId", flags={"read_only": True}, ) _element.smb_server_fqdn = AAZStrType( serialized_name="smbServerFqdn", ) placement_rules = cls._schema_on_200_201.properties.placement_rules placement_rules.Element = AAZObjectType() _element = cls._schema_on_200_201.properties.placement_rules.Element _element.key = AAZStrType( flags={"required": True}, ) _element.value = AAZStrType( flags={"required": True}, ) protocol_types = cls._schema_on_200_201.properties.protocol_types protocol_types.Element = AAZStrType() 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() zones = cls._schema_on_200_201.zones zones.Element = AAZStrType() return cls._schema_on_200_201
class VolumesCreateOrUpdate(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
65
4
61
0
3
0
1
0
0
0
9
1
10
10
670
52
618
62
599
0
299
53
288
16
1
1
28
9,405
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/account/backup_vault/backup/_wait.py
azext_netappfiles_preview.aaz.latest.netappfiles.account.backup_vault.backup._wait.Wait.BackupsGet
class BackupsGet(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.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups/{backupName}", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "backupName", self.ctx.args.backup_name, required=True, ), **self.serialize_url_param( "backupVaultName", self.ctx.args.backup_vault_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-03-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.id = AAZStrType( flags={"read_only": True}, ) _schema_on_200.name = AAZStrType( flags={"read_only": True}, ) _schema_on_200.properties = AAZObjectType( flags={"required": True, "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.backup_id = AAZStrType( serialized_name="backupId", flags={"read_only": True}, ) properties.backup_policy_resource_id = AAZStrType( serialized_name="backupPolicyResourceId", flags={"read_only": True}, ) properties.backup_type = AAZStrType( serialized_name="backupType", flags={"read_only": True}, ) properties.creation_date = AAZStrType( serialized_name="creationDate", flags={"read_only": True}, ) properties.failure_reason = AAZStrType( serialized_name="failureReason", flags={"read_only": True}, ) properties.label = AAZStrType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.size = AAZIntType( flags={"read_only": True}, ) properties.snapshot_name = AAZStrType( serialized_name="snapshotName", ) properties.use_existing_snapshot = AAZBoolType( serialized_name="useExistingSnapshot", ) properties.volume_resource_id = AAZStrType( serialized_name="volumeResourceId", 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 BackupsGet(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
16
0
1
0
1
0
0
0
8
0
9
9
167
16
151
28
134
0
57
21
47
2
1
1
11
9,406
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/account/backup_vault/backup/_update.py
azext_netappfiles_preview.aaz.latest.netappfiles.account.backup_vault.backup._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": {"required": True, "client_flatten": True}}) properties = _builder.get(".properties") if properties is not None: properties.set_prop("label", AAZStrType, ".label") return _instance_value
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): def __call__(self, *args, **kwargs): pass def _update_instance(self, instance): pass
3
0
8
1
7
0
2
0
1
0
0
0
2
0
2
2
18
4
14
5
11
0
10
5
7
2
1
1
3
9,407
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/account/backup_vault/backup/_update.py
azext_netappfiles_preview.aaz.latest.netappfiles.account.backup_vault.backup._update.Update.BackupsGet
class BackupsGet(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.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups/{backupName}", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "backupName", self.ctx.args.backup_name, required=True, ), **self.serialize_url_param( "backupVaultName", self.ctx.args.backup_vault_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-03-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() _UpdateHelper._build_schema_backup_read(cls._schema_on_200) return cls._schema_on_200
class BackupsGet(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
8
0
7
0
1
0
1
1
1
0
8
0
9
9
90
13
77
25
60
0
33
18
23
2
1
1
11
9,408
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/outbound_endpoint/_list.py
azext_databricks.aaz.latest.databricks.workspace.outbound_endpoint._list.List
class List(AAZCommand): """List the list of endpoints that VNET Injected Workspace calls Azure Databricks Control Plane. You must configure outbound access with these endpoints. For more information, see https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/udr """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/workspaces/{}/outboundnetworkdependenciesendpoints", "2024-05-01"], ] } 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.resource_group = AAZResourceGroupNameArg( required=True, ) _args_schema.workspace_name = AAZStrArg( options=["--workspace-name"], help="The name of the workspace.", required=True, fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) return cls._args_schema def _execute_operations(self): self.pre_operations() self.OutboundNetworkDependenciesEndpointsList(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) return result class OutboundNetworkDependenciesEndpointsList(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.Databricks/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints", **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( "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", "2024-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZListType() _schema_on_200 = cls._schema_on_200 _schema_on_200.Element = AAZObjectType() _element = cls._schema_on_200.Element _element.category = AAZStrType() _element.endpoints = AAZListType() endpoints = cls._schema_on_200.Element.endpoints endpoints.Element = AAZObjectType() _element = cls._schema_on_200.Element.endpoints.Element _element.domain_name = AAZStrType( serialized_name="domainName", ) _element.endpoint_details = AAZListType( serialized_name="endpointDetails", ) endpoint_details = cls._schema_on_200.Element.endpoints.Element.endpoint_details endpoint_details.Element = AAZObjectType() _element = cls._schema_on_200.Element.endpoints.Element.endpoint_details.Element _element.ip_address = AAZStrType( serialized_name="ipAddress", ) _element.is_accessible = AAZBoolType( serialized_name="isAccessible", ) _element.latency = AAZFloatType() _element.port = AAZIntType() return cls._schema_on_200
class List(AAZCommand): '''List the list of endpoints that VNET Injected Workspace calls Azure Databricks Control Plane. You must configure outbound access with these endpoints. For more information, see https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/udr ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): pass class OutboundNetworkDependenciesEndpointsList(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
27
1
9
1
8
0
1
0.02
1
2
1
0
5
0
6
6
170
30
137
43
110
3
75
33
58
2
1
1
18
9,409
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/outbound_endpoint/__cmd_group.py
azext_databricks.aaz.latest.databricks.workspace.outbound_endpoint.__cmd_group.__CMDGroup
class __CMDGroup(AAZCommandGroup): """Commands to manage endpoints in the specified workspace. """ pass
class __CMDGroup(AAZCommandGroup): '''Commands to manage endpoints in the specified workspace. ''' 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
9,410
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/_wait.py
azext_databricks.aaz.latest.databricks.workspace._wait._WaitHelper
class _WaitHelper: """Helper class for Wait""" _schema_created_by_read = None @classmethod def _build_schema_created_by_read(cls, _schema): if cls._schema_created_by_read is not None: _schema.application_id = cls._schema_created_by_read.application_id _schema.oid = cls._schema_created_by_read.oid _schema.puid = cls._schema_created_by_read.puid return cls._schema_created_by_read = _schema_created_by_read = AAZObjectType() created_by_read = _schema_created_by_read created_by_read.application_id = AAZStrType( serialized_name="applicationId", flags={"read_only": True}, ) created_by_read.oid = AAZStrType( flags={"read_only": True}, ) created_by_read.puid = AAZStrType( flags={"read_only": True}, ) _schema.application_id = cls._schema_created_by_read.application_id _schema.oid = cls._schema_created_by_read.oid _schema.puid = cls._schema_created_by_read.puid _schema_managed_identity_configuration_read = None @classmethod def _build_schema_managed_identity_configuration_read(cls, _schema): if cls._schema_managed_identity_configuration_read is not None: _schema.principal_id = cls._schema_managed_identity_configuration_read.principal_id _schema.tenant_id = cls._schema_managed_identity_configuration_read.tenant_id _schema.type = cls._schema_managed_identity_configuration_read.type return cls._schema_managed_identity_configuration_read = _schema_managed_identity_configuration_read = AAZObjectType() managed_identity_configuration_read = _schema_managed_identity_configuration_read managed_identity_configuration_read.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) managed_identity_configuration_read.tenant_id = AAZStrType( serialized_name="tenantId", flags={"read_only": True}, ) managed_identity_configuration_read.type = AAZStrType( flags={"read_only": True}, ) _schema.principal_id = cls._schema_managed_identity_configuration_read.principal_id _schema.tenant_id = cls._schema_managed_identity_configuration_read.tenant_id _schema.type = cls._schema_managed_identity_configuration_read.type _schema_workspace_custom_boolean_parameter_read = None @classmethod def _build_schema_workspace_custom_boolean_parameter_read(cls, _schema): if cls._schema_workspace_custom_boolean_parameter_read is not None: _schema.type = cls._schema_workspace_custom_boolean_parameter_read.type _schema.value = cls._schema_workspace_custom_boolean_parameter_read.value return cls._schema_workspace_custom_boolean_parameter_read = _schema_workspace_custom_boolean_parameter_read = AAZObjectType() workspace_custom_boolean_parameter_read = _schema_workspace_custom_boolean_parameter_read workspace_custom_boolean_parameter_read.type = AAZStrType( flags={"read_only": True}, ) workspace_custom_boolean_parameter_read.value = AAZBoolType( flags={"required": True}, ) _schema.type = cls._schema_workspace_custom_boolean_parameter_read.type _schema.value = cls._schema_workspace_custom_boolean_parameter_read.value _schema_workspace_custom_string_parameter_read = None @classmethod def _build_schema_workspace_custom_string_parameter_read(cls, _schema): if cls._schema_workspace_custom_string_parameter_read is not None: _schema.type = cls._schema_workspace_custom_string_parameter_read.type _schema.value = cls._schema_workspace_custom_string_parameter_read.value return cls._schema_workspace_custom_string_parameter_read = _schema_workspace_custom_string_parameter_read = AAZObjectType() workspace_custom_string_parameter_read = _schema_workspace_custom_string_parameter_read workspace_custom_string_parameter_read.type = AAZStrType( flags={"read_only": True}, ) workspace_custom_string_parameter_read.value = AAZStrType( flags={"required": True}, ) _schema.type = cls._schema_workspace_custom_string_parameter_read.type _schema.value = cls._schema_workspace_custom_string_parameter_read.value
class _WaitHelper: '''Helper class for Wait''' @classmethod def _build_schema_created_by_read(cls, _schema): pass @classmethod def _build_schema_managed_identity_configuration_read(cls, _schema): pass @classmethod def _build_schema_workspace_custom_boolean_parameter_read(cls, _schema): pass @classmethod def _build_schema_workspace_custom_string_parameter_read(cls, _schema): pass
9
1
21
3
18
0
2
0.01
0
0
0
0
0
0
4
4
103
20
82
21
73
1
55
13
50
2
0
1
8
9,411
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/_wait.py
azext_databricks.aaz.latest.databricks.workspace._wait.Wait
class Wait(AAZWaitCommand): """Place the CLI in a waiting state until a condition is met. """ _aaz_info = { "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/workspaces/{}", "2024-05-01"], ] } 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.resource_group = AAZResourceGroupNameArg( required=True, ) _args_schema.name = AAZStrArg( options=["-n", "--name"], help="The name of the workspace.", required=True, id_part="name", fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) return cls._args_schema def _execute_operations(self): self.pre_operations() self.WorkspacesGet(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) return result class WorkspacesGet(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.Databricks/workspaces/{workspaceName}", **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( "subscriptionId", self.ctx.subscription_id, required=True, ), **self.serialize_url_param( "workspaceName", self.ctx.args.name, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2024-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.id = AAZStrType( 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={"required": True, "client_flatten": True}, ) _schema_on_200.sku = 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.access_connector = AAZObjectType( serialized_name="accessConnector", ) properties.authorizations = AAZListType() properties.created_by = AAZObjectType( serialized_name="createdBy", ) _WaitHelper._build_schema_created_by_read(properties.created_by) properties.created_date_time = AAZStrType( serialized_name="createdDateTime", flags={"read_only": True}, ) properties.default_catalog = AAZObjectType( serialized_name="defaultCatalog", ) properties.default_storage_firewall = AAZStrType( serialized_name="defaultStorageFirewall", ) properties.disk_encryption_set_id = AAZStrType( serialized_name="diskEncryptionSetId", flags={"read_only": True}, ) properties.encryption = AAZObjectType() properties.enhanced_security_compliance = AAZObjectType( serialized_name="enhancedSecurityCompliance", ) properties.is_uc_enabled = AAZBoolType( serialized_name="isUcEnabled", flags={"read_only": True}, ) properties.managed_disk_identity = AAZObjectType( serialized_name="managedDiskIdentity", ) _WaitHelper._build_schema_managed_identity_configuration_read(properties.managed_disk_identity) properties.managed_resource_group_id = AAZStrType( serialized_name="managedResourceGroupId", flags={"required": True}, ) properties.parameters = AAZObjectType() properties.private_endpoint_connections = AAZListType( serialized_name="privateEndpointConnections", flags={"read_only": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.public_network_access = AAZStrType( serialized_name="publicNetworkAccess", ) properties.required_nsg_rules = AAZStrType( serialized_name="requiredNsgRules", ) properties.storage_account_identity = AAZObjectType( serialized_name="storageAccountIdentity", ) _WaitHelper._build_schema_managed_identity_configuration_read(properties.storage_account_identity) properties.ui_definition_uri = AAZStrType( serialized_name="uiDefinitionUri", ) properties.updated_by = AAZObjectType( serialized_name="updatedBy", ) _WaitHelper._build_schema_created_by_read(properties.updated_by) properties.workspace_id = AAZStrType( serialized_name="workspaceId", flags={"read_only": True}, ) properties.workspace_url = AAZStrType( serialized_name="workspaceUrl", flags={"read_only": True}, ) access_connector = cls._schema_on_200.properties.access_connector access_connector.id = AAZStrType( flags={"required": True}, ) access_connector.identity_type = AAZStrType( serialized_name="identityType", flags={"required": True}, ) access_connector.user_assigned_identity_id = AAZStrType( serialized_name="userAssignedIdentityId", ) authorizations = cls._schema_on_200.properties.authorizations authorizations.Element = AAZObjectType() _element = cls._schema_on_200.properties.authorizations.Element _element.principal_id = AAZStrType( serialized_name="principalId", flags={"required": True}, ) _element.role_definition_id = AAZStrType( serialized_name="roleDefinitionId", flags={"required": True}, ) default_catalog = cls._schema_on_200.properties.default_catalog default_catalog.initial_name = AAZStrType( serialized_name="initialName", ) default_catalog.initial_type = AAZStrType( serialized_name="initialType", ) encryption = cls._schema_on_200.properties.encryption encryption.entities = AAZObjectType( flags={"required": True}, ) entities = cls._schema_on_200.properties.encryption.entities entities.managed_disk = AAZObjectType( serialized_name="managedDisk", ) entities.managed_services = AAZObjectType( serialized_name="managedServices", ) managed_disk = cls._schema_on_200.properties.encryption.entities.managed_disk managed_disk.key_source = AAZStrType( serialized_name="keySource", flags={"required": True}, ) managed_disk.key_vault_properties = AAZObjectType( serialized_name="keyVaultProperties", flags={"required": True}, ) managed_disk.rotation_to_latest_key_version_enabled = AAZBoolType( serialized_name="rotationToLatestKeyVersionEnabled", ) key_vault_properties = cls._schema_on_200.properties.encryption.entities.managed_disk.key_vault_properties key_vault_properties.key_name = AAZStrType( serialized_name="keyName", flags={"required": True}, ) key_vault_properties.key_vault_uri = AAZStrType( serialized_name="keyVaultUri", flags={"required": True}, ) key_vault_properties.key_version = AAZStrType( serialized_name="keyVersion", flags={"required": True}, ) managed_services = cls._schema_on_200.properties.encryption.entities.managed_services managed_services.key_source = AAZStrType( serialized_name="keySource", flags={"required": True}, ) managed_services.key_vault_properties = AAZObjectType( serialized_name="keyVaultProperties", ) key_vault_properties = cls._schema_on_200.properties.encryption.entities.managed_services.key_vault_properties key_vault_properties.key_name = AAZStrType( serialized_name="keyName", flags={"required": True}, ) key_vault_properties.key_vault_uri = AAZStrType( serialized_name="keyVaultUri", flags={"required": True}, ) key_vault_properties.key_version = AAZStrType( serialized_name="keyVersion", flags={"required": True}, ) enhanced_security_compliance = cls._schema_on_200.properties.enhanced_security_compliance enhanced_security_compliance.automatic_cluster_update = AAZObjectType( serialized_name="automaticClusterUpdate", ) enhanced_security_compliance.compliance_security_profile = AAZObjectType( serialized_name="complianceSecurityProfile", ) enhanced_security_compliance.enhanced_security_monitoring = AAZObjectType( serialized_name="enhancedSecurityMonitoring", ) automatic_cluster_update = cls._schema_on_200.properties.enhanced_security_compliance.automatic_cluster_update automatic_cluster_update.value = AAZStrType() compliance_security_profile = cls._schema_on_200.properties.enhanced_security_compliance.compliance_security_profile compliance_security_profile.compliance_standards = AAZListType( serialized_name="complianceStandards", ) compliance_security_profile.value = AAZStrType() compliance_standards = cls._schema_on_200.properties.enhanced_security_compliance.compliance_security_profile.compliance_standards compliance_standards.Element = AAZStrType() enhanced_security_monitoring = cls._schema_on_200.properties.enhanced_security_compliance.enhanced_security_monitoring enhanced_security_monitoring.value = AAZStrType() parameters = cls._schema_on_200.properties.parameters parameters.aml_workspace_id = AAZObjectType( serialized_name="amlWorkspaceId", ) _WaitHelper._build_schema_workspace_custom_string_parameter_read(parameters.aml_workspace_id) parameters.custom_private_subnet_name = AAZObjectType( serialized_name="customPrivateSubnetName", ) _WaitHelper._build_schema_workspace_custom_string_parameter_read(parameters.custom_private_subnet_name) parameters.custom_public_subnet_name = AAZObjectType( serialized_name="customPublicSubnetName", ) _WaitHelper._build_schema_workspace_custom_string_parameter_read(parameters.custom_public_subnet_name) parameters.custom_virtual_network_id = AAZObjectType( serialized_name="customVirtualNetworkId", ) _WaitHelper._build_schema_workspace_custom_string_parameter_read(parameters.custom_virtual_network_id) parameters.enable_no_public_ip = AAZObjectType( serialized_name="enableNoPublicIp", ) parameters.encryption = AAZObjectType() parameters.load_balancer_backend_pool_name = AAZObjectType( serialized_name="loadBalancerBackendPoolName", ) _WaitHelper._build_schema_workspace_custom_string_parameter_read(parameters.load_balancer_backend_pool_name) parameters.load_balancer_id = AAZObjectType( serialized_name="loadBalancerId", ) _WaitHelper._build_schema_workspace_custom_string_parameter_read(parameters.load_balancer_id) parameters.nat_gateway_name = AAZObjectType( serialized_name="natGatewayName", ) _WaitHelper._build_schema_workspace_custom_string_parameter_read(parameters.nat_gateway_name) parameters.prepare_encryption = AAZObjectType( serialized_name="prepareEncryption", ) _WaitHelper._build_schema_workspace_custom_boolean_parameter_read(parameters.prepare_encryption) parameters.public_ip_name = AAZObjectType( serialized_name="publicIpName", ) _WaitHelper._build_schema_workspace_custom_string_parameter_read(parameters.public_ip_name) parameters.require_infrastructure_encryption = AAZObjectType( serialized_name="requireInfrastructureEncryption", ) _WaitHelper._build_schema_workspace_custom_boolean_parameter_read(parameters.require_infrastructure_encryption) parameters.resource_tags = AAZObjectType( serialized_name="resourceTags", flags={"read_only": True}, ) parameters.storage_account_name = AAZObjectType( serialized_name="storageAccountName", ) _WaitHelper._build_schema_workspace_custom_string_parameter_read(parameters.storage_account_name) parameters.storage_account_sku_name = AAZObjectType( serialized_name="storageAccountSkuName", ) _WaitHelper._build_schema_workspace_custom_string_parameter_read(parameters.storage_account_sku_name) parameters.vnet_address_prefix = AAZObjectType( serialized_name="vnetAddressPrefix", ) _WaitHelper._build_schema_workspace_custom_string_parameter_read(parameters.vnet_address_prefix) enable_no_public_ip = cls._schema_on_200.properties.parameters.enable_no_public_ip enable_no_public_ip.type = AAZStrType( flags={"read_only": True}, ) enable_no_public_ip.value = AAZBoolType( flags={"required": True}, ) encryption = cls._schema_on_200.properties.parameters.encryption encryption.type = AAZStrType( flags={"read_only": True}, ) encryption.value = AAZObjectType() value = cls._schema_on_200.properties.parameters.encryption.value value.key_name = AAZStrType( serialized_name="KeyName", ) value.key_source = AAZStrType( serialized_name="keySource", ) value.keyvaulturi = AAZStrType() value.keyversion = AAZStrType() resource_tags = cls._schema_on_200.properties.parameters.resource_tags resource_tags.type = AAZStrType( flags={"read_only": True}, ) resource_tags.value = AAZFreeFormDictType( flags={"required": True}, ) 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( flags={"required": True}, ) _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", ) properties.private_endpoint = AAZObjectType( serialized_name="privateEndpoint", ) properties.private_link_service_connection_state = AAZObjectType( serialized_name="privateLinkServiceConnectionState", flags={"required": True}, ) 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( flags={"read_only": True}, ) 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", ) private_link_service_connection_state.description = AAZStrType() private_link_service_connection_state.status = AAZStrType( flags={"required": True}, ) sku = cls._schema_on_200.sku sku.name = AAZStrType( flags={"required": True}, ) sku.tier = 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 Wait(AAZWaitCommand): '''Place the CLI in a waiting state until a condition is met. ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): pass class WorkspacesGet(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
27
1
33
2
30
0
1
0.01
1
2
1
0
5
0
6
6
531
55
473
66
446
3
215
56
198
2
1
1
18
9,412
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/access_connector/__cmd_group.py
azext_databricks.aaz.latest.databricks.access_connector.__cmd_group.__CMDGroup
class __CMDGroup(AAZCommandGroup): """Commands to manage databricks access connector. """ pass
class __CMDGroup(AAZCommandGroup): '''Commands to manage databricks access connector. ''' 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
9,413
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/access_connector/_create.py
azext_databricks.aaz.latest.databricks.access_connector._create.Create
class Create(AAZCommand): """Create azure databricks accessConnector. :example: Create a databricks accessConnector az databricks access-connector create --resource-group MyResourceGroup --name MyAccessConnector --location westus --identity-type SystemAssigned """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/accessconnectors/{}", "2024-05-01"], ] } AZ_SUPPORT_NO_WAIT = True def _handler(self, command_args): super()._handler(command_args) return self.build_lro_poller(self._execute_operations, self._output) _args_schema = None @classmethod def _build_arguments_schema(cls, *args, **kwargs): if cls._args_schema is not None: return cls._args_schema cls._args_schema = super()._build_arguments_schema(*args, **kwargs) # define Arg Group "" _args_schema = cls._args_schema _args_schema.name = AAZStrArg( options=["-n", "--name"], help="The name of the azure databricks accessConnector.", required=True, fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) _args_schema.resource_group = AAZResourceGroupNameArg( required=True, ) _args_schema.identity_type = AAZStrArg( options=["--identity-type"], help="The identity type.", enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned,UserAssigned": "SystemAssigned,UserAssigned", "UserAssigned": "UserAssigned"}, ) _args_schema.location = AAZResourceLocationArg( help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=<location>`.", required=True, fmt=AAZResourceLocationArgFormat( resource_group_arg="resource_group", ), ) _args_schema.tags = AAZDictArg( options=["--tags"], help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", ) tags = cls._args_schema.tags tags.Element = AAZStrArg() # define Arg Group "Identity" _args_schema = cls._args_schema _args_schema.user_assigned_identities = AAZDictArg( options=["--identities", "--user-assigned-identities"], arg_group="Identity", help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", ) user_assigned_identities = cls._args_schema.user_assigned_identities user_assigned_identities.Element = AAZObjectArg( blank={}, ) return cls._args_schema def _execute_operations(self): self.pre_operations() yield self.AccessConnectorsCreateOrUpdate(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) return result class AccessConnectorsCreateOrUpdate(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.Databricks/accessConnectors/{connectorName}", **self.url_parameters ) @property def method(self): return "PUT" @property def error_format(self): return "ODataV4Format" @property def url_parameters(self): parameters = { **self.serialize_url_param( "connectorName", self.ctx.args.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-05-01", 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("identity", AAZObjectType) _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) _builder.set_prop("tags", AAZDictType, ".tags") identity = _builder.get(".identity") if identity is not None: identity.set_prop("type", AAZStrType, ".identity_type", typ_kwargs={"flags": {"required": True}}) identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") user_assigned_identities = _builder.get(".identity.userAssignedIdentities") if user_assigned_identities is not None: user_assigned_identities.set_elements(AAZObjectType, ".") 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.identity = AAZObjectType() _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}, ) identity = cls._schema_on_200_201.identity identity.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) identity.tenant_id = AAZStrType( serialized_name="tenantId", flags={"read_only": True}, ) identity.type = AAZStrType( flags={"required": True}, ) identity.user_assigned_identities = AAZDictType( serialized_name="userAssignedIdentities", ) user_assigned_identities = cls._schema_on_200_201.identity.user_assigned_identities user_assigned_identities.Element = AAZObjectType() _element = cls._schema_on_200_201.identity.user_assigned_identities.Element _element.client_id = AAZStrType( serialized_name="clientId", flags={"read_only": True}, ) _element.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) properties = cls._schema_on_200_201.properties properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.refered_by = AAZListType( serialized_name="referedBy", flags={"read_only": True}, ) refered_by = cls._schema_on_200_201.properties.refered_by refered_by.Element = AAZStrType() 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 Create(AAZCommand): '''Create azure databricks accessConnector. :example: Create a databricks accessConnector az databricks access-connector create --resource-group MyResourceGroup --name MyAccessConnector --location westus --identity-type SystemAssigned ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): pass class AccessConnectorsCreateOrUpdate(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
29
1
16
1
15
0
1
0.02
1
2
1
0
5
0
6
6
307
43
258
57
229
6
118
45
100
4
1
1
23
9,414
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/access_connector/_delete.py
azext_databricks.aaz.latest.databricks.access_connector._delete.Delete
class Delete(AAZCommand): """Delete the azure databricks accessConnector. :example: Delete a databricks accessConnector az databricks access-connector delete --resource-group MyResourceGroup --name MyAccessConnector """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/accessconnectors/{}", "2024-05-01"], ] } AZ_SUPPORT_NO_WAIT = True def _handler(self, command_args): super()._handler(command_args) return self.build_lro_poller(self._execute_operations, 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.name = AAZStrArg( options=["-n", "--name"], help="The name of the azure databricks accessConnector.", required=True, id_part="name", fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) _args_schema.resource_group = AAZResourceGroupNameArg( required=True, ) return cls._args_schema def _execute_operations(self): self.pre_operations() yield self.AccessConnectorsDelete(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass class AccessConnectorsDelete(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.Databricks/accessConnectors/{connectorName}", **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( "connectorName", self.ctx.args.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-05-01", required=True, ), } return parameters def on_200(self, session): pass def on_204(self, session): pass
class Delete(AAZCommand): '''Delete the azure databricks accessConnector. :example: Delete a databricks accessConnector az databricks access-connector delete --resource-group MyResourceGroup --name MyAccessConnector ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass class AccessConnectorsDelete(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
23
1
8
0
8
0
1
0.04
1
2
1
0
4
0
5
5
143
21
117
33
94
5
51
24
36
4
1
1
17
9,415
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/access_connector/_list.py
azext_databricks.aaz.latest.databricks.access_connector._list.List
class List(AAZCommand): """List all the azure databricks accessConnectors within a subscription. :example: Lists databricks accessConnectors within a resource group az databricks access-connector list --resource-group MyResourceGroup :example: Lists all the databricks accessConnectors within a subscription. az databricks access-connector list """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/providers/microsoft.databricks/accessconnectors", "2024-05-01"], ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/accessconnectors", "2024-05-01"], ] } AZ_SUPPORT_PAGINATION = True 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() return cls._args_schema def _execute_operations(self): self.pre_operations() condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True if condition_0: self.AccessConnectorsListByResourceGroup(ctx=self.ctx)() if condition_1: self.AccessConnectorsListBySubscription(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) next_link = self.deserialize_output(self.ctx.vars.instance.next_link) return result, next_link class AccessConnectorsListByResourceGroup(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.Databricks/accessConnectors", **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( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2024-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.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.identity = AAZObjectType() _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}, ) identity = cls._schema_on_200.value.Element.identity identity.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) identity.tenant_id = AAZStrType( serialized_name="tenantId", flags={"read_only": True}, ) identity.type = AAZStrType( flags={"required": True}, ) identity.user_assigned_identities = AAZDictType( serialized_name="userAssignedIdentities", ) user_assigned_identities = cls._schema_on_200.value.Element.identity.user_assigned_identities user_assigned_identities.Element = AAZObjectType() _element = cls._schema_on_200.value.Element.identity.user_assigned_identities.Element _element.client_id = AAZStrType( serialized_name="clientId", flags={"read_only": True}, ) _element.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) properties = cls._schema_on_200.value.Element.properties properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.refered_by = AAZListType( serialized_name="referedBy", flags={"read_only": True}, ) refered_by = cls._schema_on_200.value.Element.properties.refered_by refered_by.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", ) tags = cls._schema_on_200.value.Element.tags tags.Element = AAZStrType() return cls._schema_on_200 class AccessConnectorsListBySubscription(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.Databricks/accessConnectors", **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( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2024-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.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.identity = AAZObjectType() _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}, ) identity = cls._schema_on_200.value.Element.identity identity.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) identity.tenant_id = AAZStrType( serialized_name="tenantId", flags={"read_only": True}, ) identity.type = AAZStrType( flags={"required": True}, ) identity.user_assigned_identities = AAZDictType( serialized_name="userAssignedIdentities", ) user_assigned_identities = cls._schema_on_200.value.Element.identity.user_assigned_identities user_assigned_identities.Element = AAZObjectType() _element = cls._schema_on_200.value.Element.identity.user_assigned_identities.Element _element.client_id = AAZStrType( serialized_name="clientId", flags={"read_only": True}, ) _element.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) properties = cls._schema_on_200.value.Element.properties properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.refered_by = AAZListType( serialized_name="referedBy", flags={"read_only": True}, ) refered_by = cls._schema_on_200.value.Element.properties.refered_by refered_by.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", ) tags = cls._schema_on_200.value.Element.tags tags.Element = AAZStrType() return cls._schema_on_200
class List(AAZCommand): '''List all the azure databricks accessConnectors within a subscription. :example: Lists databricks accessConnectors within a resource group az databricks access-connector list --resource-group MyResourceGroup :example: Lists all the databricks accessConnectors within a subscription. az databricks access-connector list ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): pass class AccessConnectorsListByResourceGroup(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 class AccessConnectorsListBySubscription(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
44
1
14
1
13
0
1
0.02
1
3
2
0
5
0
6
6
402
61
334
86
290
7
171
69
144
3
1
1
31
9,416
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/access_connector/_show.py
azext_databricks.aaz.latest.databricks.access_connector._show.Show
class Show(AAZCommand): """Get an azure databricks accessConnector. :example: Get an azure databricks accessConnector az databricks access-connector show --resource-group MyResourceGroup --name MyAccessConnector """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/accessconnectors/{}", "2024-05-01"], ] } 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.name = AAZStrArg( options=["-n", "--name"], help="The name of the azure databricks accessConnector.", required=True, id_part="name", fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) _args_schema.resource_group = AAZResourceGroupNameArg( required=True, ) return cls._args_schema def _execute_operations(self): self.pre_operations() self.AccessConnectorsGet(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) return result class AccessConnectorsGet(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.Databricks/accessConnectors/{connectorName}", **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( "connectorName", self.ctx.args.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-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.id = AAZStrType( flags={"read_only": True}, ) _schema_on_200.identity = AAZObjectType() _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}, ) identity = cls._schema_on_200.identity identity.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) identity.tenant_id = AAZStrType( serialized_name="tenantId", flags={"read_only": True}, ) identity.type = AAZStrType( flags={"required": True}, ) identity.user_assigned_identities = AAZDictType( serialized_name="userAssignedIdentities", ) user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities user_assigned_identities.Element = AAZObjectType() _element = cls._schema_on_200.identity.user_assigned_identities.Element _element.client_id = AAZStrType( serialized_name="clientId", flags={"read_only": True}, ) _element.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) properties = cls._schema_on_200.properties properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.refered_by = AAZListType( serialized_name="referedBy", flags={"read_only": True}, ) refered_by = cls._schema_on_200.properties.refered_by refered_by.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", ) tags = cls._schema_on_200.tags tags.Element = AAZStrType() return cls._schema_on_200
class Show(AAZCommand): '''Get an azure databricks accessConnector. :example: Get an azure databricks accessConnector az databricks access-connector show --resource-group MyResourceGroup --name MyAccessConnector ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): pass class AccessConnectorsGet(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
27
1
12
1
11
0
1
0.03
1
2
1
0
5
0
6
6
229
33
191
47
164
5
91
37
74
2
1
1
18
9,417
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/access_connector/_update.py
azext_databricks.aaz.latest.databricks.access_connector._update.Update
class Update(AAZCommand): """Update azure databricks accessConnector. :example: Update a databricks accessConnector az databricks access-connector update --resource-group MyResourceGroup --name MyAccessConnector --location westus --identity-type SystemAssigned """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/accessconnectors/{}", "2024-05-01"], ] } AZ_SUPPORT_NO_WAIT = True AZ_SUPPORT_GENERIC_UPDATE = True def _handler(self, command_args): super()._handler(command_args) return self.build_lro_poller(self._execute_operations, self._output) _args_schema = None @classmethod def _build_arguments_schema(cls, *args, **kwargs): if cls._args_schema is not None: return cls._args_schema cls._args_schema = super()._build_arguments_schema(*args, **kwargs) # define Arg Group "" _args_schema = cls._args_schema _args_schema.name = AAZStrArg( options=["-n", "--name"], help="The name of the azure databricks accessConnector.", required=True, id_part="name", fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) _args_schema.resource_group = AAZResourceGroupNameArg( required=True, ) _args_schema.identity_type = AAZStrArg( options=["--identity-type"], help="The identity type.", enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned,UserAssigned": "SystemAssigned,UserAssigned", "UserAssigned": "UserAssigned"}, ) _args_schema.tags = AAZDictArg( options=["--tags"], help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", nullable=True, ) tags = cls._args_schema.tags tags.Element = AAZStrArg( nullable=True, ) # define Arg Group "Identity" _args_schema = cls._args_schema _args_schema.user_assigned_identities = AAZDictArg( options=["--identities", "--user-assigned-identities"], arg_group="Identity", help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", nullable=True, ) user_assigned_identities = cls._args_schema.user_assigned_identities user_assigned_identities.Element = AAZObjectArg( nullable=True, blank={}, ) return cls._args_schema def _execute_operations(self): self.pre_operations() self.AccessConnectorsGet(ctx=self.ctx)() self.pre_instance_update(self.ctx.vars.instance) self.InstanceUpdateByJson(ctx=self.ctx)() self.InstanceUpdateByGeneric(ctx=self.ctx)() self.post_instance_update(self.ctx.vars.instance) yield self.AccessConnectorsCreateOrUpdate(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass @register_callback def pre_instance_update(self, instance): pass @register_callback def post_instance_update(self, instance): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) return result class AccessConnectorsGet(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.Databricks/accessConnectors/{connectorName}", **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( "connectorName", self.ctx.args.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-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _UpdateHelper._build_schema_access_connector_read(cls._schema_on_200) return cls._schema_on_200 class AccessConnectorsCreateOrUpdate(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.Databricks/accessConnectors/{connectorName}", **self.url_parameters ) @property def method(self): return "PUT" @property def error_format(self): return "ODataV4Format" @property def url_parameters(self): parameters = { **self.serialize_url_param( "connectorName", self.ctx.args.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-05-01", 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_access_connector_read(cls._schema_on_200_201) return cls._schema_on_200_201 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("identity", AAZObjectType) _builder.set_prop("tags", AAZDictType, ".tags") identity = _builder.get(".identity") if identity is not None: identity.set_prop("type", AAZStrType, ".identity_type", typ_kwargs={"flags": {"required": True}}) identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") user_assigned_identities = _builder.get(".identity.userAssignedIdentities") if user_assigned_identities is not None: user_assigned_identities.set_elements(AAZObjectType, ".") tags = _builder.get(".tags") if tags is not None: tags.set_elements(AAZStrType, ".") return _instance_value class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): def __call__(self, *args, **kwargs): self._update_instance_by_generic( self.ctx.vars.instance, self.ctx.generic_update_args )
class Update(AAZCommand): '''Update azure databricks accessConnector. :example: Update a databricks accessConnector az databricks access-connector update --resource-group MyResourceGroup --name MyAccessConnector --location westus --identity-type SystemAssigned ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass @register_callback def pre_instance_update(self, instance): pass @register_callback def post_instance_update(self, instance): pass def _output(self, *args, **kwargs): pass class AccessConnectorsGet(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 class AccessConnectorsCreateOrUpdate(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 class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): def __call__(self, *args, **kwargs): pass def _update_instance(self, instance): pass class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): def __call__(self, *args, **kwargs): pass
55
1
9
1
8
0
1
0.02
1
5
4
0
7
0
8
8
339
58
275
85
220
6
136
64
101
4
1
1
39
9,418
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/access_connector/_update.py
azext_databricks.aaz.latest.databricks.access_connector._update._UpdateHelper
class _UpdateHelper: """Helper class for Update""" _schema_access_connector_read = None @classmethod def _build_schema_access_connector_read(cls, _schema): if cls._schema_access_connector_read is not None: _schema.id = cls._schema_access_connector_read.id _schema.identity = cls._schema_access_connector_read.identity _schema.location = cls._schema_access_connector_read.location _schema.name = cls._schema_access_connector_read.name _schema.properties = cls._schema_access_connector_read.properties _schema.system_data = cls._schema_access_connector_read.system_data _schema.tags = cls._schema_access_connector_read.tags _schema.type = cls._schema_access_connector_read.type return cls._schema_access_connector_read = _schema_access_connector_read = AAZObjectType() access_connector_read = _schema_access_connector_read access_connector_read.id = AAZStrType( flags={"read_only": True}, ) access_connector_read.identity = AAZObjectType() access_connector_read.location = AAZStrType( flags={"required": True}, ) access_connector_read.name = AAZStrType( flags={"read_only": True}, ) access_connector_read.properties = AAZObjectType() access_connector_read.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) access_connector_read.tags = AAZDictType() access_connector_read.type = AAZStrType( flags={"read_only": True}, ) identity = _schema_access_connector_read.identity identity.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) identity.tenant_id = AAZStrType( serialized_name="tenantId", flags={"read_only": True}, ) identity.type = AAZStrType( flags={"required": True}, ) identity.user_assigned_identities = AAZDictType( serialized_name="userAssignedIdentities", ) user_assigned_identities = _schema_access_connector_read.identity.user_assigned_identities user_assigned_identities.Element = AAZObjectType() _element = _schema_access_connector_read.identity.user_assigned_identities.Element _element.client_id = AAZStrType( serialized_name="clientId", flags={"read_only": True}, ) _element.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) properties = _schema_access_connector_read.properties properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.refered_by = AAZListType( serialized_name="referedBy", flags={"read_only": True}, ) refered_by = _schema_access_connector_read.properties.refered_by refered_by.Element = AAZStrType() system_data = _schema_access_connector_read.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 = _schema_access_connector_read.tags tags.Element = AAZStrType() _schema.id = cls._schema_access_connector_read.id _schema.identity = cls._schema_access_connector_read.identity _schema.location = cls._schema_access_connector_read.location _schema.name = cls._schema_access_connector_read.name _schema.properties = cls._schema_access_connector_read.properties _schema.system_data = cls._schema_access_connector_read.system_data _schema.tags = cls._schema_access_connector_read.tags _schema.type = cls._schema_access_connector_read.type
class _UpdateHelper: '''Helper class for Update''' @classmethod def _build_schema_access_connector_read(cls, _schema): pass
3
1
108
10
98
0
2
0.01
0
0
0
0
0
0
1
1
114
12
101
13
98
1
55
11
53
2
0
1
2
9,419
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/access_connector/_wait.py
azext_databricks.aaz.latest.databricks.access_connector._wait.Wait
class Wait(AAZWaitCommand): """Place the CLI in a waiting state until a condition is met. """ _aaz_info = { "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/accessconnectors/{}", "2024-05-01"], ] } 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.name = AAZStrArg( options=["-n", "--name"], help="The name of the azure databricks accessConnector.", required=True, id_part="name", fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) _args_schema.resource_group = AAZResourceGroupNameArg( required=True, ) return cls._args_schema def _execute_operations(self): self.pre_operations() self.AccessConnectorsGet(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) return result class AccessConnectorsGet(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.Databricks/accessConnectors/{connectorName}", **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( "connectorName", self.ctx.args.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-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.id = AAZStrType( flags={"read_only": True}, ) _schema_on_200.identity = AAZObjectType() _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}, ) identity = cls._schema_on_200.identity identity.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) identity.tenant_id = AAZStrType( serialized_name="tenantId", flags={"read_only": True}, ) identity.type = AAZStrType( flags={"required": True}, ) identity.user_assigned_identities = AAZDictType( serialized_name="userAssignedIdentities", ) user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities user_assigned_identities.Element = AAZObjectType() _element = cls._schema_on_200.identity.user_assigned_identities.Element _element.client_id = AAZStrType( serialized_name="clientId", flags={"read_only": True}, ) _element.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) properties = cls._schema_on_200.properties properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.refered_by = AAZListType( serialized_name="referedBy", flags={"read_only": True}, ) refered_by = cls._schema_on_200.properties.refered_by refered_by.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", ) tags = cls._schema_on_200.tags tags.Element = AAZStrType() return cls._schema_on_200
class Wait(AAZWaitCommand): '''Place the CLI in a waiting state until a condition is met. ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): pass class AccessConnectorsGet(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
27
1
12
1
11
0
1
0.02
1
2
1
0
5
0
6
6
225
32
190
47
163
3
91
37
74
2
1
1
18
9,420
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/account/backup_vault/backup/_update.py
azext_netappfiles_preview.aaz.latest.netappfiles.account.backup_vault.backup._update.Update.BackupsCreate
class BackupsCreate(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.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups/{backupName}", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "backupName", self.ctx.args.backup_name, required=True, ), **self.serialize_url_param( "backupVaultName", self.ctx.args.backup_vault_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-03-01-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_backup_read(cls._schema_on_200_201) return cls._schema_on_200_201
class BackupsCreate(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
10
0
9
0
1
0
1
1
1
0
9
1
10
10
118
15
103
29
84
0
38
20
27
3
1
1
13
9,421
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/__cmd_group.py
azext_databricks.aaz.latest.databricks.workspace.__cmd_group.__CMDGroup
class __CMDGroup(AAZCommandGroup): """Commands to manage databricks workspace. """ pass
class __CMDGroup(AAZCommandGroup): '''Commands to manage databricks workspace. ''' 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
9,422
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/_create.py
azext_databricks.aaz.latest.databricks.workspace._create._CreateHelper
class _CreateHelper: """Helper class for Create""" @classmethod def _build_schema_workspace_custom_string_parameter_create(cls, _builder): if _builder is None: return _builder.set_prop("value", AAZStrType, ".value", typ_kwargs={"flags": {"required": True}}) _schema_created_by_read = None @classmethod def _build_schema_created_by_read(cls, _schema): if cls._schema_created_by_read is not None: _schema.application_id = cls._schema_created_by_read.application_id _schema.oid = cls._schema_created_by_read.oid _schema.puid = cls._schema_created_by_read.puid return cls._schema_created_by_read = _schema_created_by_read = AAZObjectType() created_by_read = _schema_created_by_read created_by_read.application_id = AAZStrType( serialized_name="applicationId", flags={"read_only": True}, ) created_by_read.oid = AAZStrType( flags={"read_only": True}, ) created_by_read.puid = AAZStrType( flags={"read_only": True}, ) _schema.application_id = cls._schema_created_by_read.application_id _schema.oid = cls._schema_created_by_read.oid _schema.puid = cls._schema_created_by_read.puid _schema_managed_identity_configuration_read = None @classmethod def _build_schema_managed_identity_configuration_read(cls, _schema): if cls._schema_managed_identity_configuration_read is not None: _schema.principal_id = cls._schema_managed_identity_configuration_read.principal_id _schema.tenant_id = cls._schema_managed_identity_configuration_read.tenant_id _schema.type = cls._schema_managed_identity_configuration_read.type return cls._schema_managed_identity_configuration_read = _schema_managed_identity_configuration_read = AAZObjectType() managed_identity_configuration_read = _schema_managed_identity_configuration_read managed_identity_configuration_read.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) managed_identity_configuration_read.tenant_id = AAZStrType( serialized_name="tenantId", flags={"read_only": True}, ) managed_identity_configuration_read.type = AAZStrType( flags={"read_only": True}, ) _schema.principal_id = cls._schema_managed_identity_configuration_read.principal_id _schema.tenant_id = cls._schema_managed_identity_configuration_read.tenant_id _schema.type = cls._schema_managed_identity_configuration_read.type _schema_workspace_custom_boolean_parameter_read = None @classmethod def _build_schema_workspace_custom_boolean_parameter_read(cls, _schema): if cls._schema_workspace_custom_boolean_parameter_read is not None: _schema.type = cls._schema_workspace_custom_boolean_parameter_read.type _schema.value = cls._schema_workspace_custom_boolean_parameter_read.value return cls._schema_workspace_custom_boolean_parameter_read = _schema_workspace_custom_boolean_parameter_read = AAZObjectType() workspace_custom_boolean_parameter_read = _schema_workspace_custom_boolean_parameter_read workspace_custom_boolean_parameter_read.type = AAZStrType( flags={"read_only": True}, ) workspace_custom_boolean_parameter_read.value = AAZBoolType( flags={"required": True}, ) _schema.type = cls._schema_workspace_custom_boolean_parameter_read.type _schema.value = cls._schema_workspace_custom_boolean_parameter_read.value _schema_workspace_custom_string_parameter_read = None @classmethod def _build_schema_workspace_custom_string_parameter_read(cls, _schema): if cls._schema_workspace_custom_string_parameter_read is not None: _schema.type = cls._schema_workspace_custom_string_parameter_read.type _schema.value = cls._schema_workspace_custom_string_parameter_read.value return cls._schema_workspace_custom_string_parameter_read = _schema_workspace_custom_string_parameter_read = AAZObjectType() workspace_custom_string_parameter_read = _schema_workspace_custom_string_parameter_read workspace_custom_string_parameter_read.type = AAZStrType( flags={"read_only": True}, ) workspace_custom_string_parameter_read.value = AAZStrType( flags={"required": True}, ) _schema.type = cls._schema_workspace_custom_string_parameter_read.type _schema.value = cls._schema_workspace_custom_string_parameter_read.value
class _CreateHelper: '''Helper class for Create''' @classmethod def _build_schema_workspace_custom_string_parameter_create(cls, _builder): pass @classmethod def _build_schema_created_by_read(cls, _schema): pass @classmethod def _build_schema_managed_identity_configuration_read(cls, _schema): pass @classmethod def _build_schema_workspace_custom_boolean_parameter_read(cls, _schema): pass @classmethod def _build_schema_workspace_custom_string_parameter_read(cls, _schema): pass
11
1
18
2
15
0
2
0.01
0
0
0
0
0
0
5
5
109
21
87
23
76
1
59
14
53
2
0
1
10
9,423
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/_delete.py
azext_databricks.aaz.latest.databricks.workspace._delete.Delete
class Delete(AAZCommand): """Delete the workspace. :example: Delete the workspace az databricks workspace delete --resource-group MyResourceGroup --name MyWorkspace -y """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/workspaces/{}", "2024-05-01"], ] } AZ_SUPPORT_NO_WAIT = True def _handler(self, command_args): super()._handler(command_args) return self.build_lro_poller(self._execute_operations, 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.resource_group = AAZResourceGroupNameArg( required=True, ) _args_schema.name = AAZStrArg( options=["-n", "--name"], help="The name of the workspace.", required=True, id_part="name", fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) _args_schema.force_deletion = AAZBoolArg( options=["--force-deletion"], help="Optional parameter to retain default unity catalog data. By default the data will retained if Uc is enabled on the workspace.", default=False, ) return cls._args_schema def _execute_operations(self): self.pre_operations() yield self.WorkspacesDelete(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass class WorkspacesDelete(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.Databricks/workspaces/{workspaceName}", **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( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), **self.serialize_url_param( "workspaceName", self.ctx.args.name, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "forceDeletion", self.ctx.args.force_deletion, ), **self.serialize_query_param( "api-version", "2024-05-01", required=True, ), } return parameters def on_200(self, session): pass def on_204(self, session): pass
class Delete(AAZCommand): '''Delete the workspace. :example: Delete the workspace az databricks workspace delete --resource-group MyResourceGroup --name MyWorkspace -y ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass class WorkspacesDelete(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
23
1
8
0
8
0
1
0.04
1
2
1
0
4
0
5
5
151
21
125
33
102
5
52
24
37
4
1
1
17
9,424
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/_list.py
azext_databricks.aaz.latest.databricks.workspace._list.List
class List(AAZCommand): """Get all the workspaces. :example: List workspaces within a resource group az databricks workspace list --resource-group MyResourceGroup :example: List workspaces within the default subscription az databricks workspace list """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/providers/microsoft.databricks/workspaces", "2024-05-01"], ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/workspaces", "2024-05-01"], ] } AZ_SUPPORT_PAGINATION = True 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() return cls._args_schema def _execute_operations(self): self.pre_operations() condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True if condition_0: self.WorkspacesListByResourceGroup(ctx=self.ctx)() if condition_1: self.WorkspacesListBySubscription(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) next_link = self.deserialize_output(self.ctx.vars.instance.next_link) return result, next_link class WorkspacesListByResourceGroup(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.Databricks/workspaces", **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( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2024-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.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={"required": True, "client_flatten": True}, ) _element.sku = 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.access_connector = AAZObjectType( serialized_name="accessConnector", ) properties.authorizations = AAZListType() properties.created_by = AAZObjectType( serialized_name="createdBy", ) _ListHelper._build_schema_created_by_read(properties.created_by) properties.created_date_time = AAZStrType( serialized_name="createdDateTime", flags={"read_only": True}, ) properties.default_catalog = AAZObjectType( serialized_name="defaultCatalog", ) properties.default_storage_firewall = AAZStrType( serialized_name="defaultStorageFirewall", ) properties.disk_encryption_set_id = AAZStrType( serialized_name="diskEncryptionSetId", flags={"read_only": True}, ) properties.encryption = AAZObjectType() properties.enhanced_security_compliance = AAZObjectType( serialized_name="enhancedSecurityCompliance", ) properties.is_uc_enabled = AAZBoolType( serialized_name="isUcEnabled", flags={"read_only": True}, ) properties.managed_disk_identity = AAZObjectType( serialized_name="managedDiskIdentity", ) _ListHelper._build_schema_managed_identity_configuration_read(properties.managed_disk_identity) properties.managed_resource_group_id = AAZStrType( serialized_name="managedResourceGroupId", flags={"required": True}, ) properties.parameters = AAZObjectType() properties.private_endpoint_connections = AAZListType( serialized_name="privateEndpointConnections", flags={"read_only": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.public_network_access = AAZStrType( serialized_name="publicNetworkAccess", ) properties.required_nsg_rules = AAZStrType( serialized_name="requiredNsgRules", ) properties.storage_account_identity = AAZObjectType( serialized_name="storageAccountIdentity", ) _ListHelper._build_schema_managed_identity_configuration_read(properties.storage_account_identity) properties.ui_definition_uri = AAZStrType( serialized_name="uiDefinitionUri", ) properties.updated_by = AAZObjectType( serialized_name="updatedBy", ) _ListHelper._build_schema_created_by_read(properties.updated_by) properties.workspace_id = AAZStrType( serialized_name="workspaceId", flags={"read_only": True}, ) properties.workspace_url = AAZStrType( serialized_name="workspaceUrl", flags={"read_only": True}, ) access_connector = cls._schema_on_200.value.Element.properties.access_connector access_connector.id = AAZStrType( flags={"required": True}, ) access_connector.identity_type = AAZStrType( serialized_name="identityType", flags={"required": True}, ) access_connector.user_assigned_identity_id = AAZStrType( serialized_name="userAssignedIdentityId", ) authorizations = cls._schema_on_200.value.Element.properties.authorizations authorizations.Element = AAZObjectType() _element = cls._schema_on_200.value.Element.properties.authorizations.Element _element.principal_id = AAZStrType( serialized_name="principalId", flags={"required": True}, ) _element.role_definition_id = AAZStrType( serialized_name="roleDefinitionId", flags={"required": True}, ) default_catalog = cls._schema_on_200.value.Element.properties.default_catalog default_catalog.initial_name = AAZStrType( serialized_name="initialName", ) default_catalog.initial_type = AAZStrType( serialized_name="initialType", ) encryption = cls._schema_on_200.value.Element.properties.encryption encryption.entities = AAZObjectType( flags={"required": True}, ) entities = cls._schema_on_200.value.Element.properties.encryption.entities entities.managed_disk = AAZObjectType( serialized_name="managedDisk", ) entities.managed_services = AAZObjectType( serialized_name="managedServices", ) managed_disk = cls._schema_on_200.value.Element.properties.encryption.entities.managed_disk managed_disk.key_source = AAZStrType( serialized_name="keySource", flags={"required": True}, ) managed_disk.key_vault_properties = AAZObjectType( serialized_name="keyVaultProperties", flags={"required": True}, ) managed_disk.rotation_to_latest_key_version_enabled = AAZBoolType( serialized_name="rotationToLatestKeyVersionEnabled", ) key_vault_properties = cls._schema_on_200.value.Element.properties.encryption.entities.managed_disk.key_vault_properties key_vault_properties.key_name = AAZStrType( serialized_name="keyName", flags={"required": True}, ) key_vault_properties.key_vault_uri = AAZStrType( serialized_name="keyVaultUri", flags={"required": True}, ) key_vault_properties.key_version = AAZStrType( serialized_name="keyVersion", flags={"required": True}, ) managed_services = cls._schema_on_200.value.Element.properties.encryption.entities.managed_services managed_services.key_source = AAZStrType( serialized_name="keySource", flags={"required": True}, ) managed_services.key_vault_properties = AAZObjectType( serialized_name="keyVaultProperties", ) key_vault_properties = cls._schema_on_200.value.Element.properties.encryption.entities.managed_services.key_vault_properties key_vault_properties.key_name = AAZStrType( serialized_name="keyName", flags={"required": True}, ) key_vault_properties.key_vault_uri = AAZStrType( serialized_name="keyVaultUri", flags={"required": True}, ) key_vault_properties.key_version = AAZStrType( serialized_name="keyVersion", flags={"required": True}, ) enhanced_security_compliance = cls._schema_on_200.value.Element.properties.enhanced_security_compliance enhanced_security_compliance.automatic_cluster_update = AAZObjectType( serialized_name="automaticClusterUpdate", ) enhanced_security_compliance.compliance_security_profile = AAZObjectType( serialized_name="complianceSecurityProfile", ) enhanced_security_compliance.enhanced_security_monitoring = AAZObjectType( serialized_name="enhancedSecurityMonitoring", ) automatic_cluster_update = cls._schema_on_200.value.Element.properties.enhanced_security_compliance.automatic_cluster_update automatic_cluster_update.value = AAZStrType() compliance_security_profile = cls._schema_on_200.value.Element.properties.enhanced_security_compliance.compliance_security_profile compliance_security_profile.compliance_standards = AAZListType( serialized_name="complianceStandards", ) compliance_security_profile.value = AAZStrType() compliance_standards = cls._schema_on_200.value.Element.properties.enhanced_security_compliance.compliance_security_profile.compliance_standards compliance_standards.Element = AAZStrType() enhanced_security_monitoring = cls._schema_on_200.value.Element.properties.enhanced_security_compliance.enhanced_security_monitoring enhanced_security_monitoring.value = AAZStrType() parameters = cls._schema_on_200.value.Element.properties.parameters parameters.aml_workspace_id = AAZObjectType( serialized_name="amlWorkspaceId", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.aml_workspace_id) parameters.custom_private_subnet_name = AAZObjectType( serialized_name="customPrivateSubnetName", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.custom_private_subnet_name) parameters.custom_public_subnet_name = AAZObjectType( serialized_name="customPublicSubnetName", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.custom_public_subnet_name) parameters.custom_virtual_network_id = AAZObjectType( serialized_name="customVirtualNetworkId", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.custom_virtual_network_id) parameters.enable_no_public_ip = AAZObjectType( serialized_name="enableNoPublicIp", ) parameters.encryption = AAZObjectType() parameters.load_balancer_backend_pool_name = AAZObjectType( serialized_name="loadBalancerBackendPoolName", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.load_balancer_backend_pool_name) parameters.load_balancer_id = AAZObjectType( serialized_name="loadBalancerId", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.load_balancer_id) parameters.nat_gateway_name = AAZObjectType( serialized_name="natGatewayName", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.nat_gateway_name) parameters.prepare_encryption = AAZObjectType( serialized_name="prepareEncryption", ) _ListHelper._build_schema_workspace_custom_boolean_parameter_read(parameters.prepare_encryption) parameters.public_ip_name = AAZObjectType( serialized_name="publicIpName", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.public_ip_name) parameters.require_infrastructure_encryption = AAZObjectType( serialized_name="requireInfrastructureEncryption", ) _ListHelper._build_schema_workspace_custom_boolean_parameter_read(parameters.require_infrastructure_encryption) parameters.resource_tags = AAZObjectType( serialized_name="resourceTags", flags={"read_only": True}, ) parameters.storage_account_name = AAZObjectType( serialized_name="storageAccountName", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.storage_account_name) parameters.storage_account_sku_name = AAZObjectType( serialized_name="storageAccountSkuName", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.storage_account_sku_name) parameters.vnet_address_prefix = AAZObjectType( serialized_name="vnetAddressPrefix", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.vnet_address_prefix) enable_no_public_ip = cls._schema_on_200.value.Element.properties.parameters.enable_no_public_ip enable_no_public_ip.type = AAZStrType( flags={"read_only": True}, ) enable_no_public_ip.value = AAZBoolType( flags={"required": True}, ) encryption = cls._schema_on_200.value.Element.properties.parameters.encryption encryption.type = AAZStrType( flags={"read_only": True}, ) encryption.value = AAZObjectType() value = cls._schema_on_200.value.Element.properties.parameters.encryption.value value.key_name = AAZStrType( serialized_name="KeyName", ) value.key_source = AAZStrType( serialized_name="keySource", ) value.keyvaulturi = AAZStrType() value.keyversion = AAZStrType() resource_tags = cls._schema_on_200.value.Element.properties.parameters.resource_tags resource_tags.type = AAZStrType( flags={"read_only": True}, ) resource_tags.value = AAZFreeFormDictType( flags={"required": True}, ) 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( flags={"required": True}, ) _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", ) properties.private_endpoint = AAZObjectType( serialized_name="privateEndpoint", ) properties.private_link_service_connection_state = AAZObjectType( serialized_name="privateLinkServiceConnectionState", flags={"required": True}, ) 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( flags={"read_only": True}, ) 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", ) private_link_service_connection_state.description = AAZStrType() private_link_service_connection_state.status = AAZStrType( flags={"required": True}, ) sku = cls._schema_on_200.value.Element.sku sku.name = AAZStrType( flags={"required": True}, ) sku.tier = 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 WorkspacesListBySubscription(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.Databricks/workspaces", **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( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2024-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.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={"required": True, "client_flatten": True}, ) _element.sku = 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.access_connector = AAZObjectType( serialized_name="accessConnector", ) properties.authorizations = AAZListType() properties.created_by = AAZObjectType( serialized_name="createdBy", ) _ListHelper._build_schema_created_by_read(properties.created_by) properties.created_date_time = AAZStrType( serialized_name="createdDateTime", flags={"read_only": True}, ) properties.default_catalog = AAZObjectType( serialized_name="defaultCatalog", ) properties.default_storage_firewall = AAZStrType( serialized_name="defaultStorageFirewall", ) properties.disk_encryption_set_id = AAZStrType( serialized_name="diskEncryptionSetId", flags={"read_only": True}, ) properties.encryption = AAZObjectType() properties.enhanced_security_compliance = AAZObjectType( serialized_name="enhancedSecurityCompliance", ) properties.is_uc_enabled = AAZBoolType( serialized_name="isUcEnabled", flags={"read_only": True}, ) properties.managed_disk_identity = AAZObjectType( serialized_name="managedDiskIdentity", ) _ListHelper._build_schema_managed_identity_configuration_read(properties.managed_disk_identity) properties.managed_resource_group_id = AAZStrType( serialized_name="managedResourceGroupId", flags={"required": True}, ) properties.parameters = AAZObjectType() properties.private_endpoint_connections = AAZListType( serialized_name="privateEndpointConnections", flags={"read_only": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.public_network_access = AAZStrType( serialized_name="publicNetworkAccess", ) properties.required_nsg_rules = AAZStrType( serialized_name="requiredNsgRules", ) properties.storage_account_identity = AAZObjectType( serialized_name="storageAccountIdentity", ) _ListHelper._build_schema_managed_identity_configuration_read(properties.storage_account_identity) properties.ui_definition_uri = AAZStrType( serialized_name="uiDefinitionUri", ) properties.updated_by = AAZObjectType( serialized_name="updatedBy", ) _ListHelper._build_schema_created_by_read(properties.updated_by) properties.workspace_id = AAZStrType( serialized_name="workspaceId", flags={"read_only": True}, ) properties.workspace_url = AAZStrType( serialized_name="workspaceUrl", flags={"read_only": True}, ) access_connector = cls._schema_on_200.value.Element.properties.access_connector access_connector.id = AAZStrType( flags={"required": True}, ) access_connector.identity_type = AAZStrType( serialized_name="identityType", flags={"required": True}, ) access_connector.user_assigned_identity_id = AAZStrType( serialized_name="userAssignedIdentityId", ) authorizations = cls._schema_on_200.value.Element.properties.authorizations authorizations.Element = AAZObjectType() _element = cls._schema_on_200.value.Element.properties.authorizations.Element _element.principal_id = AAZStrType( serialized_name="principalId", flags={"required": True}, ) _element.role_definition_id = AAZStrType( serialized_name="roleDefinitionId", flags={"required": True}, ) default_catalog = cls._schema_on_200.value.Element.properties.default_catalog default_catalog.initial_name = AAZStrType( serialized_name="initialName", ) default_catalog.initial_type = AAZStrType( serialized_name="initialType", ) encryption = cls._schema_on_200.value.Element.properties.encryption encryption.entities = AAZObjectType( flags={"required": True}, ) entities = cls._schema_on_200.value.Element.properties.encryption.entities entities.managed_disk = AAZObjectType( serialized_name="managedDisk", ) entities.managed_services = AAZObjectType( serialized_name="managedServices", ) managed_disk = cls._schema_on_200.value.Element.properties.encryption.entities.managed_disk managed_disk.key_source = AAZStrType( serialized_name="keySource", flags={"required": True}, ) managed_disk.key_vault_properties = AAZObjectType( serialized_name="keyVaultProperties", flags={"required": True}, ) managed_disk.rotation_to_latest_key_version_enabled = AAZBoolType( serialized_name="rotationToLatestKeyVersionEnabled", ) key_vault_properties = cls._schema_on_200.value.Element.properties.encryption.entities.managed_disk.key_vault_properties key_vault_properties.key_name = AAZStrType( serialized_name="keyName", flags={"required": True}, ) key_vault_properties.key_vault_uri = AAZStrType( serialized_name="keyVaultUri", flags={"required": True}, ) key_vault_properties.key_version = AAZStrType( serialized_name="keyVersion", flags={"required": True}, ) managed_services = cls._schema_on_200.value.Element.properties.encryption.entities.managed_services managed_services.key_source = AAZStrType( serialized_name="keySource", flags={"required": True}, ) managed_services.key_vault_properties = AAZObjectType( serialized_name="keyVaultProperties", ) key_vault_properties = cls._schema_on_200.value.Element.properties.encryption.entities.managed_services.key_vault_properties key_vault_properties.key_name = AAZStrType( serialized_name="keyName", flags={"required": True}, ) key_vault_properties.key_vault_uri = AAZStrType( serialized_name="keyVaultUri", flags={"required": True}, ) key_vault_properties.key_version = AAZStrType( serialized_name="keyVersion", flags={"required": True}, ) enhanced_security_compliance = cls._schema_on_200.value.Element.properties.enhanced_security_compliance enhanced_security_compliance.automatic_cluster_update = AAZObjectType( serialized_name="automaticClusterUpdate", ) enhanced_security_compliance.compliance_security_profile = AAZObjectType( serialized_name="complianceSecurityProfile", ) enhanced_security_compliance.enhanced_security_monitoring = AAZObjectType( serialized_name="enhancedSecurityMonitoring", ) automatic_cluster_update = cls._schema_on_200.value.Element.properties.enhanced_security_compliance.automatic_cluster_update automatic_cluster_update.value = AAZStrType() compliance_security_profile = cls._schema_on_200.value.Element.properties.enhanced_security_compliance.compliance_security_profile compliance_security_profile.compliance_standards = AAZListType( serialized_name="complianceStandards", ) compliance_security_profile.value = AAZStrType() compliance_standards = cls._schema_on_200.value.Element.properties.enhanced_security_compliance.compliance_security_profile.compliance_standards compliance_standards.Element = AAZStrType() enhanced_security_monitoring = cls._schema_on_200.value.Element.properties.enhanced_security_compliance.enhanced_security_monitoring enhanced_security_monitoring.value = AAZStrType() parameters = cls._schema_on_200.value.Element.properties.parameters parameters.aml_workspace_id = AAZObjectType( serialized_name="amlWorkspaceId", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.aml_workspace_id) parameters.custom_private_subnet_name = AAZObjectType( serialized_name="customPrivateSubnetName", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.custom_private_subnet_name) parameters.custom_public_subnet_name = AAZObjectType( serialized_name="customPublicSubnetName", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.custom_public_subnet_name) parameters.custom_virtual_network_id = AAZObjectType( serialized_name="customVirtualNetworkId", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.custom_virtual_network_id) parameters.enable_no_public_ip = AAZObjectType( serialized_name="enableNoPublicIp", ) parameters.encryption = AAZObjectType() parameters.load_balancer_backend_pool_name = AAZObjectType( serialized_name="loadBalancerBackendPoolName", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.load_balancer_backend_pool_name) parameters.load_balancer_id = AAZObjectType( serialized_name="loadBalancerId", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.load_balancer_id) parameters.nat_gateway_name = AAZObjectType( serialized_name="natGatewayName", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.nat_gateway_name) parameters.prepare_encryption = AAZObjectType( serialized_name="prepareEncryption", ) _ListHelper._build_schema_workspace_custom_boolean_parameter_read(parameters.prepare_encryption) parameters.public_ip_name = AAZObjectType( serialized_name="publicIpName", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.public_ip_name) parameters.require_infrastructure_encryption = AAZObjectType( serialized_name="requireInfrastructureEncryption", ) _ListHelper._build_schema_workspace_custom_boolean_parameter_read(parameters.require_infrastructure_encryption) parameters.resource_tags = AAZObjectType( serialized_name="resourceTags", flags={"read_only": True}, ) parameters.storage_account_name = AAZObjectType( serialized_name="storageAccountName", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.storage_account_name) parameters.storage_account_sku_name = AAZObjectType( serialized_name="storageAccountSkuName", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.storage_account_sku_name) parameters.vnet_address_prefix = AAZObjectType( serialized_name="vnetAddressPrefix", ) _ListHelper._build_schema_workspace_custom_string_parameter_read(parameters.vnet_address_prefix) enable_no_public_ip = cls._schema_on_200.value.Element.properties.parameters.enable_no_public_ip enable_no_public_ip.type = AAZStrType( flags={"read_only": True}, ) enable_no_public_ip.value = AAZBoolType( flags={"required": True}, ) encryption = cls._schema_on_200.value.Element.properties.parameters.encryption encryption.type = AAZStrType( flags={"read_only": True}, ) encryption.value = AAZObjectType() value = cls._schema_on_200.value.Element.properties.parameters.encryption.value value.key_name = AAZStrType( serialized_name="KeyName", ) value.key_source = AAZStrType( serialized_name="keySource", ) value.keyvaulturi = AAZStrType() value.keyversion = AAZStrType() resource_tags = cls._schema_on_200.value.Element.properties.parameters.resource_tags resource_tags.type = AAZStrType( flags={"read_only": True}, ) resource_tags.value = AAZFreeFormDictType( flags={"required": True}, ) 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( flags={"required": True}, ) _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", ) properties.private_endpoint = AAZObjectType( serialized_name="privateEndpoint", ) properties.private_link_service_connection_state = AAZObjectType( serialized_name="privateLinkServiceConnectionState", flags={"required": True}, ) 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( flags={"read_only": True}, ) 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", ) private_link_service_connection_state.description = AAZStrType() private_link_service_connection_state.status = AAZStrType( flags={"required": True}, ) sku = cls._schema_on_200.value.Element.sku sku.name = AAZStrType( flags={"required": True}, ) sku.tier = 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 List(AAZCommand): '''Get all the workspaces. :example: List workspaces within a resource group az databricks workspace list --resource-group MyResourceGroup :example: List workspaces within the default subscription az databricks workspace list ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): pass class WorkspacesListByResourceGroup(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 class WorkspacesListBySubscription(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
44
1
39
3
36
0
1
0.01
1
3
2
0
5
0
6
6
1,014
107
900
122
856
7
419
105
392
3
1
1
31
9,425
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/_list.py
azext_databricks.aaz.latest.databricks.workspace._list._ListHelper
class _ListHelper: """Helper class for List""" _schema_created_by_read = None @classmethod def _build_schema_created_by_read(cls, _schema): if cls._schema_created_by_read is not None: _schema.application_id = cls._schema_created_by_read.application_id _schema.oid = cls._schema_created_by_read.oid _schema.puid = cls._schema_created_by_read.puid return cls._schema_created_by_read = _schema_created_by_read = AAZObjectType() created_by_read = _schema_created_by_read created_by_read.application_id = AAZStrType( serialized_name="applicationId", flags={"read_only": True}, ) created_by_read.oid = AAZStrType( flags={"read_only": True}, ) created_by_read.puid = AAZStrType( flags={"read_only": True}, ) _schema.application_id = cls._schema_created_by_read.application_id _schema.oid = cls._schema_created_by_read.oid _schema.puid = cls._schema_created_by_read.puid _schema_managed_identity_configuration_read = None @classmethod def _build_schema_managed_identity_configuration_read(cls, _schema): if cls._schema_managed_identity_configuration_read is not None: _schema.principal_id = cls._schema_managed_identity_configuration_read.principal_id _schema.tenant_id = cls._schema_managed_identity_configuration_read.tenant_id _schema.type = cls._schema_managed_identity_configuration_read.type return cls._schema_managed_identity_configuration_read = _schema_managed_identity_configuration_read = AAZObjectType() managed_identity_configuration_read = _schema_managed_identity_configuration_read managed_identity_configuration_read.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) managed_identity_configuration_read.tenant_id = AAZStrType( serialized_name="tenantId", flags={"read_only": True}, ) managed_identity_configuration_read.type = AAZStrType( flags={"read_only": True}, ) _schema.principal_id = cls._schema_managed_identity_configuration_read.principal_id _schema.tenant_id = cls._schema_managed_identity_configuration_read.tenant_id _schema.type = cls._schema_managed_identity_configuration_read.type _schema_workspace_custom_boolean_parameter_read = None @classmethod def _build_schema_workspace_custom_boolean_parameter_read(cls, _schema): if cls._schema_workspace_custom_boolean_parameter_read is not None: _schema.type = cls._schema_workspace_custom_boolean_parameter_read.type _schema.value = cls._schema_workspace_custom_boolean_parameter_read.value return cls._schema_workspace_custom_boolean_parameter_read = _schema_workspace_custom_boolean_parameter_read = AAZObjectType() workspace_custom_boolean_parameter_read = _schema_workspace_custom_boolean_parameter_read workspace_custom_boolean_parameter_read.type = AAZStrType( flags={"read_only": True}, ) workspace_custom_boolean_parameter_read.value = AAZBoolType( flags={"required": True}, ) _schema.type = cls._schema_workspace_custom_boolean_parameter_read.type _schema.value = cls._schema_workspace_custom_boolean_parameter_read.value _schema_workspace_custom_string_parameter_read = None @classmethod def _build_schema_workspace_custom_string_parameter_read(cls, _schema): if cls._schema_workspace_custom_string_parameter_read is not None: _schema.type = cls._schema_workspace_custom_string_parameter_read.type _schema.value = cls._schema_workspace_custom_string_parameter_read.value return cls._schema_workspace_custom_string_parameter_read = _schema_workspace_custom_string_parameter_read = AAZObjectType() workspace_custom_string_parameter_read = _schema_workspace_custom_string_parameter_read workspace_custom_string_parameter_read.type = AAZStrType( flags={"read_only": True}, ) workspace_custom_string_parameter_read.value = AAZStrType( flags={"required": True}, ) _schema.type = cls._schema_workspace_custom_string_parameter_read.type _schema.value = cls._schema_workspace_custom_string_parameter_read.value
class _ListHelper: '''Helper class for List''' @classmethod def _build_schema_created_by_read(cls, _schema): pass @classmethod def _build_schema_managed_identity_configuration_read(cls, _schema): pass @classmethod def _build_schema_workspace_custom_boolean_parameter_read(cls, _schema): pass @classmethod def _build_schema_workspace_custom_string_parameter_read(cls, _schema): pass
9
1
21
3
18
0
2
0.01
0
0
0
0
0
0
4
4
103
20
82
21
73
1
55
13
50
2
0
1
8
9,426
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/_show.py
azext_databricks.aaz.latest.databricks.workspace._show.Show
class Show(AAZCommand): """Show the workspace. :example: Show the workspace az databricks workspace show --resource-group MyResourceGroup --name MyWorkspace """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/workspaces/{}", "2024-05-01"], ] } 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.resource_group = AAZResourceGroupNameArg( required=True, ) _args_schema.name = AAZStrArg( options=["-n", "--name"], help="The name of the workspace.", required=True, id_part="name", fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) return cls._args_schema def _execute_operations(self): self.pre_operations() self.WorkspacesGet(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) return result class WorkspacesGet(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.Databricks/workspaces/{workspaceName}", **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( "subscriptionId", self.ctx.subscription_id, required=True, ), **self.serialize_url_param( "workspaceName", self.ctx.args.name, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2024-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.id = AAZStrType( 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={"required": True, "client_flatten": True}, ) _schema_on_200.sku = 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.access_connector = AAZObjectType( serialized_name="accessConnector", ) properties.authorizations = AAZListType() properties.created_by = AAZObjectType( serialized_name="createdBy", ) _ShowHelper._build_schema_created_by_read(properties.created_by) properties.created_date_time = AAZStrType( serialized_name="createdDateTime", flags={"read_only": True}, ) properties.default_catalog = AAZObjectType( serialized_name="defaultCatalog", ) properties.default_storage_firewall = AAZStrType( serialized_name="defaultStorageFirewall", ) properties.disk_encryption_set_id = AAZStrType( serialized_name="diskEncryptionSetId", flags={"read_only": True}, ) properties.encryption = AAZObjectType() properties.enhanced_security_compliance = AAZObjectType( serialized_name="enhancedSecurityCompliance", ) properties.is_uc_enabled = AAZBoolType( serialized_name="isUcEnabled", flags={"read_only": True}, ) properties.managed_disk_identity = AAZObjectType( serialized_name="managedDiskIdentity", ) _ShowHelper._build_schema_managed_identity_configuration_read(properties.managed_disk_identity) properties.managed_resource_group_id = AAZStrType( serialized_name="managedResourceGroupId", flags={"required": True}, ) properties.parameters = AAZObjectType() properties.private_endpoint_connections = AAZListType( serialized_name="privateEndpointConnections", flags={"read_only": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.public_network_access = AAZStrType( serialized_name="publicNetworkAccess", ) properties.required_nsg_rules = AAZStrType( serialized_name="requiredNsgRules", ) properties.storage_account_identity = AAZObjectType( serialized_name="storageAccountIdentity", ) _ShowHelper._build_schema_managed_identity_configuration_read(properties.storage_account_identity) properties.ui_definition_uri = AAZStrType( serialized_name="uiDefinitionUri", ) properties.updated_by = AAZObjectType( serialized_name="updatedBy", ) _ShowHelper._build_schema_created_by_read(properties.updated_by) properties.workspace_id = AAZStrType( serialized_name="workspaceId", flags={"read_only": True}, ) properties.workspace_url = AAZStrType( serialized_name="workspaceUrl", flags={"read_only": True}, ) access_connector = cls._schema_on_200.properties.access_connector access_connector.id = AAZStrType( flags={"required": True}, ) access_connector.identity_type = AAZStrType( serialized_name="identityType", flags={"required": True}, ) access_connector.user_assigned_identity_id = AAZStrType( serialized_name="userAssignedIdentityId", ) authorizations = cls._schema_on_200.properties.authorizations authorizations.Element = AAZObjectType() _element = cls._schema_on_200.properties.authorizations.Element _element.principal_id = AAZStrType( serialized_name="principalId", flags={"required": True}, ) _element.role_definition_id = AAZStrType( serialized_name="roleDefinitionId", flags={"required": True}, ) default_catalog = cls._schema_on_200.properties.default_catalog default_catalog.initial_name = AAZStrType( serialized_name="initialName", ) default_catalog.initial_type = AAZStrType( serialized_name="initialType", ) encryption = cls._schema_on_200.properties.encryption encryption.entities = AAZObjectType( flags={"required": True}, ) entities = cls._schema_on_200.properties.encryption.entities entities.managed_disk = AAZObjectType( serialized_name="managedDisk", ) entities.managed_services = AAZObjectType( serialized_name="managedServices", ) managed_disk = cls._schema_on_200.properties.encryption.entities.managed_disk managed_disk.key_source = AAZStrType( serialized_name="keySource", flags={"required": True}, ) managed_disk.key_vault_properties = AAZObjectType( serialized_name="keyVaultProperties", flags={"required": True}, ) managed_disk.rotation_to_latest_key_version_enabled = AAZBoolType( serialized_name="rotationToLatestKeyVersionEnabled", ) key_vault_properties = cls._schema_on_200.properties.encryption.entities.managed_disk.key_vault_properties key_vault_properties.key_name = AAZStrType( serialized_name="keyName", flags={"required": True}, ) key_vault_properties.key_vault_uri = AAZStrType( serialized_name="keyVaultUri", flags={"required": True}, ) key_vault_properties.key_version = AAZStrType( serialized_name="keyVersion", flags={"required": True}, ) managed_services = cls._schema_on_200.properties.encryption.entities.managed_services managed_services.key_source = AAZStrType( serialized_name="keySource", flags={"required": True}, ) managed_services.key_vault_properties = AAZObjectType( serialized_name="keyVaultProperties", ) key_vault_properties = cls._schema_on_200.properties.encryption.entities.managed_services.key_vault_properties key_vault_properties.key_name = AAZStrType( serialized_name="keyName", flags={"required": True}, ) key_vault_properties.key_vault_uri = AAZStrType( serialized_name="keyVaultUri", flags={"required": True}, ) key_vault_properties.key_version = AAZStrType( serialized_name="keyVersion", flags={"required": True}, ) enhanced_security_compliance = cls._schema_on_200.properties.enhanced_security_compliance enhanced_security_compliance.automatic_cluster_update = AAZObjectType( serialized_name="automaticClusterUpdate", ) enhanced_security_compliance.compliance_security_profile = AAZObjectType( serialized_name="complianceSecurityProfile", ) enhanced_security_compliance.enhanced_security_monitoring = AAZObjectType( serialized_name="enhancedSecurityMonitoring", ) automatic_cluster_update = cls._schema_on_200.properties.enhanced_security_compliance.automatic_cluster_update automatic_cluster_update.value = AAZStrType() compliance_security_profile = cls._schema_on_200.properties.enhanced_security_compliance.compliance_security_profile compliance_security_profile.compliance_standards = AAZListType( serialized_name="complianceStandards", ) compliance_security_profile.value = AAZStrType() compliance_standards = cls._schema_on_200.properties.enhanced_security_compliance.compliance_security_profile.compliance_standards compliance_standards.Element = AAZStrType() enhanced_security_monitoring = cls._schema_on_200.properties.enhanced_security_compliance.enhanced_security_monitoring enhanced_security_monitoring.value = AAZStrType() parameters = cls._schema_on_200.properties.parameters parameters.aml_workspace_id = AAZObjectType( serialized_name="amlWorkspaceId", ) _ShowHelper._build_schema_workspace_custom_string_parameter_read(parameters.aml_workspace_id) parameters.custom_private_subnet_name = AAZObjectType( serialized_name="customPrivateSubnetName", ) _ShowHelper._build_schema_workspace_custom_string_parameter_read(parameters.custom_private_subnet_name) parameters.custom_public_subnet_name = AAZObjectType( serialized_name="customPublicSubnetName", ) _ShowHelper._build_schema_workspace_custom_string_parameter_read(parameters.custom_public_subnet_name) parameters.custom_virtual_network_id = AAZObjectType( serialized_name="customVirtualNetworkId", ) _ShowHelper._build_schema_workspace_custom_string_parameter_read(parameters.custom_virtual_network_id) parameters.enable_no_public_ip = AAZObjectType( serialized_name="enableNoPublicIp", ) parameters.encryption = AAZObjectType() parameters.load_balancer_backend_pool_name = AAZObjectType( serialized_name="loadBalancerBackendPoolName", ) _ShowHelper._build_schema_workspace_custom_string_parameter_read(parameters.load_balancer_backend_pool_name) parameters.load_balancer_id = AAZObjectType( serialized_name="loadBalancerId", ) _ShowHelper._build_schema_workspace_custom_string_parameter_read(parameters.load_balancer_id) parameters.nat_gateway_name = AAZObjectType( serialized_name="natGatewayName", ) _ShowHelper._build_schema_workspace_custom_string_parameter_read(parameters.nat_gateway_name) parameters.prepare_encryption = AAZObjectType( serialized_name="prepareEncryption", ) _ShowHelper._build_schema_workspace_custom_boolean_parameter_read(parameters.prepare_encryption) parameters.public_ip_name = AAZObjectType( serialized_name="publicIpName", ) _ShowHelper._build_schema_workspace_custom_string_parameter_read(parameters.public_ip_name) parameters.require_infrastructure_encryption = AAZObjectType( serialized_name="requireInfrastructureEncryption", ) _ShowHelper._build_schema_workspace_custom_boolean_parameter_read(parameters.require_infrastructure_encryption) parameters.resource_tags = AAZObjectType( serialized_name="resourceTags", flags={"read_only": True}, ) parameters.storage_account_name = AAZObjectType( serialized_name="storageAccountName", ) _ShowHelper._build_schema_workspace_custom_string_parameter_read(parameters.storage_account_name) parameters.storage_account_sku_name = AAZObjectType( serialized_name="storageAccountSkuName", ) _ShowHelper._build_schema_workspace_custom_string_parameter_read(parameters.storage_account_sku_name) parameters.vnet_address_prefix = AAZObjectType( serialized_name="vnetAddressPrefix", ) _ShowHelper._build_schema_workspace_custom_string_parameter_read(parameters.vnet_address_prefix) enable_no_public_ip = cls._schema_on_200.properties.parameters.enable_no_public_ip enable_no_public_ip.type = AAZStrType( flags={"read_only": True}, ) enable_no_public_ip.value = AAZBoolType( flags={"required": True}, ) encryption = cls._schema_on_200.properties.parameters.encryption encryption.type = AAZStrType( flags={"read_only": True}, ) encryption.value = AAZObjectType() value = cls._schema_on_200.properties.parameters.encryption.value value.key_name = AAZStrType( serialized_name="KeyName", ) value.key_source = AAZStrType( serialized_name="keySource", ) value.keyvaulturi = AAZStrType() value.keyversion = AAZStrType() resource_tags = cls._schema_on_200.properties.parameters.resource_tags resource_tags.type = AAZStrType( flags={"read_only": True}, ) resource_tags.value = AAZFreeFormDictType( flags={"required": True}, ) 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( flags={"required": True}, ) _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", ) properties.private_endpoint = AAZObjectType( serialized_name="privateEndpoint", ) properties.private_link_service_connection_state = AAZObjectType( serialized_name="privateLinkServiceConnectionState", flags={"required": True}, ) 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( flags={"read_only": True}, ) 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", ) private_link_service_connection_state.description = AAZStrType() private_link_service_connection_state.status = AAZStrType( flags={"required": True}, ) sku = cls._schema_on_200.sku sku.name = AAZStrType( flags={"required": True}, ) sku.tier = 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 Show(AAZCommand): '''Show the workspace. :example: Show the workspace az databricks workspace show --resource-group MyResourceGroup --name MyWorkspace ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): pass class WorkspacesGet(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
27
1
33
2
30
0
1
0.01
1
2
1
0
5
0
6
6
535
56
474
66
447
5
215
56
198
2
1
1
18
9,427
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/_show.py
azext_databricks.aaz.latest.databricks.workspace._show._ShowHelper
class _ShowHelper: """Helper class for Show""" _schema_created_by_read = None @classmethod def _build_schema_created_by_read(cls, _schema): if cls._schema_created_by_read is not None: _schema.application_id = cls._schema_created_by_read.application_id _schema.oid = cls._schema_created_by_read.oid _schema.puid = cls._schema_created_by_read.puid return cls._schema_created_by_read = _schema_created_by_read = AAZObjectType() created_by_read = _schema_created_by_read created_by_read.application_id = AAZStrType( serialized_name="applicationId", flags={"read_only": True}, ) created_by_read.oid = AAZStrType( flags={"read_only": True}, ) created_by_read.puid = AAZStrType( flags={"read_only": True}, ) _schema.application_id = cls._schema_created_by_read.application_id _schema.oid = cls._schema_created_by_read.oid _schema.puid = cls._schema_created_by_read.puid _schema_managed_identity_configuration_read = None @classmethod def _build_schema_managed_identity_configuration_read(cls, _schema): if cls._schema_managed_identity_configuration_read is not None: _schema.principal_id = cls._schema_managed_identity_configuration_read.principal_id _schema.tenant_id = cls._schema_managed_identity_configuration_read.tenant_id _schema.type = cls._schema_managed_identity_configuration_read.type return cls._schema_managed_identity_configuration_read = _schema_managed_identity_configuration_read = AAZObjectType() managed_identity_configuration_read = _schema_managed_identity_configuration_read managed_identity_configuration_read.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) managed_identity_configuration_read.tenant_id = AAZStrType( serialized_name="tenantId", flags={"read_only": True}, ) managed_identity_configuration_read.type = AAZStrType( flags={"read_only": True}, ) _schema.principal_id = cls._schema_managed_identity_configuration_read.principal_id _schema.tenant_id = cls._schema_managed_identity_configuration_read.tenant_id _schema.type = cls._schema_managed_identity_configuration_read.type _schema_workspace_custom_boolean_parameter_read = None @classmethod def _build_schema_workspace_custom_boolean_parameter_read(cls, _schema): if cls._schema_workspace_custom_boolean_parameter_read is not None: _schema.type = cls._schema_workspace_custom_boolean_parameter_read.type _schema.value = cls._schema_workspace_custom_boolean_parameter_read.value return cls._schema_workspace_custom_boolean_parameter_read = _schema_workspace_custom_boolean_parameter_read = AAZObjectType() workspace_custom_boolean_parameter_read = _schema_workspace_custom_boolean_parameter_read workspace_custom_boolean_parameter_read.type = AAZStrType( flags={"read_only": True}, ) workspace_custom_boolean_parameter_read.value = AAZBoolType( flags={"required": True}, ) _schema.type = cls._schema_workspace_custom_boolean_parameter_read.type _schema.value = cls._schema_workspace_custom_boolean_parameter_read.value _schema_workspace_custom_string_parameter_read = None @classmethod def _build_schema_workspace_custom_string_parameter_read(cls, _schema): if cls._schema_workspace_custom_string_parameter_read is not None: _schema.type = cls._schema_workspace_custom_string_parameter_read.type _schema.value = cls._schema_workspace_custom_string_parameter_read.value return cls._schema_workspace_custom_string_parameter_read = _schema_workspace_custom_string_parameter_read = AAZObjectType() workspace_custom_string_parameter_read = _schema_workspace_custom_string_parameter_read workspace_custom_string_parameter_read.type = AAZStrType( flags={"read_only": True}, ) workspace_custom_string_parameter_read.value = AAZStrType( flags={"required": True}, ) _schema.type = cls._schema_workspace_custom_string_parameter_read.type _schema.value = cls._schema_workspace_custom_string_parameter_read.value
class _ShowHelper: '''Helper class for Show''' @classmethod def _build_schema_created_by_read(cls, _schema): pass @classmethod def _build_schema_managed_identity_configuration_read(cls, _schema): pass @classmethod def _build_schema_workspace_custom_boolean_parameter_read(cls, _schema): pass @classmethod def _build_schema_workspace_custom_string_parameter_read(cls, _schema): pass
9
1
21
3
18
0
2
0.01
0
0
0
0
0
0
4
4
103
20
82
21
73
1
55
13
50
2
0
1
8
9,428
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/_update.py
azext_databricks.aaz.latest.databricks.workspace._update.Update
class Update(AAZCommand): """Update the workspace. :example: Update the workspace's tags. az databricks workspace update --resource-group MyResourceGroup --name MyWorkspace --tags key1=value1 key2=value2 :example: Clean the workspace's tags. az databricks workspace update --resource-group MyResourceGroup --name MyWorkspace --tags "" :example: Prepare for CMK encryption by assigning identity for storage account. az databricks workspace update --resource-group MyResourceGroup --name MyWorkspace --prepare-encryption :example: Configure CMK encryption az databricks workspace update --resource-group MyResourceGroup --name MyWorkspace --key-source Microsoft.KeyVault --key-name MyKey --key-vault https://myKeyVault.vault.azure.net/ --key-version 00000000000000000000000000000000 :example: Revert encryption to Microsoft Managed Keys az databricks workspace update --resource-group MyResourceGroup --name MyWorkspace --key-source Default :example: Enable enhanced security monitoring feature az databricks workspace update --resource-group MyResourceGroup --name MyWorkspace --enable-enhanced-security-monitoring :example: Enable compliance security profile feature with specific compliance standards az databricks workspace update --resource-group MyResourceGroup --name MyWorkspace --enable-compliance-security-profile --compliance-standards='["HIPAA","PCI_DSS"]' """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/workspaces/{}", "2024-05-01"], ] } AZ_SUPPORT_NO_WAIT = True AZ_SUPPORT_GENERIC_UPDATE = True def _handler(self, command_args): super()._handler(command_args) return self.build_lro_poller(self._execute_operations, self._output) _args_schema = None @classmethod def _build_arguments_schema(cls, *args, **kwargs): if cls._args_schema is not None: return cls._args_schema cls._args_schema = super()._build_arguments_schema(*args, **kwargs) # define Arg Group "" _args_schema = cls._args_schema _args_schema.resource_group = AAZResourceGroupNameArg( required=True, ) _args_schema.name = AAZStrArg( options=["-n", "--name"], help="The name of the workspace.", required=True, id_part="name", fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) _args_schema.enable_no_public_ip = AAZBoolArg( options=["--enable-no-public-ip"], help="Flag to enable the no public ip feature.", ) _args_schema.prepare_encryption = AAZBoolArg( options=["--prepare-encryption"], help="Flag to enable the Managed Identity for managed storage account to prepare for CMK encryption.", ) _args_schema.storage_account_sku_name = AAZStrArg( options=["--sa-sku-name", "--storage-account-sku-name"], help="Storage account SKU name, ex: Standard_GRS, Standard_LRS. Refer https://aka.ms/storageskus for valid inputs.", ) _args_schema.public_network_access = AAZStrArg( options=["--public-network-access"], help="The network access type for accessing workspace. Set value to disabled to access workspace only via private link.", nullable=True, enum={"Disabled": "Disabled", "Enabled": "Enabled"}, ) _args_schema.required_nsg_rules = AAZStrArg( options=["--required-nsg-rules"], help="The type of Nsg rule for internal use only. Allowed values: AllRules, NoAzureDatabricksRules, NoAzureServiceRules.", nullable=True, enum={"AllRules": "AllRules", "NoAzureDatabricksRules": "NoAzureDatabricksRules", "NoAzureServiceRules": "NoAzureServiceRules"}, ) _args_schema.sku = AAZStrArg( options=["--sku"], help="The SKU tier name. Allowed values: premium, standard, trial.", ) _args_schema.tags = AAZDictArg( options=["--tags"], help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", nullable=True, ) tags = cls._args_schema.tags tags.Element = AAZStrArg( nullable=True, ) # define Arg Group "Encryption" _args_schema = cls._args_schema _args_schema.key_name = AAZStrArg( options=["--key-name"], arg_group="Encryption", help="The name of KeyVault key.", nullable=True, ) _args_schema.key_source = AAZStrArg( options=["--key-source"], arg_group="Encryption", help="The encryption key source (provider). Allowed values: Default, Microsoft.Keyvault.", nullable=True, enum={"Default": "Default", "Microsoft.Keyvault": "Microsoft.Keyvault"}, ) _args_schema.key_vault = AAZStrArg( options=["--key-vault"], arg_group="Encryption", help="The Uri of KeyVault.", nullable=True, ) _args_schema.key_version = AAZStrArg( options=["--key-version"], arg_group="Encryption", help="The version of KeyVault key. It is optional when updating CMK.", nullable=True, ) # define Arg Group "Managed Disk" _args_schema = cls._args_schema _args_schema.disk_key_source = AAZStrArg( options=["--disk-key-source"], arg_group="Managed Disk", help="The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Keyvault", enum={"Microsoft.Keyvault": "Microsoft.Keyvault"}, ) _args_schema.disk_key_name = AAZStrArg( options=["--disk-key-name"], arg_group="Managed Disk", help="The name of KeyVault key.", ) _args_schema.disk_key_vault = AAZStrArg( options=["--disk-key-vault"], arg_group="Managed Disk", help="The URI of KeyVault.", ) _args_schema.disk_key_version = AAZStrArg( options=["--disk-key-version"], arg_group="Managed Disk", help="The version of KeyVault key.", ) _args_schema.disk_key_auto_rotation = AAZBoolArg( options=["--disk-key-auto-rotation"], arg_group="Managed Disk", help="Indicate whether the latest key version should be automatically used for Managed Disk Encryption.", nullable=True, ) # define Arg Group "Managed Services" _args_schema = cls._args_schema _args_schema.managed_services_key_source = AAZStrArg( options=["--managed-services-key-source"], arg_group="Managed Services", help="The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Keyvault", enum={"Microsoft.Keyvault": "Microsoft.Keyvault"}, ) _args_schema.managed_services_key_name = AAZStrArg( options=["--ms-key-name", "--managed-services-key-name"], arg_group="Managed Services", help="The name of KeyVault key.", ) _args_schema.managed_services_key_vault = AAZStrArg( options=["--ms-key-vault", "--managed-services-key-vault"], arg_group="Managed Services", help="The Uri of KeyVault.", ) _args_schema.managed_services_key_version = AAZStrArg( options=["--ms-key-version", "--managed-services-key-version"], arg_group="Managed Services", help="The version of KeyVault key.", ) # define Arg Group "Parameters" # define Arg Group "Properties" _args_schema = cls._args_schema _args_schema.access_connector = AAZObjectArg( options=["--access-connector"], arg_group="Properties", help="Access Connector Resource that is going to be associated with Databricks Workspace", nullable=True, ) _args_schema.default_catalog = AAZObjectArg( options=["--default-catalog"], arg_group="Properties", help="Properties for Default Catalog configuration during workspace creation.", nullable=True, ) _args_schema.default_storage_firewall = AAZStrArg( options=["--default-storage-firewall"], arg_group="Properties", help="Gets or Sets Default Storage Firewall configuration information", nullable=True, enum={"Disabled": "Disabled", "Enabled": "Enabled"}, ) _args_schema.enable_automatic_cluster_update = AAZBoolArg( options=["--enable-automatic-cluster-update", "--enable-acu"], arg_group="Enhanced Security Compliance", help="Enable Automatic Cluster Update feature.", nullable=True, enum={ 'true': True, 't': True, 'yes': True, 'y': True, '1': True, "false": False, 'f': False, 'no': False, 'n': False, '0': False, "Enabled": True, "Disabled": False, "enabled": True, "disabled": False, } ) _args_schema.compliance_standards = AAZListArg( options=["--compliance-standards"], arg_group="Enhanced Security Compliance", help="Compliance Standards associated with the workspace, allowed values: NONE, HIPAA, PCI_DSS.", nullable=True, ) _args_schema.compliance_standards.Element = AAZStrArg( nullable=True, arg_group="Enhanced Security Compliance", help="Compliance standards, allowed values: NONE, HIPAA, PCI_DSS.", enum={"HIPAA": "HIPAA", "NONE": "NONE", "PCI_DSS": "PCI_DSS"}, ) _args_schema.enable_compliance_security_profile = AAZBoolArg( options=["--enable-compliance-security-profile", "--enable-csp"], arg_group="Enhanced Security Compliance", help="Enable Compliance Security Profile.", nullable=True, enum={ 'true': True, 't': True, 'yes': True, 'y': True, '1': True, "false": False, 'f': False, 'no': False, 'n': False, '0': False, "Enabled": True, "Disabled": False, "enabled": True, "disabled": False, } ) _args_schema.enable_enhanced_security_monitoring = AAZBoolArg( options=["--enable-enhanced-security-monitoring", "--enable-esm"], arg_group="Enhanced Security Compliance", help="Enable Enhanced Security Monitoring feature.", nullable=True, enum={ 'true': True, 't': True, 'yes': True, 'y': True, '1': True, "false": False, 'f': False, 'no': False, 'n': False, '0': False, "Enabled": True, "Disabled": False, "enabled": True, "disabled": False, } ) _args_schema.enhanced_security_compliance = AAZObjectArg( options=["--enhanced-security-compliance"], arg_group="Properties", help="Contains settings related to the Enhanced Security and Compliance Add-On.", nullable=True, ) access_connector = cls._args_schema.access_connector access_connector.id = AAZResourceIdArg( options=["id"], help="The resource ID of Azure Databricks Access Connector Resource.", ) access_connector.identity_type = AAZStrArg( options=["identity-type"], help="The identity type of the Access Connector Resource.", enum={"SystemAssigned": "SystemAssigned", "UserAssigned": "UserAssigned"}, ) access_connector.user_assigned_identity_id = AAZResourceIdArg( options=["user-assigned-identity-id"], help="The resource ID of the User Assigned Identity associated with the Access Connector Resource. This is required for type 'UserAssigned' and not valid for type 'SystemAssigned'.", nullable=True, ) default_catalog = cls._args_schema.default_catalog default_catalog.initial_name = AAZStrArg( options=["initial-name"], help="Specifies the initial Name of default catalog. If not specified, the name of the workspace will be used.", nullable=True, ) default_catalog.initial_type = AAZStrArg( options=["initial-type"], help="Defines the initial type of the default catalog. Possible values (case-insensitive): HiveMetastore, UnityCatalog", nullable=True, enum={"HiveMetastore": "HiveMetastore", "UnityCatalog": "UnityCatalog"}, ) enhanced_security_compliance = cls._args_schema.enhanced_security_compliance enhanced_security_compliance.automatic_cluster_update = AAZObjectArg( options=["automatic-cluster-update"], help="Status of automated cluster updates feature.", nullable=True, ) enhanced_security_compliance.compliance_security_profile = AAZObjectArg( options=["compliance-security-profile"], help="Status of Compliance Security Profile feature.", nullable=True, ) enhanced_security_compliance.enhanced_security_monitoring = AAZObjectArg( options=["enhanced-security-monitoring"], help="Status of Enhanced Security Monitoring feature.", nullable=True, ) automatic_cluster_update = cls._args_schema.enhanced_security_compliance.automatic_cluster_update automatic_cluster_update.value = AAZStrArg( options=["value"], nullable=True, enum={"Disabled": "Disabled", "Enabled": "Enabled"}, ) compliance_security_profile = cls._args_schema.enhanced_security_compliance.compliance_security_profile compliance_security_profile.compliance_standards = AAZListArg( options=["compliance-standards"], help="Compliance standards associated with the workspace.", nullable=True, ) compliance_security_profile.value = AAZStrArg( options=["value"], nullable=True, enum={"Disabled": "Disabled", "Enabled": "Enabled"}, ) compliance_standards = cls._args_schema.enhanced_security_compliance.compliance_security_profile.compliance_standards compliance_standards.Element = AAZStrArg( nullable=True, enum={"HIPAA": "HIPAA", "NONE": "NONE", "PCI_DSS": "PCI_DSS"}, ) enhanced_security_monitoring = cls._args_schema.enhanced_security_compliance.enhanced_security_monitoring enhanced_security_monitoring.value = AAZStrArg( options=["value"], nullable=True, enum={"Disabled": "Disabled", "Enabled": "Enabled"}, ) # define Arg Group "Sku" return cls._args_schema _args_workspace_custom_boolean_parameter_update = None @classmethod def _build_args_workspace_custom_boolean_parameter_update(cls, _schema): if cls._args_workspace_custom_boolean_parameter_update is not None: _schema.prepare_encryption_value = cls._args_workspace_custom_boolean_parameter_update.prepare_encryption_value return cls._args_workspace_custom_boolean_parameter_update = AAZObjectArg( nullable=True, ) workspace_custom_boolean_parameter_update = cls._args_workspace_custom_boolean_parameter_update workspace_custom_boolean_parameter_update.prepare_encryption_value = AAZBoolArg( options=["prepare-encryption-value"], help="The value which should be used for this field.", ) _schema.prepare_encryption_value = cls._args_workspace_custom_boolean_parameter_update.prepare_encryption_value _args_workspace_custom_string_parameter_update = None @classmethod def _build_args_workspace_custom_string_parameter_update(cls, _schema): if cls._args_workspace_custom_string_parameter_update is not None: _schema.value = cls._args_workspace_custom_string_parameter_update.value return cls._args_workspace_custom_string_parameter_update = AAZObjectArg( nullable=True, ) workspace_custom_string_parameter_update = cls._args_workspace_custom_string_parameter_update workspace_custom_string_parameter_update.value = AAZStrArg( options=["value"], help="The value which should be used for this field.", ) _schema.value = cls._args_workspace_custom_string_parameter_update.value def _execute_operations(self): self.pre_operations() self.WorkspacesGet(ctx=self.ctx)() self.pre_instance_update(self.ctx.vars.instance) self.InstanceUpdateByJson(ctx=self.ctx)() self.InstanceUpdateByGeneric(ctx=self.ctx)() self.post_instance_update(self.ctx.vars.instance) yield self.WorkspacesCreateOrUpdate(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass @register_callback def pre_instance_update(self, instance): pass @register_callback def post_instance_update(self, instance): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) return result class WorkspacesGet(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.Databricks/workspaces/{workspaceName}", **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( "subscriptionId", self.ctx.subscription_id, required=True, ), **self.serialize_url_param( "workspaceName", self.ctx.args.name, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2024-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _UpdateHelper._build_schema_workspace_read(cls._schema_on_200) return cls._schema_on_200 class WorkspacesCreateOrUpdate(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.Databricks/workspaces/{workspaceName}", **self.url_parameters ) @property def method(self): return "PUT" @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( "subscriptionId", self.ctx.subscription_id, required=True, ), **self.serialize_url_param( "workspaceName", self.ctx.args.name, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2024-05-01", 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_workspace_read(cls._schema_on_200_201) return cls._schema_on_200_201 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": {"required": True, "client_flatten": True}}) _builder.set_prop("sku", AAZObjectType) _builder.set_prop("tags", AAZDictType, ".tags") properties = _builder.get(".properties") if properties is not None: properties.set_prop("accessConnector", AAZObjectType, ".access_connector") properties.set_prop("defaultCatalog", AAZObjectType, ".default_catalog") properties.set_prop("defaultStorageFirewall", AAZStrType, ".default_storage_firewall") properties.set_prop("encryption", AAZObjectType) properties.set_prop("enhancedSecurityCompliance", AAZObjectType, ".enhanced_security_compliance") properties.set_prop("parameters", AAZObjectType) properties.set_prop("publicNetworkAccess", AAZStrType, ".public_network_access") properties.set_prop("requiredNsgRules", AAZStrType, ".required_nsg_rules") access_connector = _builder.get(".properties.accessConnector") if access_connector is not None: access_connector.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) access_connector.set_prop("identityType", AAZStrType, ".identity_type", typ_kwargs={"flags": {"required": True}}) access_connector.set_prop("userAssignedIdentityId", AAZStrType, ".user_assigned_identity_id") default_catalog = _builder.get(".properties.defaultCatalog") if default_catalog is not None: default_catalog.set_prop("initialName", AAZStrType, ".initial_name") default_catalog.set_prop("initialType", AAZStrType, ".initial_type") encryption = _builder.get(".properties.encryption") if encryption is not None: encryption.set_prop("entities", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}}) entities = _builder.get(".properties.encryption.entities") if entities is not None: entities.set_prop("managedDisk", AAZObjectType) entities.set_prop("managedServices", AAZObjectType) managed_disk = _builder.get(".properties.encryption.entities.managedDisk") if managed_disk is not None: managed_disk.set_prop("keySource", AAZStrType, ".disk_key_source", typ_kwargs={"flags": {"required": True}}) managed_disk.set_prop("keyVaultProperties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}}) managed_disk.set_prop("rotationToLatestKeyVersionEnabled", AAZBoolType, ".disk_key_auto_rotation") key_vault_properties = _builder.get(".properties.encryption.entities.managedDisk.keyVaultProperties") if key_vault_properties is not None: key_vault_properties.set_prop("keyName", AAZStrType, ".disk_key_name", typ_kwargs={"flags": {"required": True}}) key_vault_properties.set_prop("keyVaultUri", AAZStrType, ".disk_key_vault", typ_kwargs={"flags": {"required": True}}) key_vault_properties.set_prop("keyVersion", AAZStrType, ".disk_key_version", typ_kwargs={"flags": {"required": True}}) managed_services = _builder.get(".properties.encryption.entities.managedServices") if managed_services is not None: managed_services.set_prop("keySource", AAZStrType, ".managed_services_key_source", typ_kwargs={"flags": {"required": True}}) managed_services.set_prop("keyVaultProperties", AAZObjectType) key_vault_properties = _builder.get(".properties.encryption.entities.managedServices.keyVaultProperties") if key_vault_properties is not None: key_vault_properties.set_prop("keyName", AAZStrType, ".managed_services_key_name", typ_kwargs={"flags": {"required": True}}) key_vault_properties.set_prop("keyVaultUri", AAZStrType, ".managed_services_key_vault", typ_kwargs={"flags": {"required": True}}) key_vault_properties.set_prop("keyVersion", AAZStrType, ".managed_services_key_version", typ_kwargs={"flags": {"required": True}}) enhanced_security_compliance = _builder.get(".properties.enhancedSecurityCompliance") if enhanced_security_compliance is not None: enhanced_security_compliance.set_prop("automaticClusterUpdate", AAZObjectType, ".automatic_cluster_update") enhanced_security_compliance.set_prop("complianceSecurityProfile", AAZObjectType, ".compliance_security_profile") enhanced_security_compliance.set_prop("enhancedSecurityMonitoring", AAZObjectType, ".enhanced_security_monitoring") automatic_cluster_update = _builder.get(".properties.enhancedSecurityCompliance.automaticClusterUpdate") if automatic_cluster_update is not None: automatic_cluster_update.set_prop("value", AAZStrType, ".value") compliance_security_profile = _builder.get(".properties.enhancedSecurityCompliance.complianceSecurityProfile") if compliance_security_profile is not None: compliance_security_profile.set_prop("complianceStandards", AAZListType, ".compliance_standards") compliance_security_profile.set_prop("value", AAZStrType, ".value") compliance_standards = _builder.get(".properties.enhancedSecurityCompliance.complianceSecurityProfile.complianceStandards") if compliance_standards is not None: compliance_standards.set_elements(AAZStrType, ".") enhanced_security_monitoring = _builder.get(".properties.enhancedSecurityCompliance.enhancedSecurityMonitoring") if enhanced_security_monitoring is not None: enhanced_security_monitoring.set_prop("value", AAZStrType, ".value") args = self.ctx.args.to_serialized_data() # Check if any of the enhanced security compliance parameters are set if set(['enable_compliance_security_profile', 'enable_csp', 'enable_enhanced_security_monitoring', 'enable_esm', 'enable_automatic_cluster_update', 'enable_acu', 'compliance_standards']).intersection(set(args.keys())): if enhanced_security_compliance is None: # In case the `--enhanced-security-compliance` parameter doesn't exist, this object should be created properties.set_prop("enhancedSecurityCompliance", AAZObjectType) enhanced_security_compliance = _builder.get(".properties.enhancedSecurityCompliance") if 'enable_compliance_security_profile' in args or 'enable_csp' in args: compliance_security_profile = enhanced_security_compliance.set_prop("complianceSecurityProfile", AAZObjectType) if args.get('enable_compliance_security_profile') or args.get('enable_csp'): compliance_security_profile.set_const("value", "Enabled", AAZStrType) # Process the compliance standards only if the compliance security profile is enabled compliance_standards = compliance_security_profile.set_prop("complianceStandards", AAZListType, ".compliance_standards") if compliance_standards is None: # Create an empty list if it doesn't exist compliance_security_profile.set_const("complianceStandards", [], AAZListType) else: compliance_standards.set_elements(AAZStrType, ".") else: compliance_security_profile.set_const("value", "Disabled", AAZStrType) compliance_security_profile.set_const("complianceStandards", [], AAZListType) else: # Set default values if these parameters are not set enhanced_security_compliance.set_prop("complianceSecurityProfile", AAZObjectType) compliance_security_profile = _builder.get(".properties.enhancedSecurityCompliance.complianceSecurityProfile") compliance_security_profile.set_const("value", "Disabled", AAZStrType) compliance_security_profile.set_const("complianceStandards", [], AAZListType) if 'enable_enhanced_security_monitoring' in args or 'enable_esm' in args: enhanced_security_monitoring = enhanced_security_compliance.set_prop("enhancedSecurityMonitoring", AAZObjectType) if args.get('enable_enhanced_security_monitoring') or args.get('enable_esm'): enhanced_security_monitoring.set_const("value", "Enabled", AAZStrType) else: enhanced_security_monitoring.set_const("value", "Disabled", AAZStrType) if 'enable_automatic_cluster_update' in args or 'enable_acu' in args: automatic_cluster_update = enhanced_security_compliance.set_prop("automaticClusterUpdate", AAZObjectType) if args.get('enable_automatic_cluster_update') or args.get('enable_acu'): automatic_cluster_update.set_const("value", "Enabled", AAZStrType) else: automatic_cluster_update.set_const("value", "Disabled", AAZStrType) parameters = _builder.get(".properties.parameters") if parameters is not None: parameters.set_prop("enableNoPublicIp", AAZObjectType) parameters.set_prop("encryption", AAZObjectType) parameters.set_prop("prepareEncryption", AAZObjectType) parameters.set_prop("storageAccountSkuName", AAZObjectType) enable_no_public_ip = _builder.get(".properties.parameters.enableNoPublicIp") if enable_no_public_ip is not None: enable_no_public_ip.set_prop("value", AAZBoolType, ".enable_no_public_ip", typ_kwargs={"flags": {"required": True}}) encryption = _builder.get(".properties.parameters.encryption") if encryption is not None: encryption.set_prop("value", AAZObjectType) value = _builder.get(".properties.parameters.encryption.value") if value is not None: value.set_prop("KeyName", AAZStrType, ".key_name") value.set_prop("keySource", AAZStrType, ".key_source") value.set_prop("keyvaulturi", AAZStrType, ".key_vault") value.set_prop("keyversion", AAZStrType, ".key_version") prepare_encryption = _builder.get(".properties.parameters.prepareEncryption") if prepare_encryption is not None: prepare_encryption.set_prop("value", AAZBoolType, ".prepare_encryption", typ_kwargs={"flags": {"required": True}}) storage_account_sku_name = _builder.get(".properties.parameters.storageAccountSkuName") if storage_account_sku_name is not None: storage_account_sku_name.set_prop("value", AAZStrType, ".storage_account_sku_name", typ_kwargs={"flags": {"required": True}}) sku = _builder.get(".sku") if sku is not None: sku.set_prop("name", AAZStrType, ".sku", typ_kwargs={"flags": {"required": True}}) tags = _builder.get(".tags") if tags is not None: tags.set_elements(AAZStrType, ".") return _instance_value class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): def __call__(self, *args, **kwargs): self._update_instance_by_generic( self.ctx.vars.instance, self.ctx.generic_update_args )
class Update(AAZCommand): '''Update the workspace. :example: Update the workspace's tags. az databricks workspace update --resource-group MyResourceGroup --name MyWorkspace --tags key1=value1 key2=value2 :example: Clean the workspace's tags. az databricks workspace update --resource-group MyResourceGroup --name MyWorkspace --tags "" :example: Prepare for CMK encryption by assigning identity for storage account. az databricks workspace update --resource-group MyResourceGroup --name MyWorkspace --prepare-encryption :example: Configure CMK encryption az databricks workspace update --resource-group MyResourceGroup --name MyWorkspace --key-source Microsoft.KeyVault --key-name MyKey --key-vault https://myKeyVault.vault.azure.net/ --key-version 00000000000000000000000000000000 :example: Revert encryption to Microsoft Managed Keys az databricks workspace update --resource-group MyResourceGroup --name MyWorkspace --key-source Default :example: Enable enhanced security monitoring feature az databricks workspace update --resource-group MyResourceGroup --name MyWorkspace --enable-enhanced-security-monitoring :example: Enable compliance security profile feature with specific compliance standards az databricks workspace update --resource-group MyResourceGroup --name MyWorkspace --enable-compliance-security-profile --compliance-standards='["HIPAA","PCI_DSS"]' ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass @classmethod def _build_args_workspace_custom_boolean_parameter_update(cls, _schema): pass @classmethod def _build_args_workspace_custom_string_parameter_update(cls, _schema): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass @register_callback def pre_instance_update(self, instance): pass @register_callback def post_instance_update(self, instance): pass def _output(self, *args, **kwargs): pass class WorkspacesGet(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 class WorkspacesCreateOrUpdate(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 class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): def __call__(self, *args, **kwargs): pass def _update_instance(self, instance): pass class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): def __call__(self, *args, **kwargs): pass
59
1
21
2
19
0
2
0.04
1
5
4
1
7
0
10
10
791
108
655
117
596
28
314
94
277
32
1
4
71
9,429
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/_update.py
azext_databricks.aaz.latest.databricks.workspace._update._UpdateHelper
class _UpdateHelper: """Helper class for Update""" @classmethod def _build_schema_workspace_custom_boolean_parameter_update(cls, _builder): if _builder is None: return _builder.set_prop("value", AAZBoolType, ".prepare_encryption_value", typ_kwargs={"flags": {"required": True}}) @classmethod def _build_schema_workspace_custom_string_parameter_update(cls, _builder): if _builder is None: return _builder.set_prop("value", AAZStrType, ".value", typ_kwargs={"flags": {"required": True}}) _schema_created_by_read = None @classmethod def _build_schema_created_by_read(cls, _schema): if cls._schema_created_by_read is not None: _schema.application_id = cls._schema_created_by_read.application_id _schema.oid = cls._schema_created_by_read.oid _schema.puid = cls._schema_created_by_read.puid return cls._schema_created_by_read = _schema_created_by_read = AAZObjectType() created_by_read = _schema_created_by_read created_by_read.application_id = AAZStrType( serialized_name="applicationId", flags={"read_only": True}, ) created_by_read.oid = AAZStrType( flags={"read_only": True}, ) created_by_read.puid = AAZStrType( flags={"read_only": True}, ) _schema.application_id = cls._schema_created_by_read.application_id _schema.oid = cls._schema_created_by_read.oid _schema.puid = cls._schema_created_by_read.puid _schema_managed_identity_configuration_read = None @classmethod def _build_schema_managed_identity_configuration_read(cls, _schema): if cls._schema_managed_identity_configuration_read is not None: _schema.principal_id = cls._schema_managed_identity_configuration_read.principal_id _schema.tenant_id = cls._schema_managed_identity_configuration_read.tenant_id _schema.type = cls._schema_managed_identity_configuration_read.type return cls._schema_managed_identity_configuration_read = _schema_managed_identity_configuration_read = AAZObjectType() managed_identity_configuration_read = _schema_managed_identity_configuration_read managed_identity_configuration_read.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) managed_identity_configuration_read.tenant_id = AAZStrType( serialized_name="tenantId", flags={"read_only": True}, ) managed_identity_configuration_read.type = AAZStrType( flags={"read_only": True}, ) _schema.principal_id = cls._schema_managed_identity_configuration_read.principal_id _schema.tenant_id = cls._schema_managed_identity_configuration_read.tenant_id _schema.type = cls._schema_managed_identity_configuration_read.type _schema_workspace_custom_boolean_parameter_read = None @classmethod def _build_schema_workspace_custom_boolean_parameter_read(cls, _schema): if cls._schema_workspace_custom_boolean_parameter_read is not None: _schema.type = cls._schema_workspace_custom_boolean_parameter_read.type _schema.value = cls._schema_workspace_custom_boolean_parameter_read.value return cls._schema_workspace_custom_boolean_parameter_read = _schema_workspace_custom_boolean_parameter_read = AAZObjectType() workspace_custom_boolean_parameter_read = _schema_workspace_custom_boolean_parameter_read workspace_custom_boolean_parameter_read.type = AAZStrType( flags={"read_only": True}, ) workspace_custom_boolean_parameter_read.value = AAZBoolType( flags={"required": True}, ) _schema.type = cls._schema_workspace_custom_boolean_parameter_read.type _schema.value = cls._schema_workspace_custom_boolean_parameter_read.value _schema_workspace_custom_string_parameter_read = None @classmethod def _build_schema_workspace_custom_string_parameter_read(cls, _schema): if cls._schema_workspace_custom_string_parameter_read is not None: _schema.type = cls._schema_workspace_custom_string_parameter_read.type _schema.value = cls._schema_workspace_custom_string_parameter_read.value return cls._schema_workspace_custom_string_parameter_read = _schema_workspace_custom_string_parameter_read = AAZObjectType() workspace_custom_string_parameter_read = _schema_workspace_custom_string_parameter_read workspace_custom_string_parameter_read.type = AAZStrType( flags={"read_only": True}, ) workspace_custom_string_parameter_read.value = AAZStrType( flags={"required": True}, ) _schema.type = cls._schema_workspace_custom_string_parameter_read.type _schema.value = cls._schema_workspace_custom_string_parameter_read.value _schema_workspace_read = None @classmethod def _build_schema_workspace_read(cls, _schema): if cls._schema_workspace_read is not None: _schema.id = cls._schema_workspace_read.id _schema.location = cls._schema_workspace_read.location _schema.name = cls._schema_workspace_read.name _schema.properties = cls._schema_workspace_read.properties _schema.sku = cls._schema_workspace_read.sku _schema.system_data = cls._schema_workspace_read.system_data _schema.tags = cls._schema_workspace_read.tags _schema.type = cls._schema_workspace_read.type return cls._schema_workspace_read = _schema_workspace_read = AAZObjectType() workspace_read = _schema_workspace_read workspace_read.id = AAZStrType( flags={"read_only": True}, ) workspace_read.location = AAZStrType( flags={"required": True}, ) workspace_read.name = AAZStrType( flags={"read_only": True}, ) workspace_read.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) workspace_read.sku = AAZObjectType() workspace_read.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) workspace_read.tags = AAZDictType() workspace_read.type = AAZStrType( flags={"read_only": True}, ) properties = _schema_workspace_read.properties properties.access_connector = AAZObjectType( serialized_name="accessConnector", ) properties.authorizations = AAZListType() properties.created_by = AAZObjectType( serialized_name="createdBy", ) cls._build_schema_created_by_read(properties.created_by) properties.created_date_time = AAZStrType( serialized_name="createdDateTime", flags={"read_only": True}, ) properties.default_catalog = AAZObjectType( serialized_name="defaultCatalog", ) properties.default_storage_firewall = AAZStrType( serialized_name="defaultStorageFirewall", ) properties.disk_encryption_set_id = AAZStrType( serialized_name="diskEncryptionSetId", flags={"read_only": True}, ) properties.encryption = AAZObjectType() properties.enhanced_security_compliance = AAZObjectType( serialized_name="enhancedSecurityCompliance", ) properties.is_uc_enabled = AAZBoolType( serialized_name="isUcEnabled", flags={"read_only": True}, ) properties.managed_disk_identity = AAZObjectType( serialized_name="managedDiskIdentity", ) cls._build_schema_managed_identity_configuration_read(properties.managed_disk_identity) properties.managed_resource_group_id = AAZStrType( serialized_name="managedResourceGroupId", flags={"required": True}, ) properties.parameters = AAZObjectType() properties.private_endpoint_connections = AAZListType( serialized_name="privateEndpointConnections", flags={"read_only": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.public_network_access = AAZStrType( serialized_name="publicNetworkAccess", ) properties.required_nsg_rules = AAZStrType( serialized_name="requiredNsgRules", ) properties.storage_account_identity = AAZObjectType( serialized_name="storageAccountIdentity", ) cls._build_schema_managed_identity_configuration_read(properties.storage_account_identity) properties.ui_definition_uri = AAZStrType( serialized_name="uiDefinitionUri", ) properties.updated_by = AAZObjectType( serialized_name="updatedBy", ) cls._build_schema_created_by_read(properties.updated_by) properties.workspace_id = AAZStrType( serialized_name="workspaceId", flags={"read_only": True}, ) properties.workspace_url = AAZStrType( serialized_name="workspaceUrl", flags={"read_only": True}, ) access_connector = _schema_workspace_read.properties.access_connector access_connector.id = AAZStrType( flags={"required": True}, ) access_connector.identity_type = AAZStrType( serialized_name="identityType", flags={"required": True}, ) access_connector.user_assigned_identity_id = AAZStrType( serialized_name="userAssignedIdentityId", ) authorizations = _schema_workspace_read.properties.authorizations authorizations.Element = AAZObjectType() _element = _schema_workspace_read.properties.authorizations.Element _element.principal_id = AAZStrType( serialized_name="principalId", flags={"required": True}, ) _element.role_definition_id = AAZStrType( serialized_name="roleDefinitionId", flags={"required": True}, ) default_catalog = _schema_workspace_read.properties.default_catalog default_catalog.initial_name = AAZStrType( serialized_name="initialName", ) default_catalog.initial_type = AAZStrType( serialized_name="initialType", ) encryption = _schema_workspace_read.properties.encryption encryption.entities = AAZObjectType( flags={"required": True}, ) entities = _schema_workspace_read.properties.encryption.entities entities.managed_disk = AAZObjectType( serialized_name="managedDisk", ) entities.managed_services = AAZObjectType( serialized_name="managedServices", ) managed_disk = _schema_workspace_read.properties.encryption.entities.managed_disk managed_disk.key_source = AAZStrType( serialized_name="keySource", flags={"required": True}, ) managed_disk.key_vault_properties = AAZObjectType( serialized_name="keyVaultProperties", flags={"required": True}, ) managed_disk.rotation_to_latest_key_version_enabled = AAZBoolType( serialized_name="rotationToLatestKeyVersionEnabled", ) key_vault_properties = _schema_workspace_read.properties.encryption.entities.managed_disk.key_vault_properties key_vault_properties.key_name = AAZStrType( serialized_name="keyName", flags={"required": True}, ) key_vault_properties.key_vault_uri = AAZStrType( serialized_name="keyVaultUri", flags={"required": True}, ) key_vault_properties.key_version = AAZStrType( serialized_name="keyVersion", flags={"required": True}, ) managed_services = _schema_workspace_read.properties.encryption.entities.managed_services managed_services.key_source = AAZStrType( serialized_name="keySource", flags={"required": True}, ) managed_services.key_vault_properties = AAZObjectType( serialized_name="keyVaultProperties", ) key_vault_properties = _schema_workspace_read.properties.encryption.entities.managed_services.key_vault_properties key_vault_properties.key_name = AAZStrType( serialized_name="keyName", flags={"required": True}, ) key_vault_properties.key_vault_uri = AAZStrType( serialized_name="keyVaultUri", flags={"required": True}, ) key_vault_properties.key_version = AAZStrType( serialized_name="keyVersion", flags={"required": True}, ) enhanced_security_compliance = _schema_workspace_read.properties.enhanced_security_compliance enhanced_security_compliance.automatic_cluster_update = AAZObjectType( serialized_name="automaticClusterUpdate", ) enhanced_security_compliance.compliance_security_profile = AAZObjectType( serialized_name="complianceSecurityProfile", ) enhanced_security_compliance.enhanced_security_monitoring = AAZObjectType( serialized_name="enhancedSecurityMonitoring", ) automatic_cluster_update = _schema_workspace_read.properties.enhanced_security_compliance.automatic_cluster_update automatic_cluster_update.value = AAZStrType() compliance_security_profile = _schema_workspace_read.properties.enhanced_security_compliance.compliance_security_profile compliance_security_profile.compliance_standards = AAZListType( serialized_name="complianceStandards", ) compliance_security_profile.value = AAZStrType() compliance_standards = _schema_workspace_read.properties.enhanced_security_compliance.compliance_security_profile.compliance_standards compliance_standards.Element = AAZStrType() enhanced_security_monitoring = _schema_workspace_read.properties.enhanced_security_compliance.enhanced_security_monitoring enhanced_security_monitoring.value = AAZStrType() parameters = _schema_workspace_read.properties.parameters parameters.aml_workspace_id = AAZObjectType( serialized_name="amlWorkspaceId", ) cls._build_schema_workspace_custom_string_parameter_read(parameters.aml_workspace_id) parameters.custom_private_subnet_name = AAZObjectType( serialized_name="customPrivateSubnetName", ) cls._build_schema_workspace_custom_string_parameter_read(parameters.custom_private_subnet_name) parameters.custom_public_subnet_name = AAZObjectType( serialized_name="customPublicSubnetName", ) cls._build_schema_workspace_custom_string_parameter_read(parameters.custom_public_subnet_name) parameters.custom_virtual_network_id = AAZObjectType( serialized_name="customVirtualNetworkId", ) cls._build_schema_workspace_custom_string_parameter_read(parameters.custom_virtual_network_id) parameters.enable_no_public_ip = AAZObjectType( serialized_name="enableNoPublicIp", ) parameters.encryption = AAZObjectType() parameters.load_balancer_backend_pool_name = AAZObjectType( serialized_name="loadBalancerBackendPoolName", ) cls._build_schema_workspace_custom_string_parameter_read(parameters.load_balancer_backend_pool_name) parameters.load_balancer_id = AAZObjectType( serialized_name="loadBalancerId", ) cls._build_schema_workspace_custom_string_parameter_read(parameters.load_balancer_id) parameters.nat_gateway_name = AAZObjectType( serialized_name="natGatewayName", ) cls._build_schema_workspace_custom_string_parameter_read(parameters.nat_gateway_name) parameters.prepare_encryption = AAZObjectType( serialized_name="prepareEncryption", ) cls._build_schema_workspace_custom_boolean_parameter_read(parameters.prepare_encryption) parameters.public_ip_name = AAZObjectType( serialized_name="publicIpName", ) cls._build_schema_workspace_custom_string_parameter_read(parameters.public_ip_name) parameters.require_infrastructure_encryption = AAZObjectType( serialized_name="requireInfrastructureEncryption", ) cls._build_schema_workspace_custom_boolean_parameter_read(parameters.require_infrastructure_encryption) parameters.resource_tags = AAZObjectType( serialized_name="resourceTags", flags={"read_only": True}, ) parameters.storage_account_name = AAZObjectType( serialized_name="storageAccountName", ) cls._build_schema_workspace_custom_string_parameter_read(parameters.storage_account_name) parameters.storage_account_sku_name = AAZObjectType( serialized_name="storageAccountSkuName", ) cls._build_schema_workspace_custom_string_parameter_read(parameters.storage_account_sku_name) parameters.vnet_address_prefix = AAZObjectType( serialized_name="vnetAddressPrefix", ) cls._build_schema_workspace_custom_string_parameter_read(parameters.vnet_address_prefix) enable_no_public_ip = _schema_workspace_read.properties.parameters.enable_no_public_ip enable_no_public_ip.type = AAZStrType( flags={"read_only": True}, ) enable_no_public_ip.value = AAZBoolType( flags={"required": True}, ) encryption = _schema_workspace_read.properties.parameters.encryption encryption.type = AAZStrType( flags={"read_only": True}, ) encryption.value = AAZObjectType() value = _schema_workspace_read.properties.parameters.encryption.value value.key_name = AAZStrType( serialized_name="KeyName", ) value.key_source = AAZStrType( serialized_name="keySource", ) value.keyvaulturi = AAZStrType() value.keyversion = AAZStrType() resource_tags = _schema_workspace_read.properties.parameters.resource_tags resource_tags.type = AAZStrType( flags={"read_only": True}, ) resource_tags.value = AAZFreeFormDictType( flags={"required": True}, ) private_endpoint_connections = _schema_workspace_read.properties.private_endpoint_connections private_endpoint_connections.Element = AAZObjectType() _element = _schema_workspace_read.properties.private_endpoint_connections.Element _element.id = AAZStrType( flags={"read_only": True}, ) _element.name = AAZStrType( flags={"read_only": True}, ) _element.properties = AAZObjectType( flags={"required": True}, ) _element.type = AAZStrType( flags={"read_only": True}, ) properties = _schema_workspace_read.properties.private_endpoint_connections.Element.properties properties.group_ids = AAZListType( serialized_name="groupIds", ) properties.private_endpoint = AAZObjectType( serialized_name="privateEndpoint", ) properties.private_link_service_connection_state = AAZObjectType( serialized_name="privateLinkServiceConnectionState", flags={"required": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) group_ids = _schema_workspace_read.properties.private_endpoint_connections.Element.properties.group_ids group_ids.Element = AAZStrType() private_endpoint = _schema_workspace_read.properties.private_endpoint_connections.Element.properties.private_endpoint private_endpoint.id = AAZStrType( flags={"read_only": True}, ) private_link_service_connection_state = _schema_workspace_read.properties.private_endpoint_connections.Element.properties.private_link_service_connection_state private_link_service_connection_state.actions_required = AAZStrType( serialized_name="actionsRequired", ) private_link_service_connection_state.description = AAZStrType() private_link_service_connection_state.status = AAZStrType( flags={"required": True}, ) sku = _schema_workspace_read.sku sku.name = AAZStrType( flags={"required": True}, ) sku.tier = AAZStrType() system_data = _schema_workspace_read.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 = _schema_workspace_read.tags tags.Element = AAZStrType() _schema.id = cls._schema_workspace_read.id _schema.location = cls._schema_workspace_read.location _schema.name = cls._schema_workspace_read.name _schema.properties = cls._schema_workspace_read.properties _schema.sku = cls._schema_workspace_read.sku _schema.system_data = cls._schema_workspace_read.system_data _schema.tags = cls._schema_workspace_read.tags _schema.type = cls._schema_workspace_read.type
class _UpdateHelper: '''Helper class for Update''' @classmethod def _build_schema_workspace_custom_boolean_parameter_update(cls, _builder): pass @classmethod def _build_schema_workspace_custom_string_parameter_update(cls, _builder): pass @classmethod def _build_schema_created_by_read(cls, _schema): pass @classmethod def _build_schema_managed_identity_configuration_read(cls, _schema): pass @classmethod def _build_schema_workspace_custom_boolean_parameter_read(cls, _schema): pass @classmethod def _build_schema_workspace_custom_string_parameter_read(cls, _schema): pass @classmethod def _build_schema_workspace_read(cls, _schema): pass
15
1
72
6
66
0
2
0
0
0
0
0
0
0
7
7
533
57
475
56
460
1
241
44
233
2
0
1
14
9,430
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/_create.py
azext_databricks.aaz.latest.databricks.workspace._create.Create
class Create(AAZCommand): """Create a new workspace. :example: Create a workspace az databricks workspace create --resource-group MyResourceGroup --name MyWorkspace --location westus --sku standard :example: Create a workspace with managed identity for storage account az databricks workspace create --resource-group MyResourceGroup --name MyWorkspace --location eastus2euap --sku premium --prepare-encryption :example: Create a workspace with automatic cluster update feature enabled az databricks workspace create --resource-group MyResourceGroup --name MyWorkspace --location eastus2euap --sku premium --enable-automatic-cluster-update :example: Create a workspace with all enhanced security & compliance features enabled with specific compliance standards az databricks workspace create --resource-group MyResourceGroup --name MyWorkspace --location eastus2euap --sku premium --enable-compliance-security-profile --compliance-standards='["HIPAA","PCI_DSS"]' --enable-automatic-cluster-update --enable-enhanced-security-monitoring """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/workspaces/{}", "2024-05-01"], ] } AZ_SUPPORT_NO_WAIT = True def _handler(self, command_args): super()._handler(command_args) return self.build_lro_poller(self._execute_operations, self._output) _args_schema = None @classmethod def _build_arguments_schema(cls, *args, **kwargs): if cls._args_schema is not None: return cls._args_schema cls._args_schema = super()._build_arguments_schema(*args, **kwargs) # define Arg Group "" _args_schema = cls._args_schema _args_schema.resource_group = AAZResourceGroupNameArg( required=True, ) _args_schema.name = AAZStrArg( options=["-n", "--name"], help="The name of the workspace.", required=True, fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) _args_schema.location = AAZResourceLocationArg( help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=<location>`.", required=True, fmt=AAZResourceLocationArgFormat( resource_group_arg="resource_group", ), ) _args_schema.managed_resource_group = AAZStrArg( options=["--managed-resource-group"], help="The managed resource group to create. It can be either a name or a resource ID.", required=True, ) _args_schema.enable_no_public_ip = AAZBoolArg( options=["--enable-no-public-ip"], help="Flag to enable the no public ip feature.", ) _args_schema.prepare_encryption = AAZBoolArg( options=["--prepare-encryption"], help="Flag to enable the Managed Identity for managed storage account to prepare for CMK encryption.", ) _args_schema.require_infrastructure_encryption = AAZBoolArg( options=["--require-infrastructure-encryption"], help="Flag to enable the DBFS root file system with secondary layer of encryption with platform managed keys for data at rest.", ) _args_schema.public_network_access = AAZStrArg( options=["--public-network-access"], help="The configuration to set whether network access from public internet to the endpoints are allowed. Allowed values: Disabled, Enabled.", enum={"Disabled": "Disabled", "Enabled": "Enabled"}, ) _args_schema.required_nsg_rules = AAZStrArg( options=["--required-nsg-rules"], help="The type of Nsg rule for internal use only. Allowed values: AllRules, NoAzureDatabricksRules, NoAzureServiceRules.", enum={"AllRules": "AllRules", "NoAzureDatabricksRules": "NoAzureDatabricksRules", "NoAzureServiceRules": "NoAzureServiceRules"}, ) _args_schema.sku = AAZStrArg( options=["--sku"], help="The SKU tier name. Allowed values: premium, standard, trial.", ) _args_schema.tags = AAZDictArg( options=["--tags"], help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", ) tags = cls._args_schema.tags tags.Element = AAZStrArg() # define Arg Group "Custom VNET" _args_schema = cls._args_schema _args_schema.private_subnet = AAZStrArg( options=["--private-subnet"], arg_group="Custom VNET", help="The name of a Private Subnet within the Virtual Network.", ) _args_schema.public_subnet = AAZStrArg( options=["--public-subnet"], arg_group="Custom VNET", help="The name of a Public Subnet within the Virtual Network.", ) _args_schema.vnet = AAZStrArg( options=["--vnet"], arg_group="Custom VNET", help="Virtual Network name or resource ID.", ) # define Arg Group "Encryption" _args_schema = cls._args_schema _args_schema.disk_key_source = AAZStrArg( options=["--disk-key-source"], arg_group="Encryption", help="The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Keyvault", enum={"Microsoft.Keyvault": "Microsoft.Keyvault"}, ) _args_schema.disk_key_name = AAZStrArg( options=["--disk-key-name"], arg_group="Encryption", help="The name of KeyVault key.", ) _args_schema.disk_key_vault = AAZStrArg( options=["--disk-key-vault"], arg_group="Encryption", help="The URI of KeyVault.", ) _args_schema.disk_key_version = AAZStrArg( options=["--disk-key-version"], arg_group="Encryption", help="The version of KeyVault key.", ) _args_schema.disk_key_auto_rotation = AAZBoolArg( options=["--disk-key-auto-rotation"], arg_group="Encryption", help="Indicate whether the latest key version should be automatically used for Managed Disk Encryption.", ) _args_schema.managed_services_key_source = AAZStrArg( options=["--managed-services-key-source"], arg_group="Encryption", help="The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Keyvault", enum={"Microsoft.Keyvault": "Microsoft.Keyvault"}, ) _args_schema.managed_services_key_name = AAZStrArg( options=["--ms-key-name", "--managed-services-key-name"], arg_group="Encryption", help="The name of KeyVault key.", ) _args_schema.managed_services_key_vault = AAZStrArg( options=["--ms-key-vault", "--managed-services-key-vault"], arg_group="Encryption", help="The Uri of KeyVault.", ) _args_schema.managed_services_key_version = AAZStrArg( options=["--ms-key-version", "--managed-services-key-version"], arg_group="Encryption", help="The version of KeyVault key.", ) # define Arg Group "Enhanced Security Compliance" _args_schema.enable_automatic_cluster_update = AAZBoolArg( options=["--enable-automatic-cluster-update", "--enable-acu"], arg_group="Enhanced Security Compliance", help="Enable Automatic Cluster Update feature.", nullable=True, enum={ 'true': True, 't': True, 'yes': True, 'y': True, '1': True, "false": False, 'f': False, 'no': False, 'n': False, '0': False, "Enabled": True, "Disabled": False, "enabled": True, "disabled": False, } ) _args_schema.compliance_standards = AAZListArg( options=["--compliance-standards"], arg_group="Enhanced Security Compliance", help="Compliance Standards associated with the workspace, allowed values: NONE, HIPAA, PCI_DSS.", nullable=True, ) _args_schema.compliance_standards.Element = AAZStrArg( nullable=True, arg_group="Enhanced Security Compliance", help="Compliance standards, allowed values: NONE, HIPAA, PCI_DSS.", enum={"HIPAA": "HIPAA", "NONE": "NONE", "PCI_DSS": "PCI_DSS"}, ) _args_schema.enable_compliance_security_profile = AAZBoolArg( options=["--enable-compliance-security-profile", "--enable-csp"], arg_group="Enhanced Security Compliance", help="Enable Compliance Security Profile.", nullable=True, enum={ 'true': True, 't': True, 'yes': True, 'y': True, '1': True, "false": False, 'f': False, 'no': False, 'n': False, '0': False, "Enabled": True, "Disabled": False, "enabled": True, "disabled": False, } ) _args_schema.enable_enhanced_security_monitoring = AAZBoolArg( options=["--enable-enhanced-security-monitoring", "--enable-esm"], arg_group="Enhanced Security Compliance", help="Enable Enhanced Security Monitoring feature.", nullable=True, enum={ 'true': True, 't': True, 'yes': True, 'y': True, '1': True, "false": False, 'f': False, 'no': False, 'n': False, '0': False, "Enabled": True, "Disabled": False, "enabled": True, "disabled": False, } ) # define Arg Group "Parameters" # define Arg Group "Properties" _args_schema = cls._args_schema _args_schema.access_connector = AAZObjectArg( options=["--access-connector"], arg_group="Properties", help="Access Connector Resource that is going to be associated with Databricks Workspace", ) _args_schema.default_catalog = AAZObjectArg( options=["--default-catalog"], arg_group="Properties", help="Properties for Default Catalog configuration during workspace creation.", ) _args_schema.default_storage_firewall = AAZStrArg( options=["--default-storage-firewall"], arg_group="Properties", help="Gets or Sets Default Storage Firewall configuration information", enum={"Disabled": "Disabled", "Enabled": "Enabled"}, ) _args_schema.enhanced_security_compliance = AAZObjectArg( options=["--enhanced-security-compliance"], arg_group="Properties", help="Contains settings related to the Enhanced Security and Compliance Add-On.", ) access_connector = cls._args_schema.access_connector access_connector.id = AAZResourceIdArg( options=["id"], help="The resource ID of Azure Databricks Access Connector Resource.", required=True, ) access_connector.identity_type = AAZStrArg( options=["identity-type"], help="The identity type of the Access Connector Resource.", required=True, enum={"SystemAssigned": "SystemAssigned", "UserAssigned": "UserAssigned"}, ) access_connector.user_assigned_identity_id = AAZResourceIdArg( options=["user-assigned-identity-id"], help="The resource ID of the User Assigned Identity associated with the Access Connector Resource. This is required for type 'UserAssigned' and not valid for type 'SystemAssigned'.", ) default_catalog = cls._args_schema.default_catalog default_catalog.initial_name = AAZStrArg( options=["initial-name"], help="Specifies the initial Name of default catalog. If not specified, the name of the workspace will be used.", ) default_catalog.initial_type = AAZStrArg( options=["initial-type"], help="Defines the initial type of the default catalog. Possible values (case-insensitive): HiveMetastore, UnityCatalog", default="HiveMetastore", enum={"HiveMetastore": "HiveMetastore", "UnityCatalog": "UnityCatalog"}, ) enhanced_security_compliance = cls._args_schema.enhanced_security_compliance enhanced_security_compliance.automatic_cluster_update = AAZObjectArg( options=["automatic-cluster-update"], help="Status of automated cluster updates feature.", ) enhanced_security_compliance.compliance_security_profile = AAZObjectArg( options=["compliance-security-profile"], help="Status of Compliance Security Profile feature.", ) enhanced_security_compliance.enhanced_security_monitoring = AAZObjectArg( options=["enhanced-security-monitoring"], help="Status of Enhanced Security Monitoring feature.", ) automatic_cluster_update = cls._args_schema.enhanced_security_compliance.automatic_cluster_update automatic_cluster_update.value = AAZStrArg( options=["value"], enum={"Disabled": "Disabled", "Enabled": "Enabled"}, ) compliance_security_profile = cls._args_schema.enhanced_security_compliance.compliance_security_profile compliance_security_profile.compliance_standards = AAZListArg( options=["compliance-standards"], help="Compliance standards associated with the workspace.", ) compliance_security_profile.value = AAZStrArg( options=["value"], enum={"Disabled": "Disabled", "Enabled": "Enabled"}, ) compliance_standards = cls._args_schema.enhanced_security_compliance.compliance_security_profile.compliance_standards compliance_standards.Element = AAZStrArg( enum={"HIPAA": "HIPAA", "NONE": "NONE", "PCI_DSS": "PCI_DSS"}, ) enhanced_security_monitoring = cls._args_schema.enhanced_security_compliance.enhanced_security_monitoring enhanced_security_monitoring.value = AAZStrArg( options=["value"], enum={"Disabled": "Disabled", "Enabled": "Enabled"}, ) # define Arg Group "Sku" return cls._args_schema _args_workspace_custom_string_parameter_create = None @classmethod def _build_args_workspace_custom_string_parameter_create(cls, _schema): if cls._args_workspace_custom_string_parameter_create is not None: _schema.value = cls._args_workspace_custom_string_parameter_create.value return cls._args_workspace_custom_string_parameter_create = AAZObjectArg() workspace_custom_string_parameter_create = cls._args_workspace_custom_string_parameter_create workspace_custom_string_parameter_create.value = AAZStrArg( options=["value"], help="The value which should be used for this field.", required=True, ) _schema.value = cls._args_workspace_custom_string_parameter_create.value def _execute_operations(self): self.pre_operations() yield self.WorkspacesCreateOrUpdate(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) return result class WorkspacesCreateOrUpdate(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.Databricks/workspaces/{workspaceName}", **self.url_parameters ) @property def method(self): return "PUT" @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( "subscriptionId", self.ctx.subscription_id, required=True, ), **self.serialize_url_param( "workspaceName", self.ctx.args.name, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2024-05-01", 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": {"required": True, "client_flatten": True}}) _builder.set_prop("sku", AAZObjectType) _builder.set_prop("tags", AAZDictType, ".tags") properties = _builder.get(".properties") if properties is not None: properties.set_prop("accessConnector", AAZObjectType, ".access_connector") properties.set_prop("defaultCatalog", AAZObjectType, ".default_catalog") properties.set_prop("defaultStorageFirewall", AAZStrType, ".default_storage_firewall") properties.set_prop("encryption", AAZObjectType) properties.set_prop("enhancedSecurityCompliance", AAZObjectType, ".enhanced_security_compliance") properties.set_prop("managedResourceGroupId", AAZStrType, ".managed_resource_group", typ_kwargs={"flags": {"required": True}}) properties.set_prop("parameters", AAZObjectType) properties.set_prop("publicNetworkAccess", AAZStrType, ".public_network_access") properties.set_prop("requiredNsgRules", AAZStrType, ".required_nsg_rules") access_connector = _builder.get(".properties.accessConnector") if access_connector is not None: access_connector.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) access_connector.set_prop("identityType", AAZStrType, ".identity_type", typ_kwargs={"flags": {"required": True}}) access_connector.set_prop("userAssignedIdentityId", AAZStrType, ".user_assigned_identity_id") default_catalog = _builder.get(".properties.defaultCatalog") if default_catalog is not None: default_catalog.set_prop("initialName", AAZStrType, ".initial_name") default_catalog.set_prop("initialType", AAZStrType, ".initial_type") encryption = _builder.get(".properties.encryption") if encryption is not None: encryption.set_prop("entities", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}}) entities = _builder.get(".properties.encryption.entities") if entities is not None: entities.set_prop("managedDisk", AAZObjectType) entities.set_prop("managedServices", AAZObjectType) managed_disk = _builder.get(".properties.encryption.entities.managedDisk") if managed_disk is not None: managed_disk.set_prop("keySource", AAZStrType, ".disk_key_source", typ_kwargs={"flags": {"required": True}}) managed_disk.set_prop("keyVaultProperties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}}) managed_disk.set_prop("rotationToLatestKeyVersionEnabled", AAZBoolType, ".disk_key_auto_rotation") key_vault_properties = _builder.get(".properties.encryption.entities.managedDisk.keyVaultProperties") if key_vault_properties is not None: key_vault_properties.set_prop("keyName", AAZStrType, ".disk_key_name", typ_kwargs={"flags": {"required": True}}) key_vault_properties.set_prop("keyVaultUri", AAZStrType, ".disk_key_vault", typ_kwargs={"flags": {"required": True}}) key_vault_properties.set_prop("keyVersion", AAZStrType, ".disk_key_version", typ_kwargs={"flags": {"required": True}}) managed_services = _builder.get(".properties.encryption.entities.managedServices") if managed_services is not None: managed_services.set_prop("keySource", AAZStrType, ".managed_services_key_source", typ_kwargs={"flags": {"required": True}}) managed_services.set_prop("keyVaultProperties", AAZObjectType) key_vault_properties = _builder.get(".properties.encryption.entities.managedServices.keyVaultProperties") if key_vault_properties is not None: key_vault_properties.set_prop("keyName", AAZStrType, ".managed_services_key_name", typ_kwargs={"flags": {"required": True}}) key_vault_properties.set_prop("keyVaultUri", AAZStrType, ".managed_services_key_vault", typ_kwargs={"flags": {"required": True}}) key_vault_properties.set_prop("keyVersion", AAZStrType, ".managed_services_key_version", typ_kwargs={"flags": {"required": True}}) enhanced_security_compliance = _builder.get(".properties.enhancedSecurityCompliance") if enhanced_security_compliance is not None: enhanced_security_compliance.set_prop("automaticClusterUpdate", AAZObjectType, ".automatic_cluster_update") enhanced_security_compliance.set_prop("complianceSecurityProfile", AAZObjectType, ".compliance_security_profile") enhanced_security_compliance.set_prop("enhancedSecurityMonitoring", AAZObjectType, ".enhanced_security_monitoring") automatic_cluster_update = _builder.get(".properties.enhancedSecurityCompliance.automaticClusterUpdate") if automatic_cluster_update is not None: automatic_cluster_update.set_prop("value", AAZStrType, ".value") compliance_security_profile = _builder.get(".properties.enhancedSecurityCompliance.complianceSecurityProfile") if compliance_security_profile is not None: compliance_security_profile.set_prop("complianceStandards", AAZListType, ".compliance_standards") compliance_security_profile.set_prop("value", AAZStrType, ".value") compliance_standards = _builder.get(".properties.enhancedSecurityCompliance.complianceSecurityProfile.complianceStandards") if compliance_standards is not None: compliance_standards.set_elements(AAZStrType, ".") enhanced_security_monitoring = _builder.get(".properties.enhancedSecurityCompliance.enhancedSecurityMonitoring") if enhanced_security_monitoring is not None: enhanced_security_monitoring.set_prop("value", AAZStrType, ".value") args = self.ctx.args.to_serialized_data() # Check if any of the enhanced security compliance parameters are set if set(['enable_compliance_security_profile', 'enable_csp', 'enable_enhanced_security_monitoring', 'enable_esm', 'enable_automatic_cluster_update', 'enable_acu', 'compliance_standards']).intersection(set(args.keys())): if enhanced_security_compliance is None: # In case the `--enhanced-security-compliance` parameter doesn't exist, this object should be created properties.set_prop("enhancedSecurityCompliance", AAZObjectType) enhanced_security_compliance = _builder.get(".properties.enhancedSecurityCompliance") if 'enable_compliance_security_profile' in args or 'enable_csp' in args: compliance_security_profile = enhanced_security_compliance.set_prop("complianceSecurityProfile", AAZObjectType) if args.get('enable_compliance_security_profile') or args.get('enable_csp'): compliance_security_profile.set_const("value", "Enabled", AAZStrType) # Process the compliance standards only if the compliance security profile is enabled compliance_standards = compliance_security_profile.set_prop("complianceStandards", AAZListType, ".compliance_standards") if compliance_standards is None: # Create an empty list if it doesn't exist compliance_security_profile.set_const("complianceStandards", [], AAZListType) else: compliance_standards.set_elements(AAZStrType, ".") else: # Use default if the compliance security profile is disabled compliance_security_profile.set_const("value", "Disabled", AAZStrType) compliance_security_profile.set_const("complianceStandards", [], AAZListType) else: # Set default values if these parameters are not set compliance_security_profile = enhanced_security_compliance.set_prop("complianceSecurityProfile", AAZObjectType) compliance_security_profile.set_const("value", "Disabled", AAZStrType) compliance_security_profile.set_const("complianceStandards", [], AAZListType) if 'enable_enhanced_security_monitoring' in args or 'enable_esm' in args: enhanced_security_monitoring = enhanced_security_compliance.set_prop("enhancedSecurityMonitoring", AAZObjectType) if args.get('enable_enhanced_security_monitoring') or args.get('enable_esm'): enhanced_security_monitoring.set_const("value", "Enabled", AAZStrType) else: enhanced_security_monitoring.set_const("value", "Disabled", AAZStrType) if 'enable_automatic_cluster_update' in args or 'enable_acu' in args: automatic_cluster_update = enhanced_security_compliance.set_prop("automaticClusterUpdate", AAZObjectType) if args.get('enable_automatic_cluster_update') or args.get('enable_acu'): automatic_cluster_update.set_const("value", "Enabled", AAZStrType) else: automatic_cluster_update.set_const("value", "Disabled", AAZStrType) parameters = _builder.get(".properties.parameters") if parameters is not None: parameters.set_prop("customPrivateSubnetName", AAZObjectType) parameters.set_prop("customPublicSubnetName", AAZObjectType) parameters.set_prop("customVirtualNetworkId", AAZObjectType) parameters.set_prop("enableNoPublicIp", AAZObjectType) parameters.set_prop("prepareEncryption", AAZObjectType) parameters.set_prop("requireInfrastructureEncryption", AAZObjectType) custom_private_subnet_name = _builder.get(".properties.parameters.customPrivateSubnetName") if custom_private_subnet_name is not None: custom_private_subnet_name.set_prop("value", AAZStrType, ".private_subnet", typ_kwargs={"flags": {"required": True}}) custom_public_subnet_name = _builder.get(".properties.parameters.customPublicSubnetName") if custom_public_subnet_name is not None: custom_public_subnet_name.set_prop("value", AAZStrType, ".public_subnet", typ_kwargs={"flags": {"required": True}}) custom_virtual_network_id = _builder.get(".properties.parameters.customVirtualNetworkId") if custom_virtual_network_id is not None: custom_virtual_network_id.set_prop("value", AAZStrType, ".vnet", typ_kwargs={"flags": {"required": True}}) enable_no_public_ip = _builder.get(".properties.parameters.enableNoPublicIp") if enable_no_public_ip is not None: enable_no_public_ip.set_prop("value", AAZBoolType, ".enable_no_public_ip", typ_kwargs={"flags": {"required": True}}) prepare_encryption = _builder.get(".properties.parameters.prepareEncryption") if prepare_encryption is not None: prepare_encryption.set_prop("value", AAZBoolType, ".prepare_encryption", typ_kwargs={"flags": {"required": True}}) require_infrastructure_encryption = _builder.get(".properties.parameters.requireInfrastructureEncryption") if require_infrastructure_encryption is not None: require_infrastructure_encryption.set_prop("value", AAZBoolType, ".require_infrastructure_encryption", typ_kwargs={"flags": {"required": True}}) sku = _builder.get(".sku") if sku is not None: sku.set_prop("name", AAZStrType, ".sku", typ_kwargs={"flags": {"required": True}}) 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={"required": True, "client_flatten": True}, ) _schema_on_200_201.sku = 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.access_connector = AAZObjectType( serialized_name="accessConnector", ) properties.authorizations = AAZListType() properties.created_by = AAZObjectType( serialized_name="createdBy", ) _CreateHelper._build_schema_created_by_read(properties.created_by) properties.created_date_time = AAZStrType( serialized_name="createdDateTime", flags={"read_only": True}, ) properties.default_catalog = AAZObjectType( serialized_name="defaultCatalog", ) properties.default_storage_firewall = AAZStrType( serialized_name="defaultStorageFirewall", ) properties.disk_encryption_set_id = AAZStrType( serialized_name="diskEncryptionSetId", flags={"read_only": True}, ) properties.encryption = AAZObjectType() properties.enhanced_security_compliance = AAZObjectType( serialized_name="enhancedSecurityCompliance", ) properties.is_uc_enabled = AAZBoolType( serialized_name="isUcEnabled", flags={"read_only": True}, ) properties.managed_disk_identity = AAZObjectType( serialized_name="managedDiskIdentity", ) _CreateHelper._build_schema_managed_identity_configuration_read(properties.managed_disk_identity) properties.managed_resource_group_id = AAZStrType( serialized_name="managedResourceGroupId", flags={"required": True}, ) properties.parameters = AAZObjectType() properties.private_endpoint_connections = AAZListType( serialized_name="privateEndpointConnections", flags={"read_only": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.public_network_access = AAZStrType( serialized_name="publicNetworkAccess", ) properties.required_nsg_rules = AAZStrType( serialized_name="requiredNsgRules", ) properties.storage_account_identity = AAZObjectType( serialized_name="storageAccountIdentity", ) _CreateHelper._build_schema_managed_identity_configuration_read(properties.storage_account_identity) properties.ui_definition_uri = AAZStrType( serialized_name="uiDefinitionUri", ) properties.updated_by = AAZObjectType( serialized_name="updatedBy", ) _CreateHelper._build_schema_created_by_read(properties.updated_by) properties.workspace_id = AAZStrType( serialized_name="workspaceId", flags={"read_only": True}, ) properties.workspace_url = AAZStrType( serialized_name="workspaceUrl", flags={"read_only": True}, ) access_connector = cls._schema_on_200_201.properties.access_connector access_connector.id = AAZStrType( flags={"required": True}, ) access_connector.identity_type = AAZStrType( serialized_name="identityType", flags={"required": True}, ) access_connector.user_assigned_identity_id = AAZStrType( serialized_name="userAssignedIdentityId", ) authorizations = cls._schema_on_200_201.properties.authorizations authorizations.Element = AAZObjectType() _element = cls._schema_on_200_201.properties.authorizations.Element _element.principal_id = AAZStrType( serialized_name="principalId", flags={"required": True}, ) _element.role_definition_id = AAZStrType( serialized_name="roleDefinitionId", flags={"required": True}, ) default_catalog = cls._schema_on_200_201.properties.default_catalog default_catalog.initial_name = AAZStrType( serialized_name="initialName", ) default_catalog.initial_type = AAZStrType( serialized_name="initialType", ) encryption = cls._schema_on_200_201.properties.encryption encryption.entities = AAZObjectType( flags={"required": True}, ) entities = cls._schema_on_200_201.properties.encryption.entities entities.managed_disk = AAZObjectType( serialized_name="managedDisk", ) entities.managed_services = AAZObjectType( serialized_name="managedServices", ) managed_disk = cls._schema_on_200_201.properties.encryption.entities.managed_disk managed_disk.key_source = AAZStrType( serialized_name="keySource", flags={"required": True}, ) managed_disk.key_vault_properties = AAZObjectType( serialized_name="keyVaultProperties", flags={"required": True}, ) managed_disk.rotation_to_latest_key_version_enabled = AAZBoolType( serialized_name="rotationToLatestKeyVersionEnabled", ) key_vault_properties = cls._schema_on_200_201.properties.encryption.entities.managed_disk.key_vault_properties key_vault_properties.key_name = AAZStrType( serialized_name="keyName", flags={"required": True}, ) key_vault_properties.key_vault_uri = AAZStrType( serialized_name="keyVaultUri", flags={"required": True}, ) key_vault_properties.key_version = AAZStrType( serialized_name="keyVersion", flags={"required": True}, ) managed_services = cls._schema_on_200_201.properties.encryption.entities.managed_services managed_services.key_source = AAZStrType( serialized_name="keySource", flags={"required": True}, ) managed_services.key_vault_properties = AAZObjectType( serialized_name="keyVaultProperties", ) key_vault_properties = cls._schema_on_200_201.properties.encryption.entities.managed_services.key_vault_properties key_vault_properties.key_name = AAZStrType( serialized_name="keyName", flags={"required": True}, ) key_vault_properties.key_vault_uri = AAZStrType( serialized_name="keyVaultUri", flags={"required": True}, ) key_vault_properties.key_version = AAZStrType( serialized_name="keyVersion", flags={"required": True}, ) enhanced_security_compliance = cls._schema_on_200_201.properties.enhanced_security_compliance enhanced_security_compliance.automatic_cluster_update = AAZObjectType( serialized_name="automaticClusterUpdate", ) enhanced_security_compliance.compliance_security_profile = AAZObjectType( serialized_name="complianceSecurityProfile", ) enhanced_security_compliance.enhanced_security_monitoring = AAZObjectType( serialized_name="enhancedSecurityMonitoring", ) automatic_cluster_update = cls._schema_on_200_201.properties.enhanced_security_compliance.automatic_cluster_update automatic_cluster_update.value = AAZStrType() compliance_security_profile = cls._schema_on_200_201.properties.enhanced_security_compliance.compliance_security_profile compliance_security_profile.compliance_standards = AAZListType( serialized_name="complianceStandards", ) compliance_security_profile.value = AAZStrType() compliance_standards = cls._schema_on_200_201.properties.enhanced_security_compliance.compliance_security_profile.compliance_standards compliance_standards.Element = AAZStrType() enhanced_security_monitoring = cls._schema_on_200_201.properties.enhanced_security_compliance.enhanced_security_monitoring enhanced_security_monitoring.value = AAZStrType() parameters = cls._schema_on_200_201.properties.parameters parameters.aml_workspace_id = AAZObjectType( serialized_name="amlWorkspaceId", ) _CreateHelper._build_schema_workspace_custom_string_parameter_read(parameters.aml_workspace_id) parameters.custom_private_subnet_name = AAZObjectType( serialized_name="customPrivateSubnetName", ) _CreateHelper._build_schema_workspace_custom_string_parameter_read(parameters.custom_private_subnet_name) parameters.custom_public_subnet_name = AAZObjectType( serialized_name="customPublicSubnetName", ) _CreateHelper._build_schema_workspace_custom_string_parameter_read(parameters.custom_public_subnet_name) parameters.custom_virtual_network_id = AAZObjectType( serialized_name="customVirtualNetworkId", ) _CreateHelper._build_schema_workspace_custom_string_parameter_read(parameters.custom_virtual_network_id) parameters.enable_no_public_ip = AAZObjectType( serialized_name="enableNoPublicIp", ) parameters.encryption = AAZObjectType() parameters.load_balancer_backend_pool_name = AAZObjectType( serialized_name="loadBalancerBackendPoolName", ) _CreateHelper._build_schema_workspace_custom_string_parameter_read(parameters.load_balancer_backend_pool_name) parameters.load_balancer_id = AAZObjectType( serialized_name="loadBalancerId", ) _CreateHelper._build_schema_workspace_custom_string_parameter_read(parameters.load_balancer_id) parameters.nat_gateway_name = AAZObjectType( serialized_name="natGatewayName", ) _CreateHelper._build_schema_workspace_custom_string_parameter_read(parameters.nat_gateway_name) parameters.prepare_encryption = AAZObjectType( serialized_name="prepareEncryption", ) _CreateHelper._build_schema_workspace_custom_boolean_parameter_read(parameters.prepare_encryption) parameters.public_ip_name = AAZObjectType( serialized_name="publicIpName", ) _CreateHelper._build_schema_workspace_custom_string_parameter_read(parameters.public_ip_name) parameters.require_infrastructure_encryption = AAZObjectType( serialized_name="requireInfrastructureEncryption", ) _CreateHelper._build_schema_workspace_custom_boolean_parameter_read(parameters.require_infrastructure_encryption) parameters.resource_tags = AAZObjectType( serialized_name="resourceTags", flags={"read_only": True}, ) parameters.storage_account_name = AAZObjectType( serialized_name="storageAccountName", ) _CreateHelper._build_schema_workspace_custom_string_parameter_read(parameters.storage_account_name) parameters.storage_account_sku_name = AAZObjectType( serialized_name="storageAccountSkuName", ) _CreateHelper._build_schema_workspace_custom_string_parameter_read(parameters.storage_account_sku_name) parameters.vnet_address_prefix = AAZObjectType( serialized_name="vnetAddressPrefix", ) _CreateHelper._build_schema_workspace_custom_string_parameter_read(parameters.vnet_address_prefix) enable_no_public_ip = cls._schema_on_200_201.properties.parameters.enable_no_public_ip enable_no_public_ip.type = AAZStrType( flags={"read_only": True}, ) enable_no_public_ip.value = AAZBoolType( flags={"required": True}, ) encryption = cls._schema_on_200_201.properties.parameters.encryption encryption.type = AAZStrType( flags={"read_only": True}, ) encryption.value = AAZObjectType() value = cls._schema_on_200_201.properties.parameters.encryption.value value.key_name = AAZStrType( serialized_name="KeyName", ) value.key_source = AAZStrType( serialized_name="keySource", ) value.keyvaulturi = AAZStrType() value.keyversion = AAZStrType() resource_tags = cls._schema_on_200_201.properties.parameters.resource_tags resource_tags.type = AAZStrType( flags={"read_only": True}, ) resource_tags.value = AAZFreeFormDictType( flags={"required": True}, ) 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( flags={"required": True}, ) _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", ) properties.private_endpoint = AAZObjectType( serialized_name="privateEndpoint", ) properties.private_link_service_connection_state = AAZObjectType( serialized_name="privateLinkServiceConnectionState", flags={"required": True}, ) 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( flags={"read_only": True}, ) 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", ) private_link_service_connection_state.description = AAZStrType() private_link_service_connection_state.status = AAZStrType( flags={"required": True}, ) sku = cls._schema_on_200_201.sku sku.name = AAZStrType( flags={"required": True}, ) sku.tier = AAZStrType() 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 Create(AAZCommand): '''Create a new workspace. :example: Create a workspace az databricks workspace create --resource-group MyResourceGroup --name MyWorkspace --location westus --sku standard :example: Create a workspace with managed identity for storage account az databricks workspace create --resource-group MyResourceGroup --name MyWorkspace --location eastus2euap --sku premium --prepare-encryption :example: Create a workspace with automatic cluster update feature enabled az databricks workspace create --resource-group MyResourceGroup --name MyWorkspace --location eastus2euap --sku premium --enable-automatic-cluster-update :example: Create a workspace with all enhanced security & compliance features enabled with specific compliance standards az databricks workspace create --resource-group MyResourceGroup --name MyWorkspace --location eastus2euap --sku premium --enable-compliance-security-profile --compliance-standards='["HIPAA","PCI_DSS"]' --enable-automatic-cluster-update --enable-enhanced-security-monitoring ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass @classmethod def _build_args_workspace_custom_string_parameter_create(cls, _schema): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): pass class WorkspacesCreateOrUpdate(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
31
1
56
5
51
1
3
0.03
1
2
1
1
5
0
7
7
1,019
108
888
106
857
23
412
93
393
33
1
4
54
9,431
Azure/azure-cli-extensions
src/spring/azext_spring/tests/latest/custom_preparers.py
azext_spring.tests.latest.custom_preparers.SpringSubResourceWrapper
class SpringSubResourceWrapper(NoTrafficRecordingPreparer): def __init__(self, *args, **kwargs): if not args: args = ['fake', 10] super(SpringSubResourceWrapper, self).__init__(*args, **kwargs) def _get_resource_group(self, **kwargs): try: return kwargs.get(self.resource_group_parameter_name) except KeyError: template = 'To create a Spring a resource group is required. Please add ' \ 'decorator @{} in front of this Spring preparer.' raise CliTestError(template.format(SpringResourceGroupPreparer.__name__)) def _get_spring(self, **kwargs): try: return kwargs.get(self.spring_parameter_name) except KeyError: template = 'To get a Spring app, a Spring resource is required. Please add ' \ 'decorator @{} in front of this Spring preparer.' raise CliTestError(template.format(SpringPreparer.__name__)) def _safe_exec(self, cmd): try: self.live_only_execute(self.cli_ctx, cmd, expect_failure=True) except Exception: pass
class SpringSubResourceWrapper(NoTrafficRecordingPreparer): def __init__(self, *args, **kwargs): pass def _get_resource_group(self, **kwargs): pass def _get_spring(self, **kwargs): pass def _safe_exec(self, cmd): pass
5
0
6
0
6
0
2
0
1
5
2
8
4
1
4
4
27
3
24
8
19
0
22
7
17
2
1
1
8
9,432
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/account/backup_vault/backup/_restore_file.py
azext_netappfiles_preview.aaz.latest.netappfiles.account.backup_vault.backup._restore_file.RestoreFile.BackupsUnderBackupVaultRestoreFiles
class BackupsUnderBackupVaultRestoreFiles(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, None, 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.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups/{backupName}/restoreFiles", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "backupName", self.ctx.args.backup_name, required=True, ), **self.serialize_url_param( "backupVaultName", self.ctx.args.backup_vault_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-03-01-preview", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Content-Type", "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("destinationVolumeId", AAZStrType, ".destination_volume_id", typ_kwargs={ "flags": {"required": True}}) _builder.set_prop("fileList", AAZListType, ".file_list", typ_kwargs={ "flags": {"required": True}}) _builder.set_prop("restoreFilePath", AAZStrType, ".restore_file_path") file_list = _builder.get(".fileList") if file_list is not None: file_list.set_elements(AAZStrType, ".") return self.serialize_content(_content_value)
class BackupsUnderBackupVaultRestoreFiles(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
16
0
10
0
9
0
1
0
1
0
0
0
8
1
8
8
94
11
83
25
67
0
32
17
23
2
1
1
10
9,433
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/account/backup_vault/backup/_delete.py
azext_netappfiles_preview.aaz.latest.netappfiles.account.backup_vault.backup._delete.Delete.BackupsDelete
class BackupsDelete(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.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups/{backupName}", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "backupName", self.ctx.args.backup_name, required=True, ), **self.serialize_url_param( "backupVaultName", self.ctx.args.backup_vault_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-03-01-preview", required=True, ), } return parameters def on_204(self, session): pass def on_200_201(self, session): pass
class BackupsDelete(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
10
0
10
0
1
0
1
0
0
0
8
1
8
8
92
9
83
20
69
0
28
14
19
4
1
1
11
9,434
Azure/azure-cli-extensions
src/databricks/azext_databricks/custom.py
azext_databricks.custom.DatabricksWorkspaceCreate
class DatabricksWorkspaceCreate(_DatabricksWorkspaceCreate): @classmethod # pylint: disable=protected-access def _build_arguments_schema(cls, *args, **kwargs): from azure.cli.core.aaz import AAZResourceIdArgFormat args_schema = super()._build_arguments_schema(*args, **kwargs) args_schema.managed_resource_group._required = False args_schema.vnet._fmt = AAZResourceIdArgFormat( template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{}" ) args_schema.disk_key_source._registered = False args_schema.managed_services_key_source._registered = False return args_schema def pre_operations(self): from azure.mgmt.core.tools import is_valid_resource_id, resource_id # """Parse managed resource_group which can be either resource group name or id, generate a randomized name if not provided""" args = self.ctx.args subscription_id = self.ctx.subscription_id workspace_name = args.name.to_serialized_data() if has_value(args.managed_resource_group): managed_resource_group = args.managed_resource_group.to_serialized_data() if not is_valid_resource_id(managed_resource_group): args.managed_resource_group = resource_id( subscription=subscription_id, resource_group=managed_resource_group) if not has_value(args.managed_resource_group): args.managed_resource_group = resource_id( subscription=subscription_id, resource_group='databricks-rg-' + workspace_name + '-' + id_generator()) if has_value(args.disk_key_name): args.disk_key_source = 'Microsoft.Keyvault' if has_value(args.managed_services_key_name): args.managed_services_key_source = 'Microsoft.Keyvault'
class DatabricksWorkspaceCreate(_DatabricksWorkspaceCreate): @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def pre_operations(self): pass
4
0
16
1
15
1
4
0.06
1
1
0
0
1
0
2
9
37
4
31
11
25
2
24
10
19
6
2
2
7
9,435
Azure/azure-cli-extensions
src/databricks/azext_databricks/custom.py
azext_databricks.custom.DatabricksWorkspaceUpdate
class DatabricksWorkspaceUpdate(_DatabricksWorkspaceUpdate): @classmethod # pylint: disable=protected-access def _build_arguments_schema(cls, *args, **kwargs): args_schema = super()._build_arguments_schema(*args, **kwargs) args_schema.disk_key_source._registered = False args_schema.managed_services_key_source._registered = False return args_schema def pre_operations(self): args = self.ctx.args if has_value(args.disk_key_name): args.disk_key_source = 'Microsoft.Keyvault' if has_value(args.managed_services_key_name): args.managed_services_key_source = 'Microsoft.Keyvault'
class DatabricksWorkspaceUpdate(_DatabricksWorkspaceUpdate): @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def pre_operations(self): pass
4
0
6
0
6
0
2
0.08
1
1
0
0
1
0
2
12
16
2
13
6
9
1
12
5
9
3
2
1
4
9,436
Azure/azure-cli-extensions
src/databricks/azext_databricks/custom.py
azext_databricks.custom.WorkspaceVnetPeeringCreate
class WorkspaceVnetPeeringCreate(_WorkspaceVnetPeeringCreate): @classmethod # pylint: disable=protected-access def _build_arguments_schema(cls, *args, **kwargs): from azure.cli.core.aaz import AAZResourceIdArgFormat args_schema = super()._build_arguments_schema(*args, **kwargs) args_schema.remote_vnet._fmt = AAZResourceIdArgFormat( template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{}" ) return args_schema
class WorkspaceVnetPeeringCreate(_WorkspaceVnetPeeringCreate): @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass
3
0
7
0
7
0
1
0.11
1
1
0
0
0
0
1
8
11
1
9
5
5
1
6
4
3
1
2
0
1
9,437
Azure/azure-cli-extensions
src/datadog/azext_datadog/__init__.py
azext_datadog.MicrosoftDatadogClientCommandsLoader
class MicrosoftDatadogClientCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azext_datadog.generated._client_factory import cf_datadog_cl datadog_custom = CliCommandType( operations_tmpl='azext_datadog.custom#{}', client_factory=cf_datadog_cl) parent = super(MicrosoftDatadogClientCommandsLoader, self) parent.__init__(cli_ctx=cli_ctx, custom_command_type=datadog_custom) def load_command_table(self, args): from azext_datadog.generated.commands import load_command_table load_command_table(self, args) try: from azext_datadog.manual.commands import load_command_table as load_command_table_manual load_command_table_manual(self, args) except ImportError: pass return self.command_table def load_arguments(self, command): from azext_datadog.generated._params import load_arguments load_arguments(self, command) try: from azext_datadog.manual._params import load_arguments as load_arguments_manual load_arguments_manual(self, command) except ImportError: pass
class MicrosoftDatadogClientCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): pass def load_command_table(self, args): pass def load_arguments(self, command): pass
4
0
8
0
8
0
2
0.04
1
2
0
0
3
0
3
3
29
3
26
12
16
1
24
12
14
2
1
1
5
9,438
Azure/azure-cli-extensions
src/datadog/azext_datadog/generated/action.py
azext_datadog.generated.action.AddDatadogOrganizationProperties
class AddDatadogOrganizationProperties(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) namespace.datadog_organization_properties = action def get_action(self, values, option_string): # pylint: disable=no-self-use try: properties = defaultdict(list) for (k, v) in (x.split('=', 1) for x in values): properties[k].append(v) properties = dict(properties) except ValueError: raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) d = {} for k in properties: kl = k.lower() v = properties[k] if kl == 'linking-auth-code': d['linking_auth_code'] = v[0] elif kl == 'linking-client-id': d['linking_client_id'] = v[0] elif kl == 'redirect-uri': d['redirect_uri'] = v[0] elif kl == 'api-key': d['api_key'] = v[0] elif kl == 'application-key': d['application_key'] = v[0] elif kl == 'enterprise-app-id': d['enterprise_app_id'] = v[0] else: raise CLIError('Unsupported Key {} is provided for parameter datadog_organization_properties. All ' 'possible keys are: linking-auth-code, linking-client-id, redirect-uri, api-key, ' 'application-key, enterprise-app-id'.format(k)) return d
class AddDatadogOrganizationProperties(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): pass def get_action(self, values, option_string): pass
3
0
16
0
16
1
6
0.03
1
3
0
0
2
0
2
9
34
1
33
8
30
1
25
8
22
10
3
2
11
9,439
Azure/azure-cli-extensions
src/datadog/azext_datadog/generated/action.py
azext_datadog.generated.action.AddFilteringTags
class AddFilteringTags(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) super(AddFilteringTags, self).__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: properties = defaultdict(list) for (k, v) in (x.split('=', 1) for x in values): properties[k].append(v) properties = dict(properties) except ValueError: raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) d = {} for k in properties: kl = k.lower() v = properties[k] if kl == 'name': d['name'] = v[0] elif kl == 'value': d['value'] = v[0] elif kl == 'action': d['action'] = v[0] else: raise CLIError('Unsupported Key {} is provided for parameter filtering_tags. All possible keys are: ' 'name, value, action'.format(k)) return d
class AddFilteringTags(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): pass def get_action(self, values, option_string): pass
3
0
13
0
13
1
4
0.04
1
4
0
0
2
0
2
11
27
1
26
8
23
1
22
8
19
7
4
2
8
9,440
Azure/azure-cli-extensions
src/datadog/azext_datadog/generated/action.py
azext_datadog.generated.action.AddLogRulesFilteringTags
class AddLogRulesFilteringTags(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) super(AddLogRulesFilteringTags, self).__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: properties = defaultdict(list) for (k, v) in (x.split('=', 1) for x in values): properties[k].append(v) properties = dict(properties) except ValueError: raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) d = {} for k in properties: kl = k.lower() v = properties[k] if kl == 'name': d['name'] = v[0] elif kl == 'value': d['value'] = v[0] elif kl == 'action': d['action'] = v[0] else: raise CLIError('Unsupported Key {} is provided for parameter log_rules_filtering_tags. All possible ' 'keys are: name, value, action'.format(k)) return d
class AddLogRulesFilteringTags(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): pass def get_action(self, values, option_string): pass
3
0
13
0
13
1
4
0.04
1
4
0
0
2
0
2
11
27
1
26
8
23
1
22
8
19
7
4
2
8
9,441
Azure/azure-cli-extensions
src/datadog/azext_datadog/generated/action.py
azext_datadog.generated.action.AddMarketplaceagreementsProperties
class AddMarketplaceagreementsProperties(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) namespace.properties = action def get_action(self, values, option_string): # pylint: disable=no-self-use try: properties = defaultdict(list) for (k, v) in (x.split('=', 1) for x in values): properties[k].append(v) properties = dict(properties) except ValueError: raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) d = {} for k in properties: kl = k.lower() v = properties[k] if kl == 'publisher': d['publisher'] = v[0] elif kl == 'product': d['product'] = v[0] elif kl == 'plan': d['plan'] = v[0] elif kl == 'license-text-link': d['license_text_link'] = v[0] elif kl == 'privacy-policy-link': d['privacy_policy_link'] = v[0] elif kl == 'retrieve-datetime': d['retrieve_datetime'] = v[0] elif kl == 'signature': d['signature'] = v[0] elif kl == 'accepted': d['accepted'] = v[0] else: raise CLIError('Unsupported Key {} is provided for parameter properties. All possible keys are: ' 'publisher, product, plan, license-text-link, privacy-policy-link, retrieve-datetime, ' 'signature, accepted'.format(k)) return d
class AddMarketplaceagreementsProperties(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): pass def get_action(self, values, option_string): pass
3
0
18
0
18
1
7
0.03
1
3
0
0
2
0
2
9
38
1
37
8
34
1
27
8
24
12
3
2
13
9,442
Azure/azure-cli-extensions
src/datadog/azext_datadog/generated/action.py
azext_datadog.generated.action.AddSinglesignonconfigurationsProperties
class AddSinglesignonconfigurationsProperties(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) namespace.properties = action def get_action(self, values, option_string): # pylint: disable=no-self-use try: properties = defaultdict(list) for (k, v) in (x.split('=', 1) for x in values): properties[k].append(v) properties = dict(properties) except ValueError: raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) d = {} for k in properties: kl = k.lower() v = properties[k] if kl == 'single-sign-on-state': d['single_sign_on_state'] = v[0] elif kl == 'enterprise-app-id': d['enterprise_app_id'] = v[0] else: raise CLIError('Unsupported Key {} is provided for parameter properties. All possible keys are: ' 'single-sign-on-state, enterprise-app-id'.format(k)) return d
class AddSinglesignonconfigurationsProperties(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): pass def get_action(self, values, option_string): pass
3
0
12
0
12
1
4
0.04
1
3
0
0
2
0
2
9
25
1
24
8
21
1
21
8
18
6
3
2
7
9,443
Azure/azure-cli-extensions
src/datadog/azext_datadog/generated/action.py
azext_datadog.generated.action.AddUserInfo
class AddUserInfo(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) namespace.user_info = action def get_action(self, values, option_string): # pylint: disable=no-self-use try: properties = defaultdict(list) for (k, v) in (x.split('=', 1) for x in values): properties[k].append(v) properties = dict(properties) except ValueError: raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) d = {} for k in properties: kl = k.lower() v = properties[k] if kl == 'name': d['name'] = v[0] elif kl == 'email-address': d['email_address'] = v[0] elif kl == 'phone-number': d['phone_number'] = v[0] else: raise CLIError('Unsupported Key {} is provided for parameter user_info. All possible keys are: name, ' 'email-address, phone-number'.format(k)) return d
class AddUserInfo(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): pass def get_action(self, values, option_string): pass
3
0
13
0
13
1
4
0.04
1
3
0
0
2
0
2
9
27
1
26
8
23
1
22
8
19
7
3
2
8
9,444
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/_configuration.py
azext_datadog.vendored_sdks.datadog._configuration.MicrosoftDatadogClientConfiguration
class MicrosoftDatadogClientConfiguration(Configuration): """Configuration for MicrosoftDatadogClient. Note that all parameters used to create this instance are saved as instance attributes. :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str """ def __init__( self, credential, # type: "TokenCredential" subscription_id, # type: str **kwargs # type: Any ): # type: (...) -> None if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") super(MicrosoftDatadogClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id self.api_version = "2021-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'microsoftdatadogclient/{}'.format(VERSION)) self._configure(**kwargs) def _configure( self, **kwargs # type: Any ): # type: (...) -> None self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
class MicrosoftDatadogClientConfiguration(Configuration): '''Configuration for MicrosoftDatadogClient. Note that all parameters used to create this instance are saved as instance attributes. :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str ''' def __init__( self, credential, # type: "TokenCredential" subscription_id, # type: str **kwargs # type: Any ): pass def _configure( self, **kwargs # type: Any ): pass
3
1
18
1
16
3
3
0.42
1
2
0
0
2
13
2
2
48
5
33
24
22
14
25
16
22
3
1
1
5
9,445
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/_microsoft_datadog_client.py
azext_datadog.vendored_sdks.datadog._microsoft_datadog_client.MicrosoftDatadogClient
class MicrosoftDatadogClient(object): """MicrosoftDatadogClient. :ivar marketplace_agreements: MarketplaceAgreementsOperations operations :vartype marketplace_agreements: microsoft_datadog_client.operations.MarketplaceAgreementsOperations :ivar monitors: MonitorsOperations operations :vartype monitors: microsoft_datadog_client.operations.MonitorsOperations :ivar operations: Operations operations :vartype operations: microsoft_datadog_client.operations.Operations :ivar tag_rules: TagRulesOperations operations :vartype tag_rules: microsoft_datadog_client.operations.TagRulesOperations :ivar single_sign_on_configurations: SingleSignOnConfigurationsOperations operations :vartype single_sign_on_configurations: microsoft_datadog_client.operations.SingleSignOnConfigurationsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( self, credential, # type: "TokenCredential" subscription_id, # type: str base_url=None, # type: Optional[str] **kwargs # type: Any ): # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' self._config = MicrosoftDatadogClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.marketplace_agreements = MarketplaceAgreementsOperations( self._client, self._config, self._serialize, self._deserialize) self.monitors = MonitorsOperations( self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) self.tag_rules = TagRulesOperations( self._client, self._config, self._serialize, self._deserialize) self.single_sign_on_configurations = SingleSignOnConfigurationsOperations( self._client, self._config, self._serialize, self._deserialize) def close(self): # type: () -> None self._client.close() def __enter__(self): # type: () -> MicrosoftDatadogClient self._client.__enter__() return self def __exit__(self, *exc_details): # type: (Any) -> None self._client.__exit__(*exc_details)
class MicrosoftDatadogClient(object): '''MicrosoftDatadogClient. :ivar marketplace_agreements: MarketplaceAgreementsOperations operations :vartype marketplace_agreements: microsoft_datadog_client.operations.MarketplaceAgreementsOperations :ivar monitors: MonitorsOperations operations :vartype monitors: microsoft_datadog_client.operations.MonitorsOperations :ivar operations: Operations operations :vartype operations: microsoft_datadog_client.operations.Operations :ivar tag_rules: TagRulesOperations operations :vartype tag_rules: microsoft_datadog_client.operations.TagRulesOperations :ivar single_sign_on_configurations: SingleSignOnConfigurationsOperations operations :vartype single_sign_on_configurations: microsoft_datadog_client.operations.SingleSignOnConfigurationsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. ''' def __init__( self, credential, # type: "TokenCredential" subscription_id, # type: str base_url=None, # type: Optional[str] **kwargs # type: Any ): pass def close(self): pass def __enter__(self): pass def __exit__(self, *exc_details): pass
5
1
9
1
8
2
1
0.81
1
7
6
0
4
9
4
4
61
7
32
21
21
26
21
15
16
2
1
1
5
9,446
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/aio/_configuration.py
azext_datadog.vendored_sdks.datadog.aio._configuration.MicrosoftDatadogClientConfiguration
class MicrosoftDatadogClientConfiguration(Configuration): """Configuration for MicrosoftDatadogClient. Note that all parameters used to create this instance are saved as instance attributes. :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any ) -> None: if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") super(MicrosoftDatadogClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id self.api_version = "2021-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'microsoftdatadogclient/{}'.format(VERSION)) self._configure(**kwargs) def _configure( self, **kwargs: Any ) -> None: self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
class MicrosoftDatadogClientConfiguration(Configuration): '''Configuration for MicrosoftDatadogClient. Note that all parameters used to create this instance are saved as instance attributes. :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str ''' def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any ) -> None: pass def _configure( self, **kwargs: Any ) -> None: pass
3
1
17
1
16
0
3
0.24
1
4
0
0
2
13
2
2
46
5
33
24
22
8
25
16
22
3
1
1
5
9,447
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/aio/_microsoft_datadog_client.py
azext_datadog.vendored_sdks.datadog.aio._microsoft_datadog_client.MicrosoftDatadogClient
class MicrosoftDatadogClient(object): """MicrosoftDatadogClient. :ivar marketplace_agreements: MarketplaceAgreementsOperations operations :vartype marketplace_agreements: microsoft_datadog_client.aio.operations.MarketplaceAgreementsOperations :ivar monitors: MonitorsOperations operations :vartype monitors: microsoft_datadog_client.aio.operations.MonitorsOperations :ivar operations: Operations operations :vartype operations: microsoft_datadog_client.aio.operations.Operations :ivar tag_rules: TagRulesOperations operations :vartype tag_rules: microsoft_datadog_client.aio.operations.TagRulesOperations :ivar single_sign_on_configurations: SingleSignOnConfigurationsOperations operations :vartype single_sign_on_configurations: microsoft_datadog_client.aio.operations.SingleSignOnConfigurationsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: if not base_url: base_url = 'https://management.azure.com' self._config = MicrosoftDatadogClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.marketplace_agreements = MarketplaceAgreementsOperations( self._client, self._config, self._serialize, self._deserialize) self.monitors = MonitorsOperations( self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) self.tag_rules = TagRulesOperations( self._client, self._config, self._serialize, self._deserialize) self.single_sign_on_configurations = SingleSignOnConfigurationsOperations( self._client, self._config, self._serialize, self._deserialize) async def close(self) -> None: await self._client.close() async def __aenter__(self) -> "MicrosoftDatadogClient": await self._client.__aenter__() return self async def __aexit__(self, *exc_details) -> None: await self._client.__aexit__(*exc_details)
class MicrosoftDatadogClient(object): '''MicrosoftDatadogClient. :ivar marketplace_agreements: MarketplaceAgreementsOperations operations :vartype marketplace_agreements: microsoft_datadog_client.aio.operations.MarketplaceAgreementsOperations :ivar monitors: MonitorsOperations operations :vartype monitors: microsoft_datadog_client.aio.operations.MonitorsOperations :ivar operations: Operations operations :vartype operations: microsoft_datadog_client.aio.operations.Operations :ivar tag_rules: TagRulesOperations operations :vartype tag_rules: microsoft_datadog_client.aio.operations.TagRulesOperations :ivar single_sign_on_configurations: SingleSignOnConfigurationsOperations operations :vartype single_sign_on_configurations: microsoft_datadog_client.aio.operations.SingleSignOnConfigurationsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. ''' def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: pass async def close(self) -> None: pass async def __aenter__(self) -> "MicrosoftDatadogClient": pass async def __aexit__(self, *exc_details) -> None: pass
5
1
8
1
8
0
1
0.56
1
9
6
0
4
9
4
4
57
7
32
21
21
18
21
15
16
2
1
1
5
9,448
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/aio/operations/_marketplace_agreements_operations.py
azext_datadog.vendored_sdks.datadog.aio.operations._marketplace_agreements_operations.MarketplaceAgreementsOperations
class MarketplaceAgreementsOperations: """MarketplaceAgreementsOperations async operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. """ models = models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config def list( self, **kwargs ) -> AsyncIterable["models.DatadogAgreementResourceListResponse"]: """List Datadog marketplace agreements in the subscription. List Datadog marketplace agreements in the subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogAgreementResourceListResponse or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.DatadogAgreementResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogAgreementResourceListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): deserialized = self._deserialize('DatadogAgreementResourceListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements'} # type: ignore async def create_or_update( self, body: Optional["models.DatadogAgreementResource"] = None, **kwargs ) -> "models.DatadogAgreementResource": """Create Datadog marketplace agreement in the subscription. Create Datadog marketplace agreement in the subscription. :param body: :type body: ~microsoft_datadog_client.models.DatadogAgreementResource :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogAgreementResource, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogAgreementResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogAgreementResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] if body is not None: body_content = self._serialize.body(body, 'DatadogAgreementResource') else: body_content = None body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DatadogAgreementResource', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default'}
class MarketplaceAgreementsOperations: '''MarketplaceAgreementsOperations async operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. ''' def __init__(self, client, config, serializer, deserializer) -> None: pass def list( self, **kwargs ) -> AsyncIterable["models.DatadogAgreementResourceListResponse"]: '''List Datadog marketplace agreements in the subscription. List Datadog marketplace agreements in the subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogAgreementResourceListResponse or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.DatadogAgreementResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass async def create_or_update( self, body: Optional["models.DatadogAgreementResource"] = None, **kwargs ) -> "models.DatadogAgreementResource": '''Create Datadog marketplace agreement in the subscription. Create Datadog marketplace agreement in the subscription. :param body: :type body: ~microsoft_datadog_client.models.DatadogAgreementResource :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogAgreementResource, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogAgreementResource :raises: ~azure.core.exceptions.HttpResponseError ''' pass
7
3
29
4
21
7
2
0.46
0
0
0
0
3
4
3
3
154
27
95
50
81
44
76
43
69
4
0
1
12
9,449
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/aio/operations/_monitors_operations.py
azext_datadog.vendored_sdks.datadog.aio.operations._monitors_operations.MonitorsOperations
class MonitorsOperations: """MonitorsOperations async operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. """ models = models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config def list_api_keys( self, resource_group_name: str, monitor_name: str, **kwargs ) -> AsyncIterable["models.DatadogApiKeyListResponse"]: """List the api keys for a given monitor resource. List the api keys for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogApiKeyListResponse or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.DatadogApiKeyListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogApiKeyListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list_api_keys.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.post(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): deserialized = self._deserialize('DatadogApiKeyListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) list_api_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listApiKeys'} # type: ignore async def get_default_key( self, resource_group_name: str, monitor_name: str, **kwargs ) -> "models.DatadogApiKey": """Get the default api key. Get the default api key. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogApiKey, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogApiKey :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogApiKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" # Construct URL url = self.get_default_key.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DatadogApiKey', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized get_default_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getDefaultKey'} # type: ignore async def set_default_key( self, resource_group_name: str, monitor_name: str, body: Optional["models.DatadogApiKey"] = None, **kwargs ) -> None: """Set the default api key. Set the default api key. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param body: :type body: ~microsoft_datadog_client.models.DatadogApiKey :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self.set_default_key.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] if body is not None: body_content = self._serialize.body(body, 'DatadogApiKey') else: body_content = None body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) set_default_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/setDefaultKey'} # type: ignore def list_hosts( self, resource_group_name: str, monitor_name: str, **kwargs ) -> AsyncIterable["models.DatadogHostListResponse"]: """List the hosts for a given monitor resource. List the hosts for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogHostListResponse or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.DatadogHostListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogHostListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list_hosts.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.post(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): deserialized = self._deserialize('DatadogHostListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) list_hosts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listHosts'} # type: ignore def list_linked_resources( self, resource_group_name: str, monitor_name: str, **kwargs ) -> AsyncIterable["models.LinkedResourceListResponse"]: """List all Azure resources associated to the same Datadog organization as the target resource. List all Azure resources associated to the same Datadog organization as the target resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LinkedResourceListResponse or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.LinkedResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LinkedResourceListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list_linked_resources.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.post(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): deserialized = self._deserialize('LinkedResourceListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) list_linked_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listLinkedResources'} # type: ignore def list_monitored_resources( self, resource_group_name: str, monitor_name: str, **kwargs ) -> AsyncIterable["models.MonitoredResourceListResponse"]: """List the resources currently being monitored by the Datadog monitor resource. List the resources currently being monitored by the Datadog monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MonitoredResourceListResponse or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.MonitoredResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoredResourceListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list_monitored_resources.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.post(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): deserialized = self._deserialize('MonitoredResourceListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) list_monitored_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listMonitoredResources'} # type: ignore def list( self, **kwargs ) -> AsyncIterable["models.DatadogMonitorResourceListResponse"]: """List all monitors under the specified subscription. List all monitors under the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogMonitorResourceListResponse or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.DatadogMonitorResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogMonitorResourceListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): deserialized = self._deserialize('DatadogMonitorResourceListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors'} # type: ignore def list_by_resource_group( self, resource_group_name: str, **kwargs ) -> AsyncIterable["models.DatadogMonitorResourceListResponse"]: """List all monitors under the specified resource group. List all monitors under the specified resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogMonitorResourceListResponse or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.DatadogMonitorResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogMonitorResourceListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): deserialized = self._deserialize('DatadogMonitorResourceListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors'} # type: ignore async def get( self, resource_group_name: str, monitor_name: str, **kwargs ) -> "models.DatadogMonitorResource": """Get the properties of a specific monitor resource. Get the properties of a specific monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogMonitorResource, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogMonitorResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogMonitorResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DatadogMonitorResource', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} # type: ignore async def _create_initial( self, resource_group_name: str, monitor_name: str, body: Optional["models.DatadogMonitorResource"] = None, **kwargs ) -> "models.DatadogMonitorResource": cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogMonitorResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] if body is not None: body_content = self._serialize.body(body, 'DatadogMonitorResource') else: body_content = None body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize('DatadogMonitorResource', pipeline_response) if response.status_code == 201: deserialized = self._deserialize('DatadogMonitorResource', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} # type: ignore async def begin_create( self, resource_group_name: str, monitor_name: str, body: Optional["models.DatadogMonitorResource"] = None, **kwargs ) -> AsyncLROPoller["models.DatadogMonitorResource"]: """Create a monitor resource. Create a monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param body: :type body: ~microsoft_datadog_client.models.DatadogMonitorResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either DatadogMonitorResource or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~microsoft_datadog_client.models.DatadogMonitorResource] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogMonitorResource"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._create_initial( resource_group_name=resource_group_name, monitor_name=monitor_name, body=body, cls=lambda x,y,z: x, **kwargs ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): deserialized = self._deserialize('DatadogMonitorResource', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} # type: ignore async def _update_initial( self, resource_group_name: str, monitor_name: str, body: Optional["models.DatadogMonitorResourceUpdateParameters"] = None, **kwargs ) -> "models.DatadogMonitorResource": cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogMonitorResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] if body is not None: body_content = self._serialize.body(body, 'DatadogMonitorResourceUpdateParameters') else: body_content = None body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize('DatadogMonitorResource', pipeline_response) if response.status_code == 201: deserialized = self._deserialize('DatadogMonitorResource', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} # type: ignore async def begin_update( self, resource_group_name: str, monitor_name: str, body: Optional["models.DatadogMonitorResourceUpdateParameters"] = None, **kwargs ) -> AsyncLROPoller["models.DatadogMonitorResource"]: """Update a monitor resource. Update a monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param body: :type body: ~microsoft_datadog_client.models.DatadogMonitorResourceUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either DatadogMonitorResource or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~microsoft_datadog_client.models.DatadogMonitorResource] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogMonitorResource"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, monitor_name=monitor_name, body=body, cls=lambda x,y,z: x, **kwargs ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): deserialized = self._deserialize('DatadogMonitorResource', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} # type: ignore async def _delete_initial( self, resource_group_name: str, monitor_name: str, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} # type: ignore async def begin_delete( self, resource_group_name: str, monitor_name: str, **kwargs ) -> AsyncLROPoller[None]: """Delete a monitor resource. Delete a monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, monitor_name=monitor_name, cls=lambda x,y,z: x, **kwargs ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} # type: ignore async def refresh_set_password_link( self, resource_group_name: str, monitor_name: str, **kwargs ) -> "models.DatadogSetPasswordLink": """Refresh the set password link and return a latest one. Refresh the set password link and return a latest one. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogSetPasswordLink, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogSetPasswordLink :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogSetPasswordLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" # Construct URL url = self.refresh_set_password_link.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DatadogSetPasswordLink', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized refresh_set_password_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/refreshSetPasswordLink'}
class MonitorsOperations: '''MonitorsOperations async operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. ''' def __init__(self, client, config, serializer, deserializer) -> None: pass def list_api_keys( self, resource_group_name: str, monitor_name: str, **kwargs ) -> AsyncIterable["models.DatadogApiKeyListResponse"]: '''List the api keys for a given monitor resource. List the api keys for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogApiKeyListResponse or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.DatadogApiKeyListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass async def get_default_key( self, resource_group_name: str, monitor_name: str, **kwargs ) -> "models.DatadogApiKey": '''Get the default api key. Get the default api key. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogApiKey, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogApiKey :raises: ~azure.core.exceptions.HttpResponseError ''' pass async def set_default_key( self, resource_group_name: str, monitor_name: str, body: Optional["models.DatadogApiKey"] = None, **kwargs ) -> None: '''Set the default api key. Set the default api key. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param body: :type body: ~microsoft_datadog_client.models.DatadogApiKey :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError ''' pass def list_hosts( self, resource_group_name: str, monitor_name: str, **kwargs ) -> AsyncIterable["models.DatadogHostListResponse"]: '''List the hosts for a given monitor resource. List the hosts for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogHostListResponse or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.DatadogHostListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass def list_linked_resources( self, resource_group_name: str, monitor_name: str, **kwargs ) -> AsyncIterable["models.LinkedResourceListResponse"]: '''List all Azure resources associated to the same Datadog organization as the target resource. List all Azure resources associated to the same Datadog organization as the target resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LinkedResourceListResponse or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.LinkedResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass def list_monitored_resources( self, resource_group_name: str, monitor_name: str, **kwargs ) -> AsyncIterable["models.MonitoredResourceListResponse"]: '''List the resources currently being monitored by the Datadog monitor resource. List the resources currently being monitored by the Datadog monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MonitoredResourceListResponse or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.MonitoredResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass def list_api_keys( self, resource_group_name: str, monitor_name: str, **kwargs ) -> AsyncIterable["models.DatadogApiKeyListResponse"]: '''List all monitors under the specified subscription. List all monitors under the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogMonitorResourceListResponse or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.DatadogMonitorResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass def list_by_resource_group( self, resource_group_name: str, **kwargs ) -> AsyncIterable["models.DatadogMonitorResourceListResponse"]: '''List all monitors under the specified resource group. List all monitors under the specified resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogMonitorResourceListResponse or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.DatadogMonitorResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass async def get_next(next_link=None): '''Get the properties of a specific monitor resource. Get the properties of a specific monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogMonitorResource, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogMonitorResource :raises: ~azure.core.exceptions.HttpResponseError ''' pass async def _create_initial( self, resource_group_name: str, monitor_name: str, body: Optional["models.DatadogMonitorResource"] = None, **kwargs ) -> "models.DatadogMonitorResource": pass async def begin_create( self, resource_group_name: str, monitor_name: str, body: Optional["models.DatadogMonitorResource"] = None, **kwargs ) -> AsyncLROPoller["models.DatadogMonitorResource"]: '''Create a monitor resource. Create a monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param body: :type body: ~microsoft_datadog_client.models.DatadogMonitorResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either DatadogMonitorResource or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~microsoft_datadog_client.models.DatadogMonitorResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass async def _update_initial( self, resource_group_name: str, monitor_name: str, body: Optional["models.DatadogMonitorResourceUpdateParameters"] = None, **kwargs ) -> "models.DatadogMonitorResource": pass async def begin_update( self, resource_group_name: str, monitor_name: str, body: Optional["models.DatadogMonitorResourceUpdateParameters"] = None, **kwargs ) -> AsyncLROPoller["models.DatadogMonitorResource"]: '''Update a monitor resource. Update a monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param body: :type body: ~microsoft_datadog_client.models.DatadogMonitorResourceUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either DatadogMonitorResource or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~microsoft_datadog_client.models.DatadogMonitorResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass async def _delete_initial( self, resource_group_name: str, monitor_name: str, **kwargs ) -> None: pass async def begin_delete( self, resource_group_name: str, monitor_name: str, **kwargs ) -> AsyncLROPoller[None]: '''Delete a monitor resource. Delete a monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass async def refresh_set_password_link( self, resource_group_name: str, monitor_name: str, **kwargs ) -> "models.DatadogSetPasswordLink": '''Refresh the set password link and return a latest one. Refresh the set password link and return a latest one. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogSetPasswordLink, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogSetPasswordLink :raises: ~azure.core.exceptions.HttpResponseError ''' pass
39
14
35
5
24
8
2
0.4
0
1
0
0
17
4
17
17
1,102
170
725
337
604
293
494
255
455
6
0
1
92
9,450
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/aio/operations/_operations.py
azext_datadog.vendored_sdks.datadog.aio.operations._operations.Operations
class Operations: """Operations async operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. """ models = models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config def list( self, **kwargs ) -> AsyncIterable["models.OperationListResult"]: """List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): deserialized = self._deserialize('OperationListResult', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/providers/Microsoft.Datadog/operations'}
class Operations: '''Operations async operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. ''' def __init__(self, client, config, serializer, deserializer) -> None: pass def list( self, **kwargs ) -> AsyncIterable["models.OperationListResult"]: '''List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass
6
2
21
3
15
4
2
0.52
0
0
0
0
2
4
2
2
86
16
50
28
41
26
42
25
36
2
0
1
8
9,451
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/vnet_peering/_wait.py
azext_databricks.aaz.latest.databricks.workspace.vnet_peering._wait._WaitHelper
class _WaitHelper: """Helper class for Wait""" _schema_address_space_read = None @classmethod def _build_schema_address_space_read(cls, _schema): if cls._schema_address_space_read is not None: _schema.address_prefixes = cls._schema_address_space_read.address_prefixes return cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() address_space_read = _schema_address_space_read address_space_read.address_prefixes = AAZListType( serialized_name="addressPrefixes", ) address_prefixes = _schema_address_space_read.address_prefixes address_prefixes.Element = AAZStrType() _schema.address_prefixes = cls._schema_address_space_read.address_prefixes
class _WaitHelper: '''Helper class for Wait''' @classmethod def _build_schema_address_space_read(cls, _schema): pass
3
1
16
4
12
0
2
0.07
0
0
0
0
0
0
1
1
22
6
15
7
12
1
12
5
10
2
0
1
2
9,452
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/vnet_peering/_wait.py
azext_databricks.aaz.latest.databricks.workspace.vnet_peering._wait.Wait
class Wait(AAZWaitCommand): """Place the CLI in a waiting state until a condition is met. """ _aaz_info = { "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/workspaces/{}/virtualnetworkpeerings/{}", "2024-05-01"], ] } 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.name = AAZStrArg( options=["-n", "--name"], help="The name of the vnet peering.", required=True, id_part="child_name_1", ) _args_schema.resource_group = AAZResourceGroupNameArg( required=True, ) _args_schema.workspace_name = AAZStrArg( options=["--workspace-name"], help="The name of the workspace.", required=True, id_part="name", fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) return cls._args_schema def _execute_operations(self): self.pre_operations() self.VNetPeeringGet(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) return result class VNetPeeringGet(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.Databricks/workspaces/{workspaceName}/virtualNetworkPeerings/{peeringName}", **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( "peeringName", self.ctx.args.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, ), **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", "2024-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.id = AAZStrType( flags={"read_only": True}, ) _schema_on_200.name = AAZStrType( flags={"read_only": True}, ) _schema_on_200.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _schema_on_200.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200.properties properties.allow_forwarded_traffic = AAZBoolType( serialized_name="allowForwardedTraffic", ) properties.allow_gateway_transit = AAZBoolType( serialized_name="allowGatewayTransit", ) properties.allow_virtual_network_access = AAZBoolType( serialized_name="allowVirtualNetworkAccess", ) properties.databricks_address_space = AAZObjectType( serialized_name="databricksAddressSpace", ) _WaitHelper._build_schema_address_space_read(properties.databricks_address_space) properties.databricks_virtual_network = AAZObjectType( serialized_name="databricksVirtualNetwork", ) properties.peering_state = AAZStrType( serialized_name="peeringState", flags={"read_only": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.remote_address_space = AAZObjectType( serialized_name="remoteAddressSpace", ) _WaitHelper._build_schema_address_space_read(properties.remote_address_space) properties.remote_virtual_network = AAZObjectType( serialized_name="remoteVirtualNetwork", flags={"required": True}, ) properties.use_remote_gateways = AAZBoolType( serialized_name="useRemoteGateways", ) databricks_virtual_network = cls._schema_on_200.properties.databricks_virtual_network databricks_virtual_network.id = AAZStrType() remote_virtual_network = cls._schema_on_200.properties.remote_virtual_network remote_virtual_network.id = AAZStrType() return cls._schema_on_200 def on_204(self, session): pass
class Wait(AAZWaitCommand): '''Place the CLI in a waiting state until a condition is met. ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): pass class VNetPeeringGet(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 def on_204(self, session): pass
28
1
11
1
10
0
1
0.02
1
2
1
0
5
0
6
6
211
29
179
44
151
3
85
34
67
3
1
1
20
9,453
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/vnet_peering/_update.py
azext_databricks.aaz.latest.databricks.workspace.vnet_peering._update._UpdateHelper
class _UpdateHelper: """Helper class for Update""" @classmethod def _build_schema_address_space_update(cls, _builder): if _builder is None: return _builder.set_prop("addressPrefixes", AAZListType, ".address_prefixes") address_prefixes = _builder.get(".addressPrefixes") if address_prefixes is not None: address_prefixes.set_elements(AAZStrType, ".") _schema_address_space_read = None @classmethod def _build_schema_address_space_read(cls, _schema): if cls._schema_address_space_read is not None: _schema.address_prefixes = cls._schema_address_space_read.address_prefixes return cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() address_space_read = _schema_address_space_read address_space_read.address_prefixes = AAZListType( serialized_name="addressPrefixes", ) address_prefixes = _schema_address_space_read.address_prefixes address_prefixes.Element = AAZStrType() _schema.address_prefixes = cls._schema_address_space_read.address_prefixes _schema_virtual_network_peering_read = None @classmethod def _build_schema_virtual_network_peering_read(cls, _schema): if cls._schema_virtual_network_peering_read is not None: _schema.id = cls._schema_virtual_network_peering_read.id _schema.name = cls._schema_virtual_network_peering_read.name _schema.properties = cls._schema_virtual_network_peering_read.properties _schema.type = cls._schema_virtual_network_peering_read.type return cls._schema_virtual_network_peering_read = _schema_virtual_network_peering_read = AAZObjectType() virtual_network_peering_read = _schema_virtual_network_peering_read virtual_network_peering_read.id = AAZStrType( flags={"read_only": True}, ) virtual_network_peering_read.name = AAZStrType( flags={"read_only": True}, ) virtual_network_peering_read.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) virtual_network_peering_read.type = AAZStrType( flags={"read_only": True}, ) properties = _schema_virtual_network_peering_read.properties properties.allow_forwarded_traffic = AAZBoolType( serialized_name="allowForwardedTraffic", ) properties.allow_gateway_transit = AAZBoolType( serialized_name="allowGatewayTransit", ) properties.allow_virtual_network_access = AAZBoolType( serialized_name="allowVirtualNetworkAccess", ) properties.databricks_address_space = AAZObjectType( serialized_name="databricksAddressSpace", ) cls._build_schema_address_space_read(properties.databricks_address_space) properties.databricks_virtual_network = AAZObjectType( serialized_name="databricksVirtualNetwork", ) properties.peering_state = AAZStrType( serialized_name="peeringState", flags={"read_only": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.remote_address_space = AAZObjectType( serialized_name="remoteAddressSpace", ) cls._build_schema_address_space_read(properties.remote_address_space) properties.remote_virtual_network = AAZObjectType( serialized_name="remoteVirtualNetwork", flags={"required": True}, ) properties.use_remote_gateways = AAZBoolType( serialized_name="useRemoteGateways", ) databricks_virtual_network = _schema_virtual_network_peering_read.properties.databricks_virtual_network databricks_virtual_network.id = AAZStrType() remote_virtual_network = _schema_virtual_network_peering_read.properties.remote_virtual_network remote_virtual_network.id = AAZStrType() _schema.id = cls._schema_virtual_network_peering_read.id _schema.name = cls._schema_virtual_network_peering_read.name _schema.properties = cls._schema_virtual_network_peering_read.properties _schema.type = cls._schema_virtual_network_peering_read.type
class _UpdateHelper: '''Helper class for Update''' @classmethod def _build_schema_address_space_update(cls, _builder): pass @classmethod def _build_schema_address_space_read(cls, _schema): pass @classmethod def _build_schema_virtual_network_peering_read(cls, _schema): pass
7
1
32
4
28
0
2
0.01
0
0
0
0
0
0
3
3
107
16
90
18
83
1
54
13
50
3
0
1
7
9,454
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/vnet_peering/_update.py
azext_databricks.aaz.latest.databricks.workspace.vnet_peering._update.Update
class Update(AAZCommand): """Update the vnet peering. :example: Update the vnet peering (enable gateway transit and disable virtual network access). az databricks workspace vnet-peering update --resource-group MyResourceGroup --workspace-name MyWorkspace -n MyPeering --allow-gateway-transit --allow-virtual-network-access false """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/workspaces/{}/virtualnetworkpeerings/{}", "2024-05-01"], ] } AZ_SUPPORT_NO_WAIT = True AZ_SUPPORT_GENERIC_UPDATE = True def _handler(self, command_args): super()._handler(command_args) return self.build_lro_poller(self._execute_operations, self._output) _args_schema = None @classmethod def _build_arguments_schema(cls, *args, **kwargs): if cls._args_schema is not None: return cls._args_schema cls._args_schema = super()._build_arguments_schema(*args, **kwargs) # define Arg Group "" _args_schema = cls._args_schema _args_schema.name = AAZStrArg( options=["-n", "--name"], help="The name of the vnet peering.", required=True, id_part="child_name_1", ) _args_schema.resource_group = AAZResourceGroupNameArg( required=True, ) _args_schema.workspace_name = AAZStrArg( options=["--workspace-name"], help="The name of the workspace.", required=True, id_part="name", fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) _args_schema.allow_forwarded_traffic = AAZBoolArg( options=["--allow-forwarded-traffic"], help="Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network.", nullable=True, ) _args_schema.allow_gateway_transit = AAZBoolArg( options=["--allow-gateway-transit"], help="If gateway links can be used in remote virtual networking to link to this virtual network.", nullable=True, ) _args_schema.allow_virtual_network_access = AAZBoolArg( options=["--allow-virtual-network-access"], help="Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space.", nullable=True, ) _args_schema.use_remote_gateways = AAZBoolArg( options=["--use-remote-gateways"], help="If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway.", nullable=True, ) # define Arg Group "Properties" return cls._args_schema _args_address_space_update = None @classmethod def _build_args_address_space_update(cls, _schema): if cls._args_address_space_update is not None: _schema.address_prefixes = cls._args_address_space_update.address_prefixes return cls._args_address_space_update = AAZObjectArg( nullable=True, ) address_space_update = cls._args_address_space_update address_space_update.address_prefixes = AAZListArg( options=["address-prefixes"], help="A list of address blocks reserved for this virtual network in CIDR notation.", nullable=True, ) address_prefixes = cls._args_address_space_update.address_prefixes address_prefixes.Element = AAZStrArg( nullable=True, ) _schema.address_prefixes = cls._args_address_space_update.address_prefixes def _execute_operations(self): self.pre_operations() self.VNetPeeringGet(ctx=self.ctx)() self.pre_instance_update(self.ctx.vars.instance) self.InstanceUpdateByJson(ctx=self.ctx)() self.InstanceUpdateByGeneric(ctx=self.ctx)() self.post_instance_update(self.ctx.vars.instance) yield self.VNetPeeringCreateOrUpdate(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass @register_callback def pre_instance_update(self, instance): pass @register_callback def post_instance_update(self, instance): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) return result class VNetPeeringGet(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.Databricks/workspaces/{workspaceName}/virtualNetworkPeerings/{peeringName}", **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( "peeringName", self.ctx.args.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, ), **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", "2024-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _UpdateHelper._build_schema_virtual_network_peering_read(cls._schema_on_200) return cls._schema_on_200 def on_204(self, session): pass class VNetPeeringCreateOrUpdate(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.Databricks/workspaces/{workspaceName}/virtualNetworkPeerings/{peeringName}", **self.url_parameters ) @property def method(self): return "PUT" @property def error_format(self): return "ODataV4Format" @property def url_parameters(self): parameters = { **self.serialize_url_param( "peeringName", self.ctx.args.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, ), **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", "2024-05-01", 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_virtual_network_peering_read(cls._schema_on_200_201) return cls._schema_on_200_201 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": {"required": True, "client_flatten": True}}) properties = _builder.get(".properties") if properties is not None: properties.set_prop("allowForwardedTraffic", AAZBoolType, ".allow_forwarded_traffic") properties.set_prop("allowGatewayTransit", AAZBoolType, ".allow_gateway_transit") properties.set_prop("allowVirtualNetworkAccess", AAZBoolType, ".allow_virtual_network_access") properties.set_prop("useRemoteGateways", AAZBoolType, ".use_remote_gateways") return _instance_value class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): def __call__(self, *args, **kwargs): self._update_instance_by_generic( self.ctx.vars.instance, self.ctx.generic_update_args )
class Update(AAZCommand): '''Update the vnet peering. :example: Update the vnet peering (enable gateway transit and disable virtual network access). az databricks workspace vnet-peering update --resource-group MyResourceGroup --workspace-name MyWorkspace -n MyPeering --allow-gateway-transit --allow-virtual-network-access false ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass @classmethod def _build_args_address_space_update(cls, _schema): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass @register_callback def pre_instance_update(self, instance): pass @register_callback def post_instance_update(self, instance): pass def _output(self, *args, **kwargs): pass class VNetPeeringGet(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 def on_204(self, session): pass class VNetPeeringCreateOrUpdate(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 class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): def __call__(self, *args, **kwargs): pass def _update_instance(self, instance): pass class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): def __call__(self, *args, **kwargs): pass
58
1
9
1
8
0
1
0.02
1
5
4
0
7
0
9
9
368
60
302
87
244
6
143
65
106
3
1
1
41
9,455
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/account/backup_vault/backup/_create.py
azext_netappfiles_preview.aaz.latest.netappfiles.account.backup_vault.backup._create.Create.BackupsCreate
class BackupsCreate(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.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups/{backupName}", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "backupName", self.ctx.args.backup_name, required=True, ), **self.serialize_url_param( "backupVaultName", self.ctx.args.backup_vault_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-03-01-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("properties", AAZObjectType, ".", typ_kwargs={ "flags": {"required": True, "client_flatten": True}}) properties = _builder.get(".properties") if properties is not None: properties.set_prop("label", AAZStrType, ".label") properties.set_prop( "snapshotName", AAZStrType, ".snapshot_name") properties.set_prop("useExistingSnapshot", AAZBoolType, ".use_existing_snapshot") properties.set_prop("volumeResourceId", AAZStrType, ".volume_resource_id", typ_kwargs={ "flags": {"required": True}}) 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.name = AAZStrType( flags={"read_only": True}, ) _schema_on_200_201.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _schema_on_200_201.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) _schema_on_200_201.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200_201.properties properties.backup_id = AAZStrType( serialized_name="backupId", flags={"read_only": True}, ) properties.backup_policy_resource_id = AAZStrType( serialized_name="backupPolicyResourceId", flags={"read_only": True}, ) properties.backup_type = AAZStrType( serialized_name="backupType", flags={"read_only": True}, ) properties.creation_date = AAZStrType( serialized_name="creationDate", flags={"read_only": True}, ) properties.failure_reason = AAZStrType( serialized_name="failureReason", flags={"read_only": True}, ) properties.label = AAZStrType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.size = AAZIntType( flags={"read_only": True}, ) properties.snapshot_name = AAZStrType( serialized_name="snapshotName", ) properties.use_existing_snapshot = AAZBoolType( serialized_name="useExistingSnapshot", ) properties.volume_resource_id = AAZStrType( serialized_name="volumeResourceId", 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", ) return cls._schema_on_200_201
class BackupsCreate(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
18
1
17
0
1
0
1
0
0
0
9
1
10
10
204
19
185
33
166
0
69
24
58
3
1
1
14
9,456
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/account/backup_vault/_wait.py
azext_netappfiles_preview.aaz.latest.netappfiles.account.backup_vault._wait.Wait.BackupVaultsGet
class BackupVaultsGet(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.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "backupVaultName", self.ctx.args.backup_vault_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-03-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.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.provisioning_state = AAZStrType( serialized_name="provisioningState", 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", ) tags = cls._schema_on_200.tags tags.Element = AAZStrType() return cls._schema_on_200
class BackupVaultsGet(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
12
0
1
0
1
0
0
0
8
0
9
9
136
17
119
29
102
0
51
22
41
2
1
1
11
9,457
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/account/backup_vault/_update.py
azext_netappfiles_preview.aaz.latest.netappfiles.account.backup_vault._update.Update.BackupVaultsGet
class BackupVaultsGet(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.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "backupVaultName", self.ctx.args.backup_vault_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-03-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() _UpdateHelper._build_schema_backup_vault_read(cls._schema_on_200) return cls._schema_on_200
class BackupVaultsGet(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
9,458
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/account/backup_vault/_update.py
azext_netappfiles_preview.aaz.latest.netappfiles.account.backup_vault._update.Update.BackupVaultsCreateOrUpdate
class BackupVaultsCreateOrUpdate(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.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "backupVaultName", self.ctx.args.backup_vault_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-03-01-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_backup_vault_read( cls._schema_on_200_201) return cls._schema_on_200_201
class BackupVaultsCreateOrUpdate(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
9,459
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/account/backup_vault/_list.py
azext_netappfiles_preview.aaz.latest.netappfiles.account.backup_vault._list.List.BackupVaultsListByNetAppAccount
class BackupVaultsListByNetAppAccount(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.NetApp/netAppAccounts/{accountName}/backupVaults", **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( "accountName", self.ctx.args.account_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-03-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", ) _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.provisioning_state = AAZStrType( serialized_name="provisioningState", 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", ) tags = cls._schema_on_200.value.Element.tags tags.Element = AAZStrType() return cls._schema_on_200
class BackupVaultsListByNetAppAccount(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
12
0
1
0
1
0
0
0
8
0
9
9
141
19
122
31
105
0
56
24
46
2
1
1
11
9,460
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/account/backup_vault/_delete.py
azext_netappfiles_preview.aaz.latest.netappfiles.account.backup_vault._delete.Delete.BackupVaultsDelete
class BackupVaultsDelete(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.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "backupVaultName", self.ctx.args.backup_vault_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-03-01-preview", required=True, ), } return parameters def on_204(self, session): pass def on_200_201(self, session): pass
class BackupVaultsDelete(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
9,461
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/account/backup_vault/_create.py
azext_netappfiles_preview.aaz.latest.netappfiles.account.backup_vault._create.Create.BackupVaultsCreateOrUpdate
class BackupVaultsCreateOrUpdate(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.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "backupVaultName", self.ctx.args.backup_vault_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-03-01-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("tags", AAZDictType, ".tags") 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.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": 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 BackupVaultsCreateOrUpdate(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
15
1
14
0
1
0
1
0
0
0
9
1
10
10
171
20
151
34
132
0
61
25
50
3
1
1
14
9,462
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/private_link_resource/__cmd_group.py
azext_databricks.aaz.latest.databricks.workspace.private_link_resource.__cmd_group.__CMDGroup
class __CMDGroup(AAZCommandGroup): """Commands to manage databricks workspace private link resources. """ pass
class __CMDGroup(AAZCommandGroup): '''Commands to manage databricks workspace private link resources. ''' 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
9,463
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/netappfiles-preview/azext_netappfiles_preview/aaz/latest/netappfiles/account/backup_vault/backup/_list.py
azext_netappfiles_preview.aaz.latest.netappfiles.account.backup_vault.backup._list.List.BackupsListByVault
class BackupsListByVault(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.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/backups", **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( "accountName", self.ctx.args.account_name, required=True, ), **self.serialize_url_param( "backupVaultName", self.ctx.args.backup_vault_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( "$filter", self.ctx.args.filter, ), **self.serialize_query_param( "api-version", "2024-03-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", ) _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.name = AAZStrType( flags={"read_only": True}, ) _element.properties = AAZObjectType( flags={"required": True, "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.backup_id = AAZStrType( serialized_name="backupId", flags={"read_only": True}, ) properties.backup_policy_resource_id = AAZStrType( serialized_name="backupPolicyResourceId", flags={"read_only": True}, ) properties.backup_type = AAZStrType( serialized_name="backupType", flags={"read_only": True}, ) properties.creation_date = AAZStrType( serialized_name="creationDate", flags={"read_only": True}, ) properties.failure_reason = AAZStrType( serialized_name="failureReason", flags={"read_only": True}, ) properties.label = AAZStrType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.size = AAZIntType( flags={"read_only": True}, ) properties.snapshot_name = AAZStrType( serialized_name="snapshotName", ) properties.use_existing_snapshot = AAZBoolType( serialized_name="useExistingSnapshot", ) properties.volume_resource_id = AAZStrType( serialized_name="volumeResourceId", 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 BackupsListByVault(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
175
18
157
30
140
0
62
23
52
2
1
1
11
9,464
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/private_link_resource/_list.py
azext_databricks.aaz.latest.databricks.workspace.private_link_resource._list.List
class List(AAZCommand): """List private link resources for a given workspace """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/workspaces/{}/privatelinkresources", "2024-05-01"], ] } AZ_SUPPORT_PAGINATION = True 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.workspace_name = AAZStrArg( options=["--workspace-name"], help="The name of the workspace.", required=True, fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) return cls._args_schema def _execute_operations(self): self.pre_operations() self.PrivateLinkResourcesList(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) next_link = self.deserialize_output(self.ctx.vars.instance.next_link) return result, next_link class PrivateLinkResourcesList(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.Databricks/workspaces/{workspaceName}/privateLinkResources", **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( "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", "2024-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.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.name = AAZStrType( flags={"read_only": True}, ) _element.properties = AAZObjectType( flags={"required": True}, ) _element.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200.value.Element.properties properties.group_id = AAZStrType( serialized_name="groupId", ) properties.required_members = AAZListType( serialized_name="requiredMembers", ) properties.required_zone_names = AAZListType( serialized_name="requiredZoneNames", ) 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() return cls._schema_on_200
class List(AAZCommand): '''List private link resources for a given workspace ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): pass class PrivateLinkResourcesList(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
27
1
9
1
8
0
1
0.02
1
2
1
0
5
0
6
6
181
31
147
47
120
3
77
37
60
2
1
1
18
9,465
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/vnet_peering/__cmd_group.py
azext_databricks.aaz.latest.databricks.workspace.vnet_peering.__cmd_group.__CMDGroup
class __CMDGroup(AAZCommandGroup): """Commands to manage databricks workspace vnet peering. """ pass
class __CMDGroup(AAZCommandGroup): '''Commands to manage databricks workspace vnet peering. ''' 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
9,466
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/vnet_peering/_create.py
azext_databricks.aaz.latest.databricks.workspace.vnet_peering._create.Create
class Create(AAZCommand): """Create a vnet peering for a workspace. :example: Create a vnet peering for a workspace az databricks workspace vnet-peering create --resource-group MyResourceGroup --workspace-name MyWorkspace -n MyPeering --remote-vnet /subscriptions/000000-0000-0000/resourceGroups/MyRG/providers/Microsoft.Network/virtualNetworks/MyVNet """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/workspaces/{}/virtualnetworkpeerings/{}", "2024-05-01"], ] } AZ_SUPPORT_NO_WAIT = True def _handler(self, command_args): super()._handler(command_args) return self.build_lro_poller(self._execute_operations, self._output) _args_schema = None @classmethod def _build_arguments_schema(cls, *args, **kwargs): if cls._args_schema is not None: return cls._args_schema cls._args_schema = super()._build_arguments_schema(*args, **kwargs) # define Arg Group "" _args_schema = cls._args_schema _args_schema.name = AAZStrArg( options=["-n", "--name"], help="The name of the vnet peering.", required=True, ) _args_schema.resource_group = AAZResourceGroupNameArg( required=True, ) _args_schema.workspace_name = AAZStrArg( options=["--workspace-name"], help="The name of the workspace.", required=True, fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) _args_schema.allow_forwarded_traffic = AAZBoolArg( options=["--allow-forwarded-traffic"], help="Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network.", ) _args_schema.allow_gateway_transit = AAZBoolArg( options=["--allow-gateway-transit"], help="If gateway links can be used in remote virtual networking to link to this virtual network.", ) _args_schema.allow_virtual_network_access = AAZBoolArg( options=["--allow-virtual-network-access"], help="Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space.", ) _args_schema.remote_vnet = AAZStrArg( options=["--remote-vnet"], help="The remote virtual network name or Resource ID.", ) _args_schema.use_remote_gateways = AAZBoolArg( options=["--use-remote-gateways"], help="If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway.", ) # define Arg Group "Properties" return cls._args_schema _args_address_space_create = None @classmethod def _build_args_address_space_create(cls, _schema): if cls._args_address_space_create is not None: _schema.address_prefixes = cls._args_address_space_create.address_prefixes return cls._args_address_space_create = AAZObjectArg() address_space_create = cls._args_address_space_create address_space_create.address_prefixes = AAZListArg( options=["address-prefixes"], help="A list of address blocks reserved for this virtual network in CIDR notation.", ) address_prefixes = cls._args_address_space_create.address_prefixes address_prefixes.Element = AAZStrArg() _schema.address_prefixes = cls._args_address_space_create.address_prefixes def _execute_operations(self): self.pre_operations() yield self.VNetPeeringCreateOrUpdate(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) return result class VNetPeeringCreateOrUpdate(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.Databricks/workspaces/{workspaceName}/virtualNetworkPeerings/{peeringName}", **self.url_parameters ) @property def method(self): return "PUT" @property def error_format(self): return "ODataV4Format" @property def url_parameters(self): parameters = { **self.serialize_url_param( "peeringName", self.ctx.args.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, ), **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", "2024-05-01", 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("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) properties = _builder.get(".properties") if properties is not None: properties.set_prop("allowForwardedTraffic", AAZBoolType, ".allow_forwarded_traffic") properties.set_prop("allowGatewayTransit", AAZBoolType, ".allow_gateway_transit") properties.set_prop("allowVirtualNetworkAccess", AAZBoolType, ".allow_virtual_network_access") properties.set_prop("remoteVirtualNetwork", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}}) properties.set_prop("useRemoteGateways", AAZBoolType, ".use_remote_gateways") remote_virtual_network = _builder.get(".properties.remoteVirtualNetwork") if remote_virtual_network is not None: remote_virtual_network.set_prop("id", AAZStrType, ".remote_vnet") 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.name = AAZStrType( flags={"read_only": True}, ) _schema_on_200_201.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _schema_on_200_201.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200_201.properties properties.allow_forwarded_traffic = AAZBoolType( serialized_name="allowForwardedTraffic", ) properties.allow_gateway_transit = AAZBoolType( serialized_name="allowGatewayTransit", ) properties.allow_virtual_network_access = AAZBoolType( serialized_name="allowVirtualNetworkAccess", ) properties.databricks_address_space = AAZObjectType( serialized_name="databricksAddressSpace", ) _CreateHelper._build_schema_address_space_read(properties.databricks_address_space) properties.databricks_virtual_network = AAZObjectType( serialized_name="databricksVirtualNetwork", ) properties.peering_state = AAZStrType( serialized_name="peeringState", flags={"read_only": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.remote_address_space = AAZObjectType( serialized_name="remoteAddressSpace", ) _CreateHelper._build_schema_address_space_read(properties.remote_address_space) properties.remote_virtual_network = AAZObjectType( serialized_name="remoteVirtualNetwork", flags={"required": True}, ) properties.use_remote_gateways = AAZBoolType( serialized_name="useRemoteGateways", ) databricks_virtual_network = cls._schema_on_200_201.properties.databricks_virtual_network databricks_virtual_network.id = AAZStrType() remote_virtual_network = cls._schema_on_200_201.properties.remote_virtual_network remote_virtual_network.id = AAZStrType() return cls._schema_on_200_201
class Create(AAZCommand): '''Create a vnet peering for a workspace. :example: Create a vnet peering for a workspace az databricks workspace vnet-peering create --resource-group MyResourceGroup --workspace-name MyWorkspace -n MyPeering --remote-vnet /subscriptions/000000-0000-0000/resourceGroups/MyRG/providers/Microsoft.Network/virtualNetworks/MyVNet ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass @classmethod def _build_args_address_space_create(cls, _schema): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): pass class VNetPeeringCreateOrUpdate(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
31
1
14
1
13
0
1
0.02
1
2
1
1
5
0
7
7
294
41
247
55
216
6
113
42
94
3
1
1
24
9,467
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/vnet_peering/_create.py
azext_databricks.aaz.latest.databricks.workspace.vnet_peering._create._CreateHelper
class _CreateHelper: """Helper class for Create""" @classmethod def _build_schema_address_space_create(cls, _builder): if _builder is None: return _builder.set_prop("addressPrefixes", AAZListType, ".address_prefixes") address_prefixes = _builder.get(".addressPrefixes") if address_prefixes is not None: address_prefixes.set_elements(AAZStrType, ".") _schema_address_space_read = None @classmethod def _build_schema_address_space_read(cls, _schema): if cls._schema_address_space_read is not None: _schema.address_prefixes = cls._schema_address_space_read.address_prefixes return cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() address_space_read = _schema_address_space_read address_space_read.address_prefixes = AAZListType( serialized_name="addressPrefixes", ) address_prefixes = _schema_address_space_read.address_prefixes address_prefixes.Element = AAZStrType() _schema.address_prefixes = cls._schema_address_space_read.address_prefixes
class _CreateHelper: '''Helper class for Create''' @classmethod def _build_schema_address_space_create(cls, _builder): pass @classmethod def _build_schema_address_space_read(cls, _schema): pass
5
1
12
3
10
0
3
0.04
0
0
0
0
0
0
2
2
32
8
23
10
18
1
19
7
16
3
0
1
5
9,468
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/vnet_peering/_delete.py
azext_databricks.aaz.latest.databricks.workspace.vnet_peering._delete.Delete
class Delete(AAZCommand): """Delete the vnet peering. :example: Delete the vnet peering. az databricks workspace vnet-peering delete --resource-group MyResourceGroup --workspace-name MyWorkspace -n MyPeering """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/workspaces/{}/virtualnetworkpeerings/{}", "2024-05-01"], ] } AZ_SUPPORT_NO_WAIT = True def _handler(self, command_args): super()._handler(command_args) return self.build_lro_poller(self._execute_operations, 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.name = AAZStrArg( options=["-n", "--name"], help="The name of the vnet peering.", required=True, id_part="child_name_1", ) _args_schema.resource_group = AAZResourceGroupNameArg( required=True, ) _args_schema.workspace_name = AAZStrArg( options=["--workspace-name"], help="The name of the workspace.", required=True, id_part="name", fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) return cls._args_schema def _execute_operations(self): self.pre_operations() yield self.VNetPeeringDelete(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass class VNetPeeringDelete(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.Databricks/workspaces/{workspaceName}/virtualNetworkPeerings/{peeringName}", **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( "peeringName", self.ctx.args.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, ), **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", "2024-05-01", required=True, ), } return parameters def on_200(self, session): pass def on_204(self, session): pass
class Delete(AAZCommand): '''Delete the vnet peering. :example: Delete the vnet peering. az databricks workspace vnet-peering delete --resource-group MyResourceGroup --workspace-name MyWorkspace -n MyPeering ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass class VNetPeeringDelete(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
23
1
9
0
8
0
1
0.04
1
2
1
0
4
0
5
5
153
21
127
33
104
5
52
24
37
4
1
1
17
9,469
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/vnet_peering/_list.py
azext_databricks.aaz.latest.databricks.workspace.vnet_peering._list.List
class List(AAZCommand): """List vnet peerings under a workspace. :example: List vnet peerings under a workspace. az databricks workspace vnet-peering list --resource-group MyResourceGroup --workspace-name MyWorkspace """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/workspaces/{}/virtualnetworkpeerings", "2024-05-01"], ] } AZ_SUPPORT_PAGINATION = True 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.workspace_name = AAZStrArg( options=["--workspace-name"], help="The name of the workspace.", required=True, fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) return cls._args_schema def _execute_operations(self): self.pre_operations() self.VNetPeeringListByWorkspace(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) next_link = self.deserialize_output(self.ctx.vars.instance.next_link) return result, next_link class VNetPeeringListByWorkspace(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.Databricks/workspaces/{workspaceName}/virtualNetworkPeerings", **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( "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", "2024-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.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.name = AAZStrType( flags={"read_only": True}, ) _element.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _element.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200.value.Element.properties properties.allow_forwarded_traffic = AAZBoolType( serialized_name="allowForwardedTraffic", ) properties.allow_gateway_transit = AAZBoolType( serialized_name="allowGatewayTransit", ) properties.allow_virtual_network_access = AAZBoolType( serialized_name="allowVirtualNetworkAccess", ) properties.databricks_address_space = AAZObjectType( serialized_name="databricksAddressSpace", ) _ListHelper._build_schema_address_space_read(properties.databricks_address_space) properties.databricks_virtual_network = AAZObjectType( serialized_name="databricksVirtualNetwork", ) properties.peering_state = AAZStrType( serialized_name="peeringState", flags={"read_only": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.remote_address_space = AAZObjectType( serialized_name="remoteAddressSpace", ) _ListHelper._build_schema_address_space_read(properties.remote_address_space) properties.remote_virtual_network = AAZObjectType( serialized_name="remoteVirtualNetwork", flags={"required": True}, ) properties.use_remote_gateways = AAZBoolType( serialized_name="useRemoteGateways", ) databricks_virtual_network = cls._schema_on_200.value.Element.properties.databricks_virtual_network databricks_virtual_network.id = AAZStrType() remote_virtual_network = cls._schema_on_200.value.Element.properties.remote_virtual_network remote_virtual_network.id = AAZStrType() return cls._schema_on_200
class List(AAZCommand): '''List vnet peerings under a workspace. :example: List vnet peerings under a workspace. az databricks workspace vnet-peering list --resource-group MyResourceGroup --workspace-name MyWorkspace ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): pass class VNetPeeringListByWorkspace(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
27
1
11
1
10
0
1
0.03
1
2
1
0
5
0
6
6
210
32
173
47
146
5
86
37
69
2
1
1
18
9,470
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/vnet_peering/_list.py
azext_databricks.aaz.latest.databricks.workspace.vnet_peering._list._ListHelper
class _ListHelper: """Helper class for List""" _schema_address_space_read = None @classmethod def _build_schema_address_space_read(cls, _schema): if cls._schema_address_space_read is not None: _schema.address_prefixes = cls._schema_address_space_read.address_prefixes return cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() address_space_read = _schema_address_space_read address_space_read.address_prefixes = AAZListType( serialized_name="addressPrefixes", ) address_prefixes = _schema_address_space_read.address_prefixes address_prefixes.Element = AAZStrType() _schema.address_prefixes = cls._schema_address_space_read.address_prefixes
class _ListHelper: '''Helper class for List''' @classmethod def _build_schema_address_space_read(cls, _schema): pass
3
1
16
4
12
0
2
0.07
0
0
0
0
0
0
1
1
22
6
15
7
12
1
12
5
10
2
0
1
2
9,471
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/vnet_peering/_show.py
azext_databricks.aaz.latest.databricks.workspace.vnet_peering._show.Show
class Show(AAZCommand): """Show the vnet peering. :example: Show the vnet peering az databricks workspace vnet-peering show --resource-group MyResourceGroup --workspace-name MyWorkspace -n MyPeering """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/workspaces/{}/virtualnetworkpeerings/{}", "2024-05-01"], ] } 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.name = AAZStrArg( options=["-n", "--name"], help="The name of the vnet peering.", required=True, id_part="child_name_1", ) _args_schema.resource_group = AAZResourceGroupNameArg( required=True, ) _args_schema.workspace_name = AAZStrArg( options=["--workspace-name"], help="The name of the workspace.", required=True, id_part="name", fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) return cls._args_schema def _execute_operations(self): self.pre_operations() self.VNetPeeringGet(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) return result class VNetPeeringGet(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.Databricks/workspaces/{workspaceName}/virtualNetworkPeerings/{peeringName}", **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( "peeringName", self.ctx.args.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, ), **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", "2024-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.id = AAZStrType( flags={"read_only": True}, ) _schema_on_200.name = AAZStrType( flags={"read_only": True}, ) _schema_on_200.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _schema_on_200.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200.properties properties.allow_forwarded_traffic = AAZBoolType( serialized_name="allowForwardedTraffic", ) properties.allow_gateway_transit = AAZBoolType( serialized_name="allowGatewayTransit", ) properties.allow_virtual_network_access = AAZBoolType( serialized_name="allowVirtualNetworkAccess", ) properties.databricks_address_space = AAZObjectType( serialized_name="databricksAddressSpace", ) _ShowHelper._build_schema_address_space_read(properties.databricks_address_space) properties.databricks_virtual_network = AAZObjectType( serialized_name="databricksVirtualNetwork", ) properties.peering_state = AAZStrType( serialized_name="peeringState", flags={"read_only": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.remote_address_space = AAZObjectType( serialized_name="remoteAddressSpace", ) _ShowHelper._build_schema_address_space_read(properties.remote_address_space) properties.remote_virtual_network = AAZObjectType( serialized_name="remoteVirtualNetwork", flags={"required": True}, ) properties.use_remote_gateways = AAZBoolType( serialized_name="useRemoteGateways", ) databricks_virtual_network = cls._schema_on_200.properties.databricks_virtual_network databricks_virtual_network.id = AAZStrType() remote_virtual_network = cls._schema_on_200.properties.remote_virtual_network remote_virtual_network.id = AAZStrType() return cls._schema_on_200 def on_204(self, session): pass
class Show(AAZCommand): '''Show the vnet peering. :example: Show the vnet peering az databricks workspace vnet-peering show --resource-group MyResourceGroup --workspace-name MyWorkspace -n MyPeering ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): pass class VNetPeeringGet(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 def on_204(self, session): pass
28
1
11
1
10
0
1
0.03
1
2
1
0
5
0
6
6
215
30
180
44
152
5
85
34
67
3
1
1
20
9,472
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/vnet_peering/_show.py
azext_databricks.aaz.latest.databricks.workspace.vnet_peering._show._ShowHelper
class _ShowHelper: """Helper class for Show""" _schema_address_space_read = None @classmethod def _build_schema_address_space_read(cls, _schema): if cls._schema_address_space_read is not None: _schema.address_prefixes = cls._schema_address_space_read.address_prefixes return cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() address_space_read = _schema_address_space_read address_space_read.address_prefixes = AAZListType( serialized_name="addressPrefixes", ) address_prefixes = _schema_address_space_read.address_prefixes address_prefixes.Element = AAZStrType() _schema.address_prefixes = cls._schema_address_space_read.address_prefixes
class _ShowHelper: '''Helper class for Show''' @classmethod def _build_schema_address_space_read(cls, _schema): pass
3
1
16
4
12
0
2
0.07
0
0
0
0
0
0
1
1
22
6
15
7
12
1
12
5
10
2
0
1
2
9,473
Azure/azure-cli-extensions
src/databricks/azext_databricks/aaz/latest/databricks/workspace/private_link_resource/_show.py
azext_databricks.aaz.latest.databricks.workspace.private_link_resource._show.Show
class Show(AAZCommand): """Get the specified private link resource for the given group id (sub-resource) """ _aaz_info = { "version": "2024-05-01", "resources": [ ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.databricks/workspaces/{}/privatelinkresources/{}", "2024-05-01"], ] } 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.group_id = AAZStrArg( options=["-n", "--name", "--group-id"], help="The name of the private link resource", required=True, id_part="child_name_1", ) _args_schema.resource_group = AAZResourceGroupNameArg( required=True, ) _args_schema.workspace_name = AAZStrArg( options=["--workspace-name"], help="The name of the workspace.", required=True, id_part="name", fmt=AAZStrArgFormat( max_length=64, min_length=3, ), ) return cls._args_schema def _execute_operations(self): self.pre_operations() self.PrivateLinkResourcesGet(ctx=self.ctx)() self.post_operations() @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) return result class 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.Databricks/workspaces/{workspaceName}/privateLinkResources/{groupId}", **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( "groupId", self.ctx.args.group_id, 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, ), **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", "2024-05-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.id = AAZStrType( flags={"read_only": True}, ) _schema_on_200.name = AAZStrType( flags={"read_only": True}, ) _schema_on_200.properties = AAZObjectType( flags={"required": True}, ) _schema_on_200.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200.properties properties.group_id = AAZStrType( serialized_name="groupId", ) properties.required_members = AAZListType( serialized_name="requiredMembers", ) properties.required_zone_names = AAZListType( serialized_name="requiredZoneNames", ) 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() return cls._schema_on_200
class Show(AAZCommand): '''Get the specified private link resource for the given group id (sub-resource) ''' def _handler(self, command_args): pass @classmethod def _build_arguments_schema(cls, *args, **kwargs): pass def _execute_operations(self): pass @register_callback def pre_operations(self): pass @register_callback def post_operations(self): pass def _output(self, *args, **kwargs): pass class 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
27
1
9
1
9
0
1
0.02
1
2
1
0
5
0
6
6
181
28
150
43
123
3
72
33
55
2
1
1
18
9,474
Azure/azure-cli-extensions
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.BuildpackBindingResource
class BuildpackBindingResource(ProxyResource): """Buildpack Binding Resource object. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource Id for the resource. :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.appplatform.v2023_12_01.models.SystemData :ivar properties: Properties of a buildpack binding. :vartype properties: ~azure.mgmt.appplatform.v2023_12_01.models.BuildpackBindingProperties """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, "system_data": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, "properties": {"key": "properties", "type": "BuildpackBindingProperties"}, } def __init__(self, *, properties: Optional["_models.BuildpackBindingProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: Properties of a buildpack binding. :paramtype properties: ~azure.mgmt.appplatform.v2023_12_01.models.BuildpackBindingProperties """ super().__init__(**kwargs) self.properties = properties
class BuildpackBindingResource(ProxyResource): '''Buildpack Binding Resource object. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource Id for the resource. :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.appplatform.v2023_12_01.models.SystemData :ivar properties: Properties of a buildpack binding. :vartype properties: ~azure.mgmt.appplatform.v2023_12_01.models.BuildpackBindingProperties ''' def __init__(self, *, properties: Optional["_models.BuildpackBindingProperties"] = None, **kwargs: Any) -> None: ''' :keyword properties: Properties of a buildpack binding. :paramtype properties: ~azure.mgmt.appplatform.v2023_12_01.models.BuildpackBindingProperties ''' pass
2
2
7
0
3
4
1
1
1
2
0
0
1
1
1
17
39
5
17
5
15
17
6
5
4
1
4
0
1
9,475
Azure/azure-cli-extensions
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.BuildpacksGroupProperties
class BuildpacksGroupProperties(_serialization.Model): """Buildpack group properties of the Builder. :ivar name: Buildpack group name. :vartype name: str :ivar buildpacks: Buildpacks in the buildpack group. :vartype buildpacks: list[~azure.mgmt.appplatform.v2023_12_01.models.BuildpackProperties] """ _attribute_map = { "name": {"key": "name", "type": "str"}, "buildpacks": {"key": "buildpacks", "type": "[BuildpackProperties]"}, } def __init__( self, *, name: Optional[str] = None, buildpacks: Optional[List["_models.BuildpackProperties"]] = None, **kwargs: Any ) -> None: """ :keyword name: Buildpack group name. :paramtype name: str :keyword buildpacks: Buildpacks in the buildpack group. :paramtype buildpacks: list[~azure.mgmt.appplatform.v2023_12_01.models.BuildpackProperties] """ super().__init__(**kwargs) self.name = name self.buildpacks = buildpacks
class BuildpacksGroupProperties(_serialization.Model): '''Buildpack group properties of the Builder. :ivar name: Buildpack group name. :vartype name: str :ivar buildpacks: Buildpacks in the buildpack group. :vartype buildpacks: list[~azure.mgmt.appplatform.v2023_12_01.models.BuildpackProperties] ''' def __init__( self, *, name: Optional[str] = None, buildpacks: Optional[List["_models.BuildpackProperties"]] = None, **kwargs: Any ) -> None: ''' :keyword name: Buildpack group name. :paramtype name: str :keyword buildpacks: Buildpacks in the buildpack group. :paramtype buildpacks: list[~azure.mgmt.appplatform.v2023_12_01.models.BuildpackProperties] ''' pass
2
2
16
0
10
6
1
0.8
1
3
0
0
1
2
1
16
30
3
15
11
7
12
6
5
4
1
2
0
1
9,476
Azure/azure-cli-extensions
src/spring/azext_spring/vendored_sdks/appplatform/v2023_12_01/models/_models_py3.py
azext_spring.vendored_sdks.appplatform.v2023_12_01.models._models_py3.BuildpackProperties
class BuildpackProperties(_serialization.Model): """Buildpack properties payload. :ivar id: Id of the buildpack. :vartype id: str """ _attribute_map = { "id": {"key": "id", "type": "str"}, } def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Id of the buildpack. :paramtype id: str """ super().__init__(**kwargs) self.id = id
class BuildpackProperties(_serialization.Model): '''Buildpack properties payload. :ivar id: Id of the buildpack. :vartype id: str ''' def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: ''' :keyword id: Id of the buildpack. :paramtype id: str ''' pass
2
2
7
0
3
5
1
1.29
1
3
0
0
1
1
1
16
18
3
7
4
5
9
5
4
3
1
2
0
1
9,477
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ListDataCenters
class ListDataCenters(_serialization.Model): """List of managed Cassandra data centers and their properties. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Container for array of data centers. :vartype value: list[~azure.mgmt.cosmosdb.models.DataCenterResource] """ _validation = { "value": {"readonly": True}, } _attribute_map = { "value": {"key": "value", "type": "[DataCenterResource]"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None
class ListDataCenters(_serialization.Model): '''List of managed Cassandra data centers and their properties. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Container for array of data centers. :vartype value: list[~azure.mgmt.cosmosdb.models.DataCenterResource] ''' def __init__(self, **kwargs: Any) -> None: ''' ''' pass
2
2
4
0
3
1
1
0.6
1
2
0
0
1
1
1
16
21
5
10
5
8
6
6
5
4
1
2
0
1
9,478
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.Location
class Location(_serialization.Model): """A region in which the Azure Cosmos DB database account is deployed. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: The unique identifier of the region within the database account. Example: &lt;accountName&gt;-&lt;locationName&gt;. :vartype id: str :ivar location_name: The name of the region. :vartype location_name: str :ivar document_endpoint: The connection endpoint for the specific region. Example: https://&lt;accountName&gt;-&lt;locationName&gt;.documents.azure.com:443/. :vartype document_endpoint: str :ivar provisioning_state: The provisioning state of the resource. :vartype provisioning_state: str :ivar failover_priority: The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. :vartype failover_priority: int :ivar is_zone_redundant: Flag to indicate whether or not this region is an AvailabilityZone region. :vartype is_zone_redundant: bool """ _validation = { "id": {"readonly": True}, "document_endpoint": {"readonly": True}, "provisioning_state": {"readonly": True}, "failover_priority": {"minimum": 0}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "location_name": {"key": "locationName", "type": "str"}, "document_endpoint": {"key": "documentEndpoint", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, "failover_priority": {"key": "failoverPriority", "type": "int"}, "is_zone_redundant": {"key": "isZoneRedundant", "type": "bool"}, } def __init__( self, *, location_name: Optional[str] = None, failover_priority: Optional[int] = None, is_zone_redundant: Optional[bool] = None, **kwargs: Any ) -> None: """ :keyword location_name: The name of the region. :paramtype location_name: str :keyword failover_priority: The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. :paramtype failover_priority: int :keyword is_zone_redundant: Flag to indicate whether or not this region is an AvailabilityZone region. :paramtype is_zone_redundant: bool """ super().__init__(**kwargs) self.id = None self.location_name = location_name self.document_endpoint = None self.provisioning_state = None self.failover_priority = failover_priority self.is_zone_redundant = is_zone_redundant
class Location(_serialization.Model): '''A region in which the Azure Cosmos DB database account is deployed. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: The unique identifier of the region within the database account. Example: &lt;accountName&gt;-&lt;locationName&gt;. :vartype id: str :ivar location_name: The name of the region. :vartype location_name: str :ivar document_endpoint: The connection endpoint for the specific region. Example: https://&lt;accountName&gt;-&lt;locationName&gt;.documents.azure.com:443/. :vartype document_endpoint: str :ivar provisioning_state: The provisioning state of the resource. :vartype provisioning_state: str :ivar failover_priority: The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. :vartype failover_priority: int :ivar is_zone_redundant: Flag to indicate whether or not this region is an AvailabilityZone region. :vartype is_zone_redundant: bool ''' def __init__( self, *, location_name: Optional[str] = None, failover_priority: Optional[int] = None, is_zone_redundant: Optional[bool] = None, **kwargs: Any ) -> None: ''' :keyword location_name: The name of the region. :paramtype location_name: str :keyword failover_priority: The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. :paramtype failover_priority: int :keyword is_zone_redundant: Flag to indicate whether or not this region is an AvailabilityZone region. :paramtype is_zone_redundant: bool ''' pass
2
2
27
0
15
12
1
1.1
1
5
0
0
1
6
1
16
68
5
30
17
21
33
11
10
9
1
2
0
1
9,479
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.LocationGetResult
class LocationGetResult(ARMProxyResource): """Cosmos DB location get result. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: The unique resource identifier of the database account. :vartype id: str :ivar name: The name of the database account. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str :ivar properties: Cosmos DB location metadata. :vartype properties: ~azure.mgmt.cosmosdb.models.LocationProperties """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "properties": {"key": "properties", "type": "LocationProperties"}, } def __init__(self, *, properties: Optional["_models.LocationProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: Cosmos DB location metadata. :paramtype properties: ~azure.mgmt.cosmosdb.models.LocationProperties """ super().__init__(**kwargs) self.properties = properties
class LocationGetResult(ARMProxyResource): '''Cosmos DB location get result. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: The unique resource identifier of the database account. :vartype id: str :ivar name: The name of the database account. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str :ivar properties: Cosmos DB location metadata. :vartype properties: ~azure.mgmt.cosmosdb.models.LocationProperties ''' def __init__(self, *, properties: Optional["_models.LocationProperties"] = None, **kwargs: Any) -> None: ''' :keyword properties: Cosmos DB location metadata. :paramtype properties: ~azure.mgmt.cosmosdb.models.LocationProperties ''' pass
2
2
7
0
3
4
1
1
1
2
0
0
1
1
1
17
35
5
15
5
13
15
6
5
4
1
3
0
1
9,480
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.LocationListResult
class LocationListResult(_serialization.Model): """The List operation response, that contains Cosmos DB locations and their properties. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of Cosmos DB locations and their properties. :vartype value: list[~azure.mgmt.cosmosdb.models.LocationGetResult] """ _validation = { "value": {"readonly": True}, } _attribute_map = { "value": {"key": "value", "type": "[LocationGetResult]"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None
class LocationListResult(_serialization.Model): '''The List operation response, that contains Cosmos DB locations and their properties. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of Cosmos DB locations and their properties. :vartype value: list[~azure.mgmt.cosmosdb.models.LocationGetResult] ''' def __init__(self, **kwargs: Any) -> None: ''' ''' pass
2
2
4
0
3
1
1
0.6
1
2
0
0
1
1
1
16
21
5
10
5
8
6
6
5
4
1
2
0
1
9,481
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.LocationProperties
class LocationProperties(_serialization.Model): """Cosmos DB location metadata. Variables are only populated by the server, and will be ignored when sending a request. :ivar supports_availability_zone: Flag indicating whether the location supports availability zones or not. :vartype supports_availability_zone: bool :ivar is_residency_restricted: Flag indicating whether the location is residency sensitive. :vartype is_residency_restricted: bool :ivar backup_storage_redundancies: The properties of available backup storage redundancies. :vartype backup_storage_redundancies: list[str or ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy] :ivar is_subscription_region_access_allowed_for_regular: Flag indicating whether the subscription have access in region for Non-Availability Zones. :vartype is_subscription_region_access_allowed_for_regular: bool :ivar is_subscription_region_access_allowed_for_az: Flag indicating whether the subscription have access in region for Availability Zones(Az). :vartype is_subscription_region_access_allowed_for_az: bool :ivar status: Enum to indicate current buildout status of the region. Known values are: "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", "Failed", "Canceled", and "Updating". :vartype status: str or ~azure.mgmt.cosmosdb.models.Status """ _validation = { "supports_availability_zone": {"readonly": True}, "is_residency_restricted": {"readonly": True}, "backup_storage_redundancies": {"readonly": True}, "is_subscription_region_access_allowed_for_regular": {"readonly": True}, "is_subscription_region_access_allowed_for_az": {"readonly": True}, "status": {"readonly": True}, } _attribute_map = { "supports_availability_zone": {"key": "supportsAvailabilityZone", "type": "bool"}, "is_residency_restricted": {"key": "isResidencyRestricted", "type": "bool"}, "backup_storage_redundancies": {"key": "backupStorageRedundancies", "type": "[str]"}, "is_subscription_region_access_allowed_for_regular": { "key": "isSubscriptionRegionAccessAllowedForRegular", "type": "bool", }, "is_subscription_region_access_allowed_for_az": { "key": "isSubscriptionRegionAccessAllowedForAz", "type": "bool", }, "status": {"key": "status", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.supports_availability_zone = None self.is_residency_restricted = None self.backup_storage_redundancies = None self.is_subscription_region_access_allowed_for_regular = None self.is_subscription_region_access_allowed_for_az = None self.status = None
class LocationProperties(_serialization.Model): '''Cosmos DB location metadata. Variables are only populated by the server, and will be ignored when sending a request. :ivar supports_availability_zone: Flag indicating whether the location supports availability zones or not. :vartype supports_availability_zone: bool :ivar is_residency_restricted: Flag indicating whether the location is residency sensitive. :vartype is_residency_restricted: bool :ivar backup_storage_redundancies: The properties of available backup storage redundancies. :vartype backup_storage_redundancies: list[str or ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy] :ivar is_subscription_region_access_allowed_for_regular: Flag indicating whether the subscription have access in region for Non-Availability Zones. :vartype is_subscription_region_access_allowed_for_regular: bool :ivar is_subscription_region_access_allowed_for_az: Flag indicating whether the subscription have access in region for Availability Zones(Az). :vartype is_subscription_region_access_allowed_for_az: bool :ivar status: Enum to indicate current buildout status of the region. Known values are: "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", "Failed", "Canceled", and "Updating". :vartype status: str or ~azure.mgmt.cosmosdb.models.Status ''' def __init__(self, **kwargs: Any) -> None: ''' ''' pass
2
2
9
0
8
1
1
0.71
1
2
0
0
1
6
1
16
58
5
31
10
29
22
11
10
9
1
2
0
1
9,482
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ManagedCassandraARMResourceProperties
class ManagedCassandraARMResourceProperties(_serialization.Model): """The core properties of ARM resources. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str :ivar location: The location of the resource group to which the resource belongs. :vartype location: str :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] :ivar identity: Identity for the resource. :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedCassandraManagedServiceIdentity """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, "identity": {"key": "identity", "type": "ManagedCassandraManagedServiceIdentity"}, } def __init__( self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedCassandraManagedServiceIdentity"] = None, **kwargs: Any ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] :keyword identity: Identity for the resource. :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedCassandraManagedServiceIdentity """ super().__init__(**kwargs) self.id = None self.name = None self.type = None self.location = location self.tags = tags self.identity = identity
class ManagedCassandraARMResourceProperties(_serialization.Model): '''The core properties of ARM resources. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str :ivar location: The location of the resource group to which the resource belongs. :vartype location: str :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] :ivar identity: Identity for the resource. :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedCassandraManagedServiceIdentity ''' def __init__( self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedCassandraManagedServiceIdentity"] = None, **kwargs: Any ) -> None: ''' :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] :keyword identity: Identity for the resource. :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedCassandraManagedServiceIdentity ''' pass
2
2
28
0
15
13
1
1.14
1
3
0
1
1
6
1
16
67
5
29
17
20
33
11
10
9
1
2
0
1
9,483
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ManagedCassandraManagedServiceIdentity
class ManagedCassandraManagedServiceIdentity(_serialization.Model): """Identity for the resource. Variables are only populated by the server, and will be ignored when sending a request. :ivar principal_id: The object id of the identity resource. :vartype principal_id: str :ivar tenant_id: The tenant id of the resource. :vartype tenant_id: str :ivar type: The type of the resource. Known values are: "SystemAssigned" and "None". :vartype type: str or ~azure.mgmt.cosmosdb.models.ManagedCassandraResourceIdentityType """ _validation = { "principal_id": {"readonly": True}, "tenant_id": {"readonly": True}, } _attribute_map = { "principal_id": {"key": "principalId", "type": "str"}, "tenant_id": {"key": "tenantId", "type": "str"}, "type": {"key": "type", "type": "str"}, } def __init__( self, *, type: Optional[Union[str, "_models.ManagedCassandraResourceIdentityType"]] = None, **kwargs: Any ) -> None: """ :keyword type: The type of the resource. Known values are: "SystemAssigned" and "None". :paramtype type: str or ~azure.mgmt.cosmosdb.models.ManagedCassandraResourceIdentityType """ super().__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = type
class ManagedCassandraManagedServiceIdentity(_serialization.Model): '''Identity for the resource. Variables are only populated by the server, and will be ignored when sending a request. :ivar principal_id: The object id of the identity resource. :vartype principal_id: str :ivar tenant_id: The tenant id of the resource. :vartype tenant_id: str :ivar type: The type of the resource. Known values are: "SystemAssigned" and "None". :vartype type: str or ~azure.mgmt.cosmosdb.models.ManagedCassandraResourceIdentityType ''' def __init__( self, *, type: Optional[Union[str, "_models.ManagedCassandraResourceIdentityType"]] = None, **kwargs: Any ) -> None: ''' :keyword type: The type of the resource. Known values are: "SystemAssigned" and "None". :paramtype type: str or ~azure.mgmt.cosmosdb.models.ManagedCassandraResourceIdentityType ''' pass
2
2
11
0
7
4
1
0.76
1
3
0
0
1
3
1
16
35
5
17
9
13
13
8
7
6
1
2
0
1
9,484
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ManagedCassandraReaperStatus
class ManagedCassandraReaperStatus(_serialization.Model): """ManagedCassandraReaperStatus. :ivar healthy: :vartype healthy: bool :ivar repair_run_ids: Dictionary of :code:`<string>`. :vartype repair_run_ids: dict[str, str] :ivar repair_schedules: Dictionary of :code:`<string>`. :vartype repair_schedules: dict[str, str] """ _attribute_map = { "healthy": {"key": "healthy", "type": "bool"}, "repair_run_ids": {"key": "repairRunIds", "type": "{str}"}, "repair_schedules": {"key": "repairSchedules", "type": "{str}"}, } def __init__( self, *, healthy: Optional[bool] = None, repair_run_ids: Optional[Dict[str, str]] = None, repair_schedules: Optional[Dict[str, str]] = None, **kwargs: Any ) -> None: """ :keyword healthy: :paramtype healthy: bool :keyword repair_run_ids: Dictionary of :code:`<string>`. :paramtype repair_run_ids: dict[str, str] :keyword repair_schedules: Dictionary of :code:`<string>`. :paramtype repair_schedules: dict[str, str] """ super().__init__(**kwargs) self.healthy = healthy self.repair_run_ids = repair_run_ids self.repair_schedules = repair_schedules
class ManagedCassandraReaperStatus(_serialization.Model): '''ManagedCassandraReaperStatus. :ivar healthy: :vartype healthy: bool :ivar repair_run_ids: Dictionary of :code:`<string>`. :vartype repair_run_ids: dict[str, str] :ivar repair_schedules: Dictionary of :code:`<string>`. :vartype repair_schedules: dict[str, str] ''' def __init__( self, *, healthy: Optional[bool] = None, repair_run_ids: Optional[Dict[str, str]] = None, repair_schedules: Optional[Dict[str, str]] = None, **kwargs: Any ) -> None: ''' :keyword healthy: :paramtype healthy: bool :keyword repair_run_ids: Dictionary of :code:`<string>`. :paramtype repair_run_ids: dict[str, str] :keyword repair_schedules: Dictionary of :code:`<string>`. :paramtype repair_schedules: dict[str, str] ''' pass
2
2
20
0
12
8
1
0.89
1
4
0
0
1
3
1
16
37
3
18
13
9
16
7
6
5
1
2
0
1
9,485
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ManagedServiceIdentity
class ManagedServiceIdentity(_serialization.Model): """Identity for the resource. Variables are only populated by the server, and will be ignored when sending a request. :ivar principal_id: The principal id of the system assigned identity. This property will only be provided for a system assigned identity. :vartype principal_id: str :ivar tenant_id: The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. :vartype tenant_id: str :ivar type: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Known values are: "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned", and "None". :vartype type: str or ~azure.mgmt.cosmosdb.models.ResourceIdentityType :ivar user_assigned_identities: The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long :vartype user_assigned_identities: dict[str, ~azure.mgmt.cosmosdb.models.ManagedServiceIdentityUserAssignedIdentity] """ _validation = { "principal_id": {"readonly": True}, "tenant_id": {"readonly": True}, } _attribute_map = { "principal_id": {"key": "principalId", "type": "str"}, "tenant_id": {"key": "tenantId", "type": "str"}, "type": {"key": "type", "type": "str"}, "user_assigned_identities": { "key": "userAssignedIdentities", "type": "{ManagedServiceIdentityUserAssignedIdentity}", }, } def __init__( self, *, type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, user_assigned_identities: Optional[Dict[str, "_models.ManagedServiceIdentityUserAssignedIdentity"]] = None, **kwargs: Any ) -> None: """ :keyword type: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Known values are: "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned", and "None". :paramtype type: str or ~azure.mgmt.cosmosdb.models.ResourceIdentityType :keyword user_assigned_identities: The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long :paramtype user_assigned_identities: dict[str, ~azure.mgmt.cosmosdb.models.ManagedServiceIdentityUserAssignedIdentity] """ super().__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = type self.user_assigned_identities = user_assigned_identities
class ManagedServiceIdentity(_serialization.Model): '''Identity for the resource. Variables are only populated by the server, and will be ignored when sending a request. :ivar principal_id: The principal id of the system assigned identity. This property will only be provided for a system assigned identity. :vartype principal_id: str :ivar tenant_id: The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. :vartype tenant_id: str :ivar type: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Known values are: "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned", and "None". :vartype type: str or ~azure.mgmt.cosmosdb.models.ResourceIdentityType :ivar user_assigned_identities: The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long :vartype user_assigned_identities: dict[str, ~azure.mgmt.cosmosdb.models.ManagedServiceIdentityUserAssignedIdentity] ''' def __init__( self, *, type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, user_assigned_identities: Optional[Dict[str, "_models.ManagedServiceIdentityUserAssignedIdentity"]] = None, **kwargs: Any ) -> None: ''' :keyword type: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Known values are: "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned", and "None". :paramtype type: str or ~azure.mgmt.cosmosdb.models.ResourceIdentityType :keyword user_assigned_identities: The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long :paramtype user_assigned_identities: dict[str, ~azure.mgmt.cosmosdb.models.ManagedServiceIdentityUserAssignedIdentity] ''' pass
2
2
24
0
12
12
1
1.19
1
3
0
0
1
4
1
16
62
5
26
14
18
31
9
8
7
1
2
0
1
9,486
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ManagedServiceIdentityUserAssignedIdentity
class ManagedServiceIdentityUserAssignedIdentity(_serialization.Model): # pylint: disable=name-too-long """ManagedServiceIdentityUserAssignedIdentity. Variables are only populated by the server, and will be ignored when sending a request. :ivar principal_id: The principal id of user assigned identity. :vartype principal_id: str :ivar client_id: The client id of user assigned identity. :vartype client_id: str """ _validation = { "principal_id": {"readonly": True}, "client_id": {"readonly": True}, } _attribute_map = { "principal_id": {"key": "principalId", "type": "str"}, "client_id": {"key": "clientId", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.principal_id = None self.client_id = None
class ManagedServiceIdentityUserAssignedIdentity(_serialization.Model): '''ManagedServiceIdentityUserAssignedIdentity. Variables are only populated by the server, and will be ignored when sending a request. :ivar principal_id: The principal id of user assigned identity. :vartype principal_id: str :ivar client_id: The client id of user assigned identity. :vartype client_id: str ''' def __init__(self, **kwargs: Any) -> None: ''' ''' pass
2
2
5
0
4
1
1
0.69
1
2
0
0
1
2
1
16
26
5
13
6
11
9
7
6
5
1
2
0
1
9,487
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.MaterializedViewDefinition
class MaterializedViewDefinition(_serialization.Model): """Materialized View definition for the container. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. :ivar source_collection_rid: An unique identifier for the source collection. This is a system generated property. :vartype source_collection_rid: str :ivar source_collection_id: The name of the source container on which the Materialized View will be created. Required. :vartype source_collection_id: str :ivar definition: The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. Required. :vartype definition: str """ _validation = { "source_collection_rid": {"readonly": True}, "source_collection_id": {"required": True}, "definition": {"required": True}, } _attribute_map = { "source_collection_rid": {"key": "sourceCollectionRid", "type": "str"}, "source_collection_id": {"key": "sourceCollectionId", "type": "str"}, "definition": {"key": "definition", "type": "str"}, } def __init__(self, *, source_collection_id: str, definition: str, **kwargs: Any) -> None: """ :keyword source_collection_id: The name of the source container on which the Materialized View will be created. Required. :paramtype source_collection_id: str :keyword definition: The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. Required. :paramtype definition: str """ super().__init__(**kwargs) self.source_collection_rid = None self.source_collection_id = source_collection_id self.definition = definition
class MaterializedViewDefinition(_serialization.Model): '''Materialized View definition for the container. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. :ivar source_collection_rid: An unique identifier for the source collection. This is a system generated property. :vartype source_collection_rid: str :ivar source_collection_id: The name of the source container on which the Materialized View will be created. Required. :vartype source_collection_id: str :ivar definition: The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. Required. :vartype definition: str ''' def __init__(self, *, source_collection_id: str, definition: str, **kwargs: Any) -> None: ''' :keyword source_collection_id: The name of the source container on which the Materialized View will be created. Required. :paramtype source_collection_id: str :keyword definition: The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. Required. :paramtype definition: str ''' pass
2
2
13
0
5
8
1
1.31
1
3
0
0
1
3
1
16
43
6
16
7
14
21
8
7
6
1
2
0
1
9,488
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.MaterializedViewsBuilderRegionalServiceResource
class MaterializedViewsBuilderRegionalServiceResource(RegionalServiceResource): # pylint: disable=name-too-long """Resource for a regional service location. Variables are only populated by the server, and will be ignored when sending a request. :ivar name: The regional service name. :vartype name: str :ivar location: The location name. :vartype location: str :ivar status: Describes the status of a service. Known values are: "Creating", "Running", "Updating", "Deleting", "Error", and "Stopped". :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus """
class MaterializedViewsBuilderRegionalServiceResource(RegionalServiceResource): '''Resource for a regional service location. Variables are only populated by the server, and will be ignored when sending a request. :ivar name: The regional service name. :vartype name: str :ivar location: The location name. :vartype location: str :ivar status: Describes the status of a service. Known values are: "Creating", "Running", "Updating", "Deleting", "Error", and "Stopped". :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus ''' pass
1
1
0
0
0
0
0
11
1
0
0
0
0
0
0
16
13
2
1
1
0
11
1
1
0
0
3
0
0
9,489
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.MaterializedViewsBuilderServiceResource
class MaterializedViewsBuilderServiceResource(_serialization.Model): """Describes the service response property for MaterializedViewsBuilder. :ivar properties: Properties for MaterializedViewsBuilderServiceResource. :vartype properties: ~azure.mgmt.cosmosdb.models.MaterializedViewsBuilderServiceResourceProperties """ _attribute_map = { "properties": {"key": "properties", "type": "MaterializedViewsBuilderServiceResourceProperties"}, } def __init__( self, *, properties: Optional["_models.MaterializedViewsBuilderServiceResourceProperties"] = None, **kwargs: Any ) -> None: """ :keyword properties: Properties for MaterializedViewsBuilderServiceResource. :paramtype properties: ~azure.mgmt.cosmosdb.models.MaterializedViewsBuilderServiceResourceProperties """ super().__init__(**kwargs) self.properties = properties
class MaterializedViewsBuilderServiceResource(_serialization.Model): '''Describes the service response property for MaterializedViewsBuilder. :ivar properties: Properties for MaterializedViewsBuilderServiceResource. :vartype properties: ~azure.mgmt.cosmosdb.models.MaterializedViewsBuilderServiceResourceProperties ''' def __init__( self, *, properties: Optional["_models.MaterializedViewsBuilderServiceResourceProperties"] = None, **kwargs: Any ) -> None: ''' :keyword properties: Properties for MaterializedViewsBuilderServiceResource. :paramtype properties: ~azure.mgmt.cosmosdb.models.MaterializedViewsBuilderServiceResourceProperties ''' pass
2
2
10
0
5
5
1
1.11
1
2
0
0
1
1
1
16
22
3
9
6
5
10
5
4
3
1
2
0
1
9,490
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.MaterializedViewsBuilderServiceResourceCreateUpdateProperties
class MaterializedViewsBuilderServiceResourceCreateUpdateProperties( ServiceResourceCreateUpdateProperties ): # pylint: disable=name-too-long """Properties for Create or Update request for MaterializedViewsBuilderServiceResource. All required parameters must be populated in order to send to server. :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", "Cosmos.D8s", and "Cosmos.D16s". :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize :ivar instance_count: Instance count for the service. :vartype instance_count: int :ivar service_type: ServiceType for the service. Required. Known values are: "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType """ _validation = { "instance_count": {"minimum": 0}, "service_type": {"required": True}, } _attribute_map = { "instance_size": {"key": "instanceSize", "type": "str"}, "instance_count": {"key": "instanceCount", "type": "int"}, "service_type": {"key": "serviceType", "type": "str"}, } def __init__( self, *, instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, instance_count: Optional[int] = None, **kwargs: Any ) -> None: """ :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", "Cosmos.D8s", and "Cosmos.D16s". :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize :keyword instance_count: Instance count for the service. :paramtype instance_count: int """ super().__init__(instance_size=instance_size, instance_count=instance_count, **kwargs) self.service_type: str = "MaterializedViewsBuilder"
class MaterializedViewsBuilderServiceResourceCreateUpdateProperties( ServiceResourceCreateUpdateProperties ): '''Properties for Create or Update request for MaterializedViewsBuilderServiceResource. All required parameters must be populated in order to send to server. :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", "Cosmos.D8s", and "Cosmos.D16s". :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize :ivar instance_count: Instance count for the service. :vartype instance_count: int :ivar service_type: ServiceType for the service. Required. Known values are: "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType ''' def __init__( self, *, instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, instance_count: Optional[int] = None, **kwargs: Any ) -> None: ''' :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", "Cosmos.D8s", and "Cosmos.D16s". :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize :keyword instance_count: Instance count for the service. :paramtype instance_count: int ''' pass
2
2
16
0
9
7
1
0.9
1
4
0
0
1
1
1
17
44
5
21
13
11
19
6
5
4
1
3
0
1
9,491
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.MaterializedViewsBuilderServiceResourceProperties
class MaterializedViewsBuilderServiceResourceProperties(ServiceResourceProperties): # pylint: disable=name-too-long """Properties for MaterializedViewsBuilderServiceResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. :ivar additional_properties: Unmatched properties from the message are deserialized to this collection. :vartype additional_properties: dict[str, any] :ivar creation_time: Time of the last state change (ISO-8601 format). :vartype creation_time: ~datetime.datetime :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", "Cosmos.D8s", and "Cosmos.D16s". :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize :ivar instance_count: Instance count for the service. :vartype instance_count: int :ivar service_type: ServiceType for the service. Required. Known values are: "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType :ivar status: Describes the status of a service. Known values are: "Creating", "Running", "Updating", "Deleting", "Error", and "Stopped". :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus :ivar locations: An array that contains all of the locations for the service. :vartype locations: list[~azure.mgmt.cosmosdb.models.MaterializedViewsBuilderRegionalServiceResource] """ _validation = { "creation_time": {"readonly": True}, "instance_count": {"minimum": 0}, "service_type": {"required": True}, "status": {"readonly": True}, "locations": {"readonly": True}, } _attribute_map = { "additional_properties": {"key": "", "type": "{object}"}, "creation_time": {"key": "creationTime", "type": "iso-8601"}, "instance_size": {"key": "instanceSize", "type": "str"}, "instance_count": {"key": "instanceCount", "type": "int"}, "service_type": {"key": "serviceType", "type": "str"}, "status": {"key": "status", "type": "str"}, "locations": {"key": "locations", "type": "[MaterializedViewsBuilderRegionalServiceResource]"}, } def __init__( self, *, additional_properties: Optional[Dict[str, Any]] = None, instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, instance_count: Optional[int] = None, **kwargs: Any ) -> None: """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. :paramtype additional_properties: dict[str, any] :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", "Cosmos.D8s", and "Cosmos.D16s". :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize :keyword instance_count: Instance count for the service. :paramtype instance_count: int """ super().__init__( additional_properties=additional_properties, instance_size=instance_size, instance_count=instance_count, **kwargs ) self.service_type: str = "MaterializedViewsBuilder" self.locations = None
class MaterializedViewsBuilderServiceResourceProperties(ServiceResourceProperties): '''Properties for MaterializedViewsBuilderServiceResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. :ivar additional_properties: Unmatched properties from the message are deserialized to this collection. :vartype additional_properties: dict[str, any] :ivar creation_time: Time of the last state change (ISO-8601 format). :vartype creation_time: ~datetime.datetime :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", "Cosmos.D8s", and "Cosmos.D16s". :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize :ivar instance_count: Instance count for the service. :vartype instance_count: int :ivar service_type: ServiceType for the service. Required. Known values are: "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType :ivar status: Describes the status of a service. Known values are: "Creating", "Running", "Updating", "Deleting", "Error", and "Stopped". :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus :ivar locations: An array that contains all of the locations for the service. :vartype locations: list[~azure.mgmt.cosmosdb.models.MaterializedViewsBuilderRegionalServiceResource] ''' def __init__( self, *, additional_properties: Optional[Dict[str, Any]] = None, instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, instance_count: Optional[int] = None, **kwargs: Any ) -> None: ''' :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. :paramtype additional_properties: dict[str, any] :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", "Cosmos.D8s", and "Cosmos.D16s". :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize :keyword instance_count: Instance count for the service. :paramtype instance_count: int ''' pass
2
2
26
0
16
10
1
1.03
1
4
0
0
1
2
1
17
72
6
33
13
24
34
7
6
5
1
3
0
1
9,492
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.MergeParameters
class MergeParameters(_serialization.Model): """The properties of an Azure Cosmos DB merge operations. :ivar is_dry_run: Specifies whether the operation is a real merge operation or a simulation. :vartype is_dry_run: bool """ _attribute_map = { "is_dry_run": {"key": "isDryRun", "type": "bool"}, } def __init__(self, *, is_dry_run: Optional[bool] = None, **kwargs: Any) -> None: """ :keyword is_dry_run: Specifies whether the operation is a real merge operation or a simulation. :paramtype is_dry_run: bool """ super().__init__(**kwargs) self.is_dry_run = is_dry_run
class MergeParameters(_serialization.Model): '''The properties of an Azure Cosmos DB merge operations. :ivar is_dry_run: Specifies whether the operation is a real merge operation or a simulation. :vartype is_dry_run: bool ''' def __init__(self, *, is_dry_run: Optional[bool] = None, **kwargs: Any) -> None: ''' :keyword is_dry_run: Specifies whether the operation is a real merge operation or a simulation. :paramtype is_dry_run: bool ''' pass
2
2
7
0
3
4
1
1.14
1
3
0
0
1
1
1
16
18
3
7
4
5
8
5
4
3
1
2
0
1
9,493
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.Metric
class Metric(_serialization.Model): """Metric data. Variables are only populated by the server, and will be ignored when sending a request. :ivar start_time: The start time for the metric (ISO-8601 format). :vartype start_time: ~datetime.datetime :ivar end_time: The end time for the metric (ISO-8601 format). :vartype end_time: ~datetime.datetime :ivar time_grain: The time grain to be used to summarize the metric values. :vartype time_grain: str :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", "CountPerSecond", "BytesPerSecond", and "Milliseconds". :vartype unit: str or ~azure.mgmt.cosmosdb.models.UnitType :ivar name: The name information for the metric. :vartype name: ~azure.mgmt.cosmosdb.models.MetricName :ivar metric_values: The metric values for the specified time window and timestep. :vartype metric_values: list[~azure.mgmt.cosmosdb.models.MetricValue] """ _validation = { "start_time": {"readonly": True}, "end_time": {"readonly": True}, "time_grain": {"readonly": True}, "unit": {"readonly": True}, "name": {"readonly": True}, "metric_values": {"readonly": True}, } _attribute_map = { "start_time": {"key": "startTime", "type": "iso-8601"}, "end_time": {"key": "endTime", "type": "iso-8601"}, "time_grain": {"key": "timeGrain", "type": "str"}, "unit": {"key": "unit", "type": "str"}, "name": {"key": "name", "type": "MetricName"}, "metric_values": {"key": "metricValues", "type": "[MetricValue]"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.start_time = None self.end_time = None self.time_grain = None self.unit = None self.name = None self.metric_values = None
class Metric(_serialization.Model): '''Metric data. Variables are only populated by the server, and will be ignored when sending a request. :ivar start_time: The start time for the metric (ISO-8601 format). :vartype start_time: ~datetime.datetime :ivar end_time: The end time for the metric (ISO-8601 format). :vartype end_time: ~datetime.datetime :ivar time_grain: The time grain to be used to summarize the metric values. :vartype time_grain: str :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", "CountPerSecond", "BytesPerSecond", and "Milliseconds". :vartype unit: str or ~azure.mgmt.cosmosdb.models.UnitType :ivar name: The name information for the metric. :vartype name: ~azure.mgmt.cosmosdb.models.MetricName :ivar metric_values: The metric values for the specified time window and timestep. :vartype metric_values: list[~azure.mgmt.cosmosdb.models.MetricValue] ''' def __init__(self, **kwargs: Any) -> None: ''' ''' pass
2
2
9
0
8
1
1
0.68
1
2
0
1
1
6
1
16
47
5
25
10
23
17
11
10
9
1
2
0
1
9,494
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ListCommands
class ListCommands(_serialization.Model): """List of commands for cluster. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Container for array of commands. :vartype value: list[~azure.mgmt.cosmosdb.models.CommandPublicResource] """ _validation = { "value": {"readonly": True}, } _attribute_map = { "value": {"key": "value", "type": "[CommandPublicResource]"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None
class ListCommands(_serialization.Model): '''List of commands for cluster. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Container for array of commands. :vartype value: list[~azure.mgmt.cosmosdb.models.CommandPublicResource] ''' def __init__(self, **kwargs: Any) -> None: ''' ''' pass
2
2
4
0
3
1
1
0.6
1
2
0
0
1
1
1
16
21
5
10
5
8
6
6
5
4
1
2
0
1
9,495
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.MetricAvailability
class MetricAvailability(_serialization.Model): """The availability of the metric. Variables are only populated by the server, and will be ignored when sending a request. :ivar time_grain: The time grain to be used to summarize the metric values. :vartype time_grain: str :ivar retention: The retention for the metric values. :vartype retention: str """ _validation = { "time_grain": {"readonly": True}, "retention": {"readonly": True}, } _attribute_map = { "time_grain": {"key": "timeGrain", "type": "str"}, "retention": {"key": "retention", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.time_grain = None self.retention = None
class MetricAvailability(_serialization.Model): '''The availability of the metric. Variables are only populated by the server, and will be ignored when sending a request. :ivar time_grain: The time grain to be used to summarize the metric values. :vartype time_grain: str :ivar retention: The retention for the metric values. :vartype retention: 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
9,496
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.ListClusters
class ListClusters(_serialization.Model): """List of managed Cassandra clusters. :ivar value: Container for the array of clusters. :vartype value: list[~azure.mgmt.cosmosdb.models.ClusterResource] """ _attribute_map = { "value": {"key": "value", "type": "[ClusterResource]"}, } def __init__(self, *, value: Optional[List["_models.ClusterResource"]] = None, **kwargs: Any) -> None: """ :keyword value: Container for the array of clusters. :paramtype value: list[~azure.mgmt.cosmosdb.models.ClusterResource] """ super().__init__(**kwargs) self.value = value
class ListClusters(_serialization.Model): '''List of managed Cassandra clusters. :ivar value: Container for the array of clusters. :vartype value: list[~azure.mgmt.cosmosdb.models.ClusterResource] ''' def __init__(self, *, value: Optional[List["_models.ClusterResource"]] = None, **kwargs: Any) -> None: ''' :keyword value: Container for the array of clusters. :paramtype value: list[~azure.mgmt.cosmosdb.models.ClusterResource] ''' pass
2
2
7
0
3
4
1
1.14
1
2
0
0
1
1
1
16
18
3
7
4
5
8
5
4
3
1
2
0
1
9,497
Azure/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/_models_py3.py
azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models._models_py3.KeyWrapMetadata
class KeyWrapMetadata(_serialization.Model): """Represents key wrap metadata that a key wrapping provider can use to wrap/unwrap a client encryption key. :ivar name: The name of associated KeyEncryptionKey (aka CustomerManagedKey). :vartype name: str :ivar type: ProviderName of KeyStoreProvider. :vartype type: str :ivar value: Reference / link to the KeyEncryptionKey. :vartype value: str :ivar algorithm: Algorithm used in wrapping and unwrapping of the data encryption key. :vartype algorithm: str """ _attribute_map = { "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "value": {"key": "value", "type": "str"}, "algorithm": {"key": "algorithm", "type": "str"}, } def __init__( self, *, name: Optional[str] = None, type: Optional[str] = None, value: Optional[str] = None, algorithm: Optional[str] = None, **kwargs: Any ) -> None: """ :keyword name: The name of associated KeyEncryptionKey (aka CustomerManagedKey). :paramtype name: str :keyword type: ProviderName of KeyStoreProvider. :paramtype type: str :keyword value: Reference / link to the KeyEncryptionKey. :paramtype value: str :keyword algorithm: Algorithm used in wrapping and unwrapping of the data encryption key. :paramtype algorithm: str """ super().__init__(**kwargs) self.name = name self.type = type self.value = value self.algorithm = algorithm
class KeyWrapMetadata(_serialization.Model): '''Represents key wrap metadata that a key wrapping provider can use to wrap/unwrap a client encryption key. :ivar name: The name of associated KeyEncryptionKey (aka CustomerManagedKey). :vartype name: str :ivar type: ProviderName of KeyStoreProvider. :vartype type: str :ivar value: Reference / link to the KeyEncryptionKey. :vartype value: str :ivar algorithm: Algorithm used in wrapping and unwrapping of the data encryption key. :vartype algorithm: str ''' def __init__( self, *, name: Optional[str] = None, type: Optional[str] = None, value: Optional[str] = None, algorithm: Optional[str] = None, **kwargs: Any ) -> None: ''' :keyword name: The name of associated KeyEncryptionKey (aka CustomerManagedKey). :paramtype name: str :keyword type: ProviderName of KeyStoreProvider. :paramtype type: str :keyword value: Reference / link to the KeyEncryptionKey. :paramtype value: str :keyword algorithm: Algorithm used in wrapping and unwrapping of the data encryption key. :paramtype algorithm: str ''' pass
2
2
24
0
14
10
1
1
1
3
0
0
1
4
1
16
45
3
21
15
11
21
8
7
6
1
2
0
1
9,498
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/securityinsight/azext_sentinel/aaz/latest/sentinel/bookmark/_update.py
azext_sentinel.aaz.latest.sentinel.bookmark._update.Update.BookmarksCreateOrUpdate
class BookmarksCreateOrUpdate(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.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}", **self.url_parameters ) @property def method(self): return "PUT" @property def error_format(self): return "ODataV4Format" @property def url_parameters(self): parameters = { **self.serialize_url_param( "bookmarkId", self.ctx.args.bookmark_id, 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, ), **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( "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() _build_schema_bookmark_read(cls._schema_on_200_201) return cls._schema_on_200_201
class BookmarksCreateOrUpdate(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
8
0
7
0
1
0
1
0
0
0
9
0
10
10
98
15
83
28
64
0
36
20
25
2
1
1
12
9,499
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/securityinsight/azext_sentinel/aaz/latest/sentinel/bookmark/_show.py
azext_sentinel.aaz.latest.sentinel.bookmark._show.Show.BookmarksGet
class BookmarksGet(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/bookmarks/{bookmarkId}", **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( "bookmarkId", self.ctx.args.bookmark_id, 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, ), **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.created = AAZStrType() properties.created_by = AAZObjectType( serialized_name="createdBy", ) _build_schema_user_info_read(properties.created_by) properties.display_name = AAZStrType( serialized_name="displayName", flags={"required": True}, ) properties.entity_mappings = AAZListType( serialized_name="entityMappings", ) properties.event_time = AAZStrType( serialized_name="eventTime", ) properties.incident_info = AAZObjectType( serialized_name="incidentInfo", ) properties.labels = AAZListType() properties.notes = AAZStrType() properties.query = AAZStrType( flags={"required": True}, ) properties.query_end_time = AAZStrType( serialized_name="queryEndTime", ) properties.query_result = AAZStrType( serialized_name="queryResult", ) properties.query_start_time = AAZStrType( serialized_name="queryStartTime", ) properties.tactics = AAZListType() properties.techniques = AAZListType() properties.updated = AAZStrType() properties.updated_by = AAZObjectType( serialized_name="updatedBy", ) _build_schema_user_info_read(properties.updated_by) entity_mappings = cls._schema_on_200.properties.entity_mappings entity_mappings.Element = AAZObjectType() _element = cls._schema_on_200.properties.entity_mappings.Element _element.entity_type = AAZStrType( serialized_name="entityType", ) _element.field_mappings = AAZListType( serialized_name="fieldMappings", ) field_mappings = cls._schema_on_200.properties.entity_mappings.Element.field_mappings field_mappings.Element = AAZObjectType() _element = cls._schema_on_200.properties.entity_mappings.Element.field_mappings.Element _element.identifier = AAZStrType() _element.value = AAZStrType() incident_info = cls._schema_on_200.properties.incident_info incident_info.incident_id = AAZStrType( serialized_name="incidentId", ) incident_info.relation_name = AAZStrType( serialized_name="relationName", ) incident_info.severity = AAZStrType() incident_info.title = AAZStrType() labels = cls._schema_on_200.properties.labels labels.Element = AAZStrType() tactics = cls._schema_on_200.properties.tactics tactics.Element = AAZStrType() techniques = cls._schema_on_200.properties.techniques techniques.Element = AAZStrType() 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 BookmarksGet(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
0
0
0
8
0
9
9
208
24
184
35
167
0
86
28
76
2
1
1
11