Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

{Packaging} Vendor azure-mgmt-datalake-analytics #27163

Merged
merged 5 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/azure-cli-core/azure/cli/core/profiles/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class ResourceType(Enum): # pylint: disable=too-few-public-methods
MGMT_CONSUMPTION = ('azure.mgmt.consumption', None)
MGMT_CONTAINERINSTANCE = ('azure.mgmt.containerinstance', None)
MGMT_COSMOSDB = ('azure.mgmt.cosmosdb', None)
MGMT_DATALAKE_ANALYTICS = ('azure.mgmt.datalake.analytics', None)
MGMT_DATALAKE_ANALYTICS = ('azure.cli.command_modules.dla.vendored_sdks.azure_mgmt_datalake_analytics', None)
MGMT_DATALAKE_STORE = ('azure.mgmt.datalake.store', None)
MGMT_DATAMIGRATION = ('azure.mgmt.datamigration', None)
MGMT_EVENTGRID = ('azure.mgmt.eventgrid', None)
Expand Down
18 changes: 9 additions & 9 deletions src/azure-cli/azure/cli/command_modules/dla/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@

def cf_dla_account(cli_ctx, _):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.datalake.analytics.account import DataLakeAnalyticsAccountManagementClient
from .vendored_sdks.azure_mgmt_datalake_analytics.account import DataLakeAnalyticsAccountManagementClient
return get_mgmt_service_client(cli_ctx, DataLakeAnalyticsAccountManagementClient).account


def cf_dla_account_firewall(cli_ctx, _):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.datalake.analytics.account import DataLakeAnalyticsAccountManagementClient
from .vendored_sdks.azure_mgmt_datalake_analytics.account import DataLakeAnalyticsAccountManagementClient
return get_mgmt_service_client(cli_ctx, DataLakeAnalyticsAccountManagementClient).firewall_rules


def cf_dla_account_compute_policy(cli_ctx, _):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.datalake.analytics.account import DataLakeAnalyticsAccountManagementClient
from .vendored_sdks.azure_mgmt_datalake_analytics.account import DataLakeAnalyticsAccountManagementClient
return get_mgmt_service_client(cli_ctx, DataLakeAnalyticsAccountManagementClient).compute_policies


def cf_dla_account_storage(cli_ctx, _):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.datalake.analytics.account import DataLakeAnalyticsAccountManagementClient
from .vendored_sdks.azure_mgmt_datalake_analytics.account import DataLakeAnalyticsAccountManagementClient
return get_mgmt_service_client(cli_ctx, DataLakeAnalyticsAccountManagementClient).storage_accounts


def cf_dla_account_adls(cli_ctx, _):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.datalake.analytics.account import DataLakeAnalyticsAccountManagementClient
from .vendored_sdks.azure_mgmt_datalake_analytics.account import DataLakeAnalyticsAccountManagementClient
return get_mgmt_service_client(cli_ctx, DataLakeAnalyticsAccountManagementClient).data_lake_store_accounts


def cf_dla_catalog(cli_ctx, _):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.datalake.analytics.catalog import DataLakeAnalyticsCatalogManagementClient
from .vendored_sdks.azure_mgmt_datalake_analytics.catalog import DataLakeAnalyticsCatalogManagementClient
return get_mgmt_service_client(
cli_ctx,
DataLakeAnalyticsCatalogManagementClient,
Expand All @@ -48,7 +48,7 @@ def cf_dla_catalog(cli_ctx, _):

def cf_dla_job(cli_ctx, _):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.datalake.analytics.job import DataLakeAnalyticsJobManagementClient
from .vendored_sdks.azure_mgmt_datalake_analytics.job import DataLakeAnalyticsJobManagementClient
return get_mgmt_service_client(
cli_ctx,
DataLakeAnalyticsJobManagementClient,
Expand All @@ -60,7 +60,7 @@ def cf_dla_job(cli_ctx, _):

def cf_dla_job_recurrence(cli_ctx, _):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.datalake.analytics.job import DataLakeAnalyticsJobManagementClient
from .vendored_sdks.azure_mgmt_datalake_analytics.job import DataLakeAnalyticsJobManagementClient
return get_mgmt_service_client(
cli_ctx,
DataLakeAnalyticsJobManagementClient,
Expand All @@ -72,7 +72,7 @@ def cf_dla_job_recurrence(cli_ctx, _):

def cf_dla_job_pipeline(cli_ctx, _):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.datalake.analytics.job import DataLakeAnalyticsJobManagementClient
from .vendored_sdks.azure_mgmt_datalake_analytics.job import DataLakeAnalyticsJobManagementClient
return get_mgmt_service_client(
cli_ctx,
DataLakeAnalyticsJobManagementClient,
Expand Down
5 changes: 2 additions & 3 deletions src/azure-cli/azure/cli/command_modules/dla/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@

# pylint: disable=line-too-long, too-many-statements
def load_arguments(self, _):
from azure.mgmt.datalake.analytics.account.models import (FirewallState, TierType, FirewallAllowAzureIpsState,
AADObjectType)
from .vendored_sdks.azure_mgmt_datalake_analytics.account.models import (FirewallState, TierType, FirewallAllowAzureIpsState, AADObjectType)

from azure.mgmt.datalake.analytics.job.models import (CompileMode, JobState, JobResult)
from .vendored_sdks.azure_mgmt_datalake_analytics.job.models import (CompileMode, JobState, JobResult)

datalake_analytics_name_type = CLIArgumentType(help='Name of the Data Lake Analytics account.', options_list=('--account_name',), completer=get_resource_name_completion_list('Microsoft.DataLakeAnalytics/accounts'), id_part='name')

Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/azure/cli/command_modules/dla/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _get_resource_group_from_account_name(client, account_name):

# COMMAND NAMESPACE VALIDATORS
def validate_resource_group_name(cmd, ns):
from azure.mgmt.datalake.analytics.account import DataLakeAnalyticsAccountManagementClient
from .vendored_sdks.azure_mgmt_datalake_analytics.account import DataLakeAnalyticsAccountManagementClient
if not ns.resource_group_name:
account_name = ns.account_name
client = get_mgmt_service_client(cmd.cli_ctx, DataLakeAnalyticsAccountManagementClient).account
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/azure/cli/command_modules/dla/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# pylint: disable=too-many-statements
def load_command_table(self, _):

adla_format_path = 'azure.mgmt.datalake.analytics.{}.operations.{}#{}.{{}}'
adla_format_path = 'azure.cli.command_modules.dla.vendored_sdks.azure_mgmt_datalake_analytics.{}.operations.{}#{}.{{}}'

dla_account_sdk = CliCommandType(
operations_tmpl=adla_format_path.format('account', 'account_operations', 'AccountOperations'),
Expand Down
16 changes: 8 additions & 8 deletions src/azure-cli/azure/cli/command_modules/dla/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def list_adla_jobs(client, account_name, top=500, name=None, submitter=None, sub

def create_adla_account(cmd, client, resource_group_name, account_name, default_data_lake_store, location=None,
tags=None, max_degree_of_parallelism=30, max_job_count=3, query_store_retention=30, tier=None):
from azure.mgmt.datalake.analytics.account.models import DataLakeAnalyticsAccount, DataLakeStoreAccountInfo
from .vendored_sdks.azure_mgmt_datalake_analytics.account.models import DataLakeAnalyticsAccount, DataLakeStoreAccountInfo
adls_list = []
adls_list.append(DataLakeStoreAccountInfo(default_data_lake_store))
location = location or _get_resource_group_location(cmd.cli_ctx, resource_group_name)
Expand All @@ -85,7 +85,7 @@ def create_adla_account(cmd, client, resource_group_name, account_name, default_
def update_adla_account(client, account_name, resource_group_name, tags=None, max_degree_of_parallelism=None,
max_job_count=None, query_store_retention=None, tier=None, firewall_state=None,
allow_azure_ips=None):
from azure.mgmt.datalake.analytics.account.models import DataLakeAnalyticsAccountUpdateParameters
from .vendored_sdks.azure_mgmt_datalake_analytics.account.models import DataLakeAnalyticsAccountUpdateParameters
update_params = DataLakeAnalyticsAccountUpdateParameters(
tags=tags,
max_degree_of_parallelism=max_degree_of_parallelism,
Expand Down Expand Up @@ -120,7 +120,7 @@ def update_adla_blob_storage(client, account_name, storage_account_name, access_
# region firewall
def add_adla_firewall_rule(client, account_name, firewall_rule_name, start_ip_address, end_ip_address,
resource_group_name):
from azure.mgmt.datalake.analytics.account.models import FirewallRule
from .vendored_sdks.azure_mgmt_datalake_analytics.account.models import FirewallRule
create_params = FirewallRule(start_ip_address, end_ip_address)
return client.create_or_update(resource_group_name,
account_name,
Expand All @@ -132,7 +132,7 @@ def add_adla_firewall_rule(client, account_name, firewall_rule_name, start_ip_ad
# region compute policy
def create_adla_compute_policy(client, account_name, compute_policy_name, object_id, object_type,
resource_group_name, max_dop_per_job=None, min_priority_per_job=None):
from azure.mgmt.datalake.analytics.account.models import ComputePolicyCreateOrUpdateParameters
from .vendored_sdks.azure_mgmt_datalake_analytics.account.models import ComputePolicyCreateOrUpdateParameters
if not max_dop_per_job and not min_priority_per_job:
raise CLIError('Please specify at least one of --max-dop-per-job and --min-priority-per-job')

Expand Down Expand Up @@ -173,7 +173,7 @@ def update_adla_compute_policy(client, account_name, compute_policy_name, resour
# region catalog
def create_adla_catalog_credential(client, account_name, database_name, credential_name, credential_user_name, uri,
credential_user_password=None):
from azure.mgmt.datalake.analytics.catalog.models import DataLakeAnalyticsCatalogCredentialCreateParameters
from .vendored_sdks.azure_mgmt_datalake_analytics.catalog.models import DataLakeAnalyticsCatalogCredentialCreateParameters
if not credential_user_password:
try:
credential_user_password = prompt_pass('Password:', confirm=True)
Expand All @@ -189,7 +189,7 @@ def create_adla_catalog_credential(client, account_name, database_name, credenti

def update_adla_catalog_credential(client, account_name, database_name, credential_name, credential_user_name, uri,
credential_user_password=None, new_credential_user_password=None):
from azure.mgmt.datalake.analytics.catalog.models import DataLakeAnalyticsCatalogCredentialUpdateParameters
from .vendored_sdks.azure_mgmt_datalake_analytics.catalog.models import DataLakeAnalyticsCatalogCredentialUpdateParameters
if not credential_user_password:
try:
credential_user_password = prompt_pass('Current Password:', confirm=True)
Expand Down Expand Up @@ -252,7 +252,7 @@ def list_catalog_table_statistics(client, account_name, database_name, schema_na
def submit_adla_job(client, account_name, job_name, script, runtime_version=None, compile_mode=None, compile_only=False,
degree_of_parallelism=1, priority=1000, recurrence_id=None, recurrence_name=None, pipeline_id=None,
pipeline_name=None, pipeline_uri=None, run_id=None):
from azure.mgmt.datalake.analytics.job.models import (
from .vendored_sdks.azure_mgmt_datalake_analytics.job.models import (
JobType, CreateJobParameters, BuildJobParameters, CreateUSqlJobProperties, JobRelationshipProperties)

if not script:
Expand Down Expand Up @@ -292,7 +292,7 @@ def submit_adla_job(client, account_name, job_name, script, runtime_version=None


def wait_adla_job(client, account_name, job_id, wait_interval_sec=5, max_wait_time_sec=-1):
from azure.mgmt.datalake.analytics.job.models import JobState
from .vendored_sdks.azure_mgmt_datalake_analytics.job.models import JobState
if wait_interval_sec < 1:
raise CLIError('wait times must be greater than 0 when polling jobs. Value specified: {}'
.format(wait_interval_sec))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: skip-file
# flake8: noqa
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from .account import DataLakeAnalyticsAccountManagementClient
from .catalog import DataLakeAnalyticsCatalogManagementClient
from .job import DataLakeAnalyticsJobManagementClient

from .version import VERSION

__version__ = VERSION

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

from .data_lake_analytics_account_management_client import DataLakeAnalyticsAccountManagementClient
from .version import VERSION

__all__ = ['DataLakeAnalyticsAccountManagementClient']

__version__ = VERSION

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

from msrest.service_client import ServiceClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.compute_policies_operations import ComputePoliciesOperations
from .operations.firewall_rules_operations import FirewallRulesOperations
from .operations.storage_accounts_operations import StorageAccountsOperations
from .operations.data_lake_store_accounts_operations import DataLakeStoreAccountsOperations
from .operations.account_operations import AccountOperations
from . import models


class DataLakeAnalyticsAccountManagementClientConfiguration(AzureConfiguration):
"""Configuration for DataLakeAnalyticsAccountManagementClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Get subscription credentials which uniquely
identify Microsoft Azure subscription. The subscription ID forms part of
the URI for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not isinstance(subscription_id, str):
raise TypeError("Parameter 'subscription_id' must be str.")
if not base_url:
base_url = 'https://management.azure.com'

super(DataLakeAnalyticsAccountManagementClientConfiguration, self).__init__(base_url)

self.add_user_agent('datalakeanalyticsaccountmanagementclient/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id


class DataLakeAnalyticsAccountManagementClient(object):
"""Creates an Azure Data Lake Analytics account management client.

:ivar config: Configuration for client.
:vartype config: DataLakeAnalyticsAccountManagementClientConfiguration

:ivar compute_policies: ComputePolicies operations
:vartype compute_policies: azure.mgmt.datalake.analytics.account.operations.ComputePoliciesOperations
:ivar firewall_rules: FirewallRules operations
:vartype firewall_rules: azure.mgmt.datalake.analytics.account.operations.FirewallRulesOperations
:ivar storage_accounts: StorageAccounts operations
:vartype storage_accounts: azure.mgmt.datalake.analytics.account.operations.StorageAccountsOperations
:ivar data_lake_store_accounts: DataLakeStoreAccounts operations
:vartype data_lake_store_accounts: azure.mgmt.datalake.analytics.account.operations.DataLakeStoreAccountsOperations
:ivar account: Account operations
:vartype account: azure.mgmt.datalake.analytics.account.operations.AccountOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Get subscription credentials which uniquely
identify Microsoft Azure subscription. The subscription ID forms part of
the URI for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

self.config = DataLakeAnalyticsAccountManagementClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)

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

self.compute_policies = ComputePoliciesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.firewall_rules = FirewallRulesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.storage_accounts = StorageAccountsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.data_lake_store_accounts = DataLakeStoreAccountsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.account = AccountOperations(
self._client, self.config, self._serialize, self._deserialize)
Loading