From ae759184ae6a16c7e20ef076a0306dfe8cd0123b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 23 May 2018 05:34:31 +0000 Subject: [PATCH 1/2] Generated from 839446dd054ae837881ba5f11e54779782dde49d Update readme.md --- .../azure/mgmt/sql/models/__init__.py | 101 +++ .../backup_long_term_retention_policy_py3.py | 2 +- .../sql/models/data_masking_policy_py3.py | 2 +- .../mgmt/sql/models/data_masking_rule_py3.py | 2 +- .../models/database_automatic_tuning_py3.py | 2 +- .../database_blob_auditing_policy_py3.py | 2 +- .../mgmt/sql/models/database_operation_py3.py | 2 +- .../azure/mgmt/sql/models/database_py3.py | 2 +- .../database_security_alert_policy_py3.py | 2 +- .../database_vulnerability_assessment.py | 63 ++ .../database_vulnerability_assessment_py3.py | 63 ++ ..._vulnerability_assessment_rule_baseline.py | 50 ++ ...erability_assessment_rule_baseline_item.py | 35 + ...ility_assessment_rule_baseline_item_py3.py | 35 + ...nerability_assessment_rule_baseline_py3.py | 50 ++ ...e_vulnerability_assessment_scans_export.py | 48 ++ ...lnerability_assessment_scans_export_py3.py | 48 ++ .../sql/models/elastic_pool_activity_py3.py | 2 +- .../elastic_pool_database_activity_py3.py | 2 +- .../sql/models/elastic_pool_operation_py3.py | 2 +- .../azure/mgmt/sql/models/elastic_pool_py3.py | 2 +- .../sql/models/encryption_protector_py3.py | 2 +- .../mgmt/sql/models/failover_group_py3.py | 2 +- .../mgmt/sql/models/firewall_rule_py3.py | 2 +- .../mgmt/sql/models/geo_backup_policy_py3.py | 2 +- .../sql/models/import_export_response_py3.py | 2 +- .../mgmt/sql/models/import_request_py3.py | 2 +- .../sql/models/instance_failover_group_py3.py | 2 +- azure-mgmt-sql/azure/mgmt/sql/models/job.py | 56 ++ .../azure/mgmt/sql/models/job_agent.py | 67 ++ .../azure/mgmt/sql/models/job_agent_paged.py | 27 + .../azure/mgmt/sql/models/job_agent_py3.py | 67 ++ .../azure/mgmt/sql/models/job_agent_update.py | 28 + .../mgmt/sql/models/job_agent_update_py3.py | 28 + .../azure/mgmt/sql/models/job_credential.py | 55 ++ .../mgmt/sql/models/job_credential_paged.py | 27 + .../mgmt/sql/models/job_credential_py3.py | 55 ++ .../azure/mgmt/sql/models/job_execution.py | 113 ++++ .../mgmt/sql/models/job_execution_paged.py | 27 + .../mgmt/sql/models/job_execution_py3.py | 113 ++++ .../mgmt/sql/models/job_execution_target.py | 46 ++ .../sql/models/job_execution_target_py3.py | 46 ++ .../azure/mgmt/sql/models/job_paged.py | 27 + .../azure/mgmt/sql/models/job_py3.py | 56 ++ .../azure/mgmt/sql/models/job_schedule.py | 48 ++ .../azure/mgmt/sql/models/job_schedule_py3.py | 48 ++ .../azure/mgmt/sql/models/job_step.py | 75 +++ .../azure/mgmt/sql/models/job_step_action.py | 45 ++ .../mgmt/sql/models/job_step_action_py3.py | 45 ++ .../sql/models/job_step_execution_options.py | 49 ++ .../models/job_step_execution_options_py3.py | 49 ++ .../azure/mgmt/sql/models/job_step_output.py | 67 ++ .../mgmt/sql/models/job_step_output_py3.py | 67 ++ .../azure/mgmt/sql/models/job_step_paged.py | 27 + .../azure/mgmt/sql/models/job_step_py3.py | 75 +++ .../azure/mgmt/sql/models/job_target.py | 65 ++ .../azure/mgmt/sql/models/job_target_group.py | 49 ++ .../mgmt/sql/models/job_target_group_paged.py | 27 + .../mgmt/sql/models/job_target_group_py3.py | 49 ++ .../azure/mgmt/sql/models/job_target_py3.py | 65 ++ .../azure/mgmt/sql/models/job_version.py | 42 ++ .../mgmt/sql/models/job_version_paged.py | 27 + .../azure/mgmt/sql/models/job_version_py3.py | 42 ++ .../models/long_term_retention_backup_py3.py | 2 +- .../mgmt/sql/models/managed_database_py3.py | 2 +- .../mgmt/sql/models/managed_instance_py3.py | 2 +- .../mgmt/sql/models/proxy_resource_py3.py | 2 +- .../models/recommended_elastic_pool_py3.py | 2 +- .../mgmt/sql/models/recommended_index_py3.py | 2 +- .../sql/models/recoverable_database_py3.py | 2 +- .../mgmt/sql/models/replication_link_py3.py | 2 +- .../models/restorable_dropped_database_py3.py | 2 +- .../mgmt/sql/models/restore_point_py3.py | 2 +- .../sql/models/server_automatic_tuning_py3.py | 2 +- .../server_azure_ad_administrator_py3.py | 2 +- .../models/server_communication_link_py3.py | 2 +- .../models/server_connection_policy_py3.py | 2 +- .../mgmt/sql/models/server_dns_alias_py3.py | 2 +- .../azure/mgmt/sql/models/server_key_py3.py | 2 +- .../azure/mgmt/sql/models/server_py3.py | 2 +- .../mgmt/sql/models/service_objective_py3.py | 2 +- .../sql/models/service_tier_advisor_py3.py | 2 +- .../models/short_term_retention_policy_py3.py | 2 +- .../sql/models/sql_management_client_enums.py | 82 +++ .../mgmt/sql/models/subscription_usage_py3.py | 2 +- .../models/sync_agent_linked_database_py3.py | 2 +- .../azure/mgmt/sql/models/sync_agent_py3.py | 2 +- .../azure/mgmt/sql/models/sync_group_py3.py | 2 +- .../azure/mgmt/sql/models/sync_member_py3.py | 2 +- .../mgmt/sql/models/tracked_resource_py3.py | 2 +- ...ransparent_data_encryption_activity_py3.py | 2 +- .../models/transparent_data_encryption_py3.py | 2 +- .../sql/models/virtual_network_rule_py3.py | 2 +- ...y_assessment_recurring_scans_properties.py | 39 ++ ...sessment_recurring_scans_properties_py3.py | 39 ++ .../vulnerability_assessment_scan_error.py | 40 ++ ...vulnerability_assessment_scan_error_py3.py | 40 ++ .../vulnerability_assessment_scan_record.py | 88 +++ ...nerability_assessment_scan_record_paged.py | 27 + ...ulnerability_assessment_scan_record_py3.py | 88 +++ .../azure/mgmt/sql/operations/__init__.py | 24 + ...ty_assessment_rule_baselines_operations.py | 266 ++++++++ ...lnerability_assessment_scans_operations.py | 361 +++++++++++ ...se_vulnerability_assessments_operations.py | 250 +++++++ .../sql/operations/job_agents_operations.py | 483 ++++++++++++++ .../operations/job_credentials_operations.py | 328 ++++++++++ .../operations/job_executions_operations.py | 612 ++++++++++++++++++ .../job_step_executions_operations.py | 229 +++++++ .../sql/operations/job_steps_operations.py | 495 ++++++++++++++ .../job_target_executions_operations.py | 350 ++++++++++ .../job_target_groups_operations.py | 326 ++++++++++ .../sql/operations/job_versions_operations.py | 190 ++++++ .../mgmt/sql/operations/jobs_operations.py | 327 ++++++++++ .../azure/mgmt/sql/sql_management_client.py | 60 ++ 114 files changed, 7084 insertions(+), 48 deletions(-) create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline_item.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline_item_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_scans_export.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_scans_export_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_agent.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_agent_paged.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_agent_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_credential.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_credential_paged.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_credential_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_execution.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_execution_paged.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_execution_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_paged.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_schedule.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_schedule_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_action.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_action_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_output.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_output_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_paged.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_target.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_target_group.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_paged.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_target_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_version.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_version_paged.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_version_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_recurring_scans_properties.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_recurring_scans_properties_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_error.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_error_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_record.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_record_paged.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_record_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessment_rule_baselines_operations.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessment_scans_operations.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessments_operations.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_agents_operations.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_credentials_operations.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_executions_operations.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_step_executions_operations.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_steps_operations.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_target_executions_operations.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_target_groups_operations.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_versions_operations.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/jobs_operations.py diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index a84dc982d5a2..f088c63870d9 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py @@ -81,6 +81,24 @@ from .sync_member_py3 import SyncMember from .subscription_usage_py3 import SubscriptionUsage from .virtual_network_rule_py3 import VirtualNetworkRule + from .database_vulnerability_assessment_rule_baseline_item_py3 import DatabaseVulnerabilityAssessmentRuleBaselineItem + from .database_vulnerability_assessment_rule_baseline_py3 import DatabaseVulnerabilityAssessmentRuleBaseline + from .vulnerability_assessment_recurring_scans_properties_py3 import VulnerabilityAssessmentRecurringScansProperties + from .database_vulnerability_assessment_py3 import DatabaseVulnerabilityAssessment + from .job_agent_py3 import JobAgent + from .job_agent_update_py3 import JobAgentUpdate + from .job_credential_py3 import JobCredential + from .job_execution_target_py3 import JobExecutionTarget + from .job_execution_py3 import JobExecution + from .job_schedule_py3 import JobSchedule + from .job_py3 import Job + from .job_step_action_py3 import JobStepAction + from .job_step_output_py3 import JobStepOutput + from .job_step_execution_options_py3 import JobStepExecutionOptions + from .job_step_py3 import JobStep + from .job_target_py3 import JobTarget + from .job_target_group_py3 import JobTargetGroup + from .job_version_py3 import JobVersion from .long_term_retention_backup_py3 import LongTermRetentionBackup from .backup_long_term_retention_policy_py3 import BackupLongTermRetentionPolicy from .complete_database_restore_definition_py3 import CompleteDatabaseRestoreDefinition @@ -117,6 +135,9 @@ from .elastic_pool_per_database_settings_py3 import ElasticPoolPerDatabaseSettings from .elastic_pool_py3 import ElasticPool from .elastic_pool_update_py3 import ElasticPoolUpdate + from .vulnerability_assessment_scan_error_py3 import VulnerabilityAssessmentScanError + from .vulnerability_assessment_scan_record_py3 import VulnerabilityAssessmentScanRecord + from .database_vulnerability_assessment_scans_export_py3 import DatabaseVulnerabilityAssessmentScansExport from .instance_failover_group_read_write_endpoint_py3 import InstanceFailoverGroupReadWriteEndpoint from .instance_failover_group_read_only_endpoint_py3 import InstanceFailoverGroupReadOnlyEndpoint from .partner_region_info_py3 import PartnerRegionInfo @@ -195,6 +216,24 @@ from .sync_member import SyncMember from .subscription_usage import SubscriptionUsage from .virtual_network_rule import VirtualNetworkRule + from .database_vulnerability_assessment_rule_baseline_item import DatabaseVulnerabilityAssessmentRuleBaselineItem + from .database_vulnerability_assessment_rule_baseline import DatabaseVulnerabilityAssessmentRuleBaseline + from .vulnerability_assessment_recurring_scans_properties import VulnerabilityAssessmentRecurringScansProperties + from .database_vulnerability_assessment import DatabaseVulnerabilityAssessment + from .job_agent import JobAgent + from .job_agent_update import JobAgentUpdate + from .job_credential import JobCredential + from .job_execution_target import JobExecutionTarget + from .job_execution import JobExecution + from .job_schedule import JobSchedule + from .job import Job + from .job_step_action import JobStepAction + from .job_step_output import JobStepOutput + from .job_step_execution_options import JobStepExecutionOptions + from .job_step import JobStep + from .job_target import JobTarget + from .job_target_group import JobTargetGroup + from .job_version import JobVersion from .long_term_retention_backup import LongTermRetentionBackup from .backup_long_term_retention_policy import BackupLongTermRetentionPolicy from .complete_database_restore_definition import CompleteDatabaseRestoreDefinition @@ -231,6 +270,9 @@ from .elastic_pool_per_database_settings import ElasticPoolPerDatabaseSettings from .elastic_pool import ElasticPool from .elastic_pool_update import ElasticPoolUpdate + from .vulnerability_assessment_scan_error import VulnerabilityAssessmentScanError + from .vulnerability_assessment_scan_record import VulnerabilityAssessmentScanRecord + from .database_vulnerability_assessment_scans_export import DatabaseVulnerabilityAssessmentScansExport from .instance_failover_group_read_write_endpoint import InstanceFailoverGroupReadWriteEndpoint from .instance_failover_group_read_only_endpoint import InstanceFailoverGroupReadOnlyEndpoint from .partner_region_info import PartnerRegionInfo @@ -273,12 +315,20 @@ from .sync_member_paged import SyncMemberPaged from .subscription_usage_paged import SubscriptionUsagePaged from .virtual_network_rule_paged import VirtualNetworkRulePaged +from .job_agent_paged import JobAgentPaged +from .job_credential_paged import JobCredentialPaged +from .job_execution_paged import JobExecutionPaged +from .job_paged import JobPaged +from .job_step_paged import JobStepPaged +from .job_target_group_paged import JobTargetGroupPaged +from .job_version_paged import JobVersionPaged from .long_term_retention_backup_paged import LongTermRetentionBackupPaged from .managed_database_paged import ManagedDatabasePaged from .server_dns_alias_paged import ServerDnsAliasPaged from .restore_point_paged import RestorePointPaged from .database_operation_paged import DatabaseOperationPaged from .elastic_pool_operation_paged import ElasticPoolOperationPaged +from .vulnerability_assessment_scan_record_paged import VulnerabilityAssessmentScanRecordPaged from .instance_failover_group_paged import InstanceFailoverGroupPaged from .sql_management_client_enums import ( CheckNameAvailabilityReason, @@ -324,6 +374,15 @@ SyncDirection, SyncMemberState, VirtualNetworkRuleState, + JobAgentState, + JobExecutionLifecycle, + ProvisioningState, + JobTargetType, + JobScheduleType, + JobStepActionType, + JobStepActionSource, + JobStepOutputType, + JobTargetGroupMembershipType, ManagedDatabaseStatus, CatalogCollationType, ManagedDatabaseCreateMode, @@ -342,6 +401,8 @@ DatabaseReadScale, ElasticPoolState, ElasticPoolLicenseType, + VulnerabilityAssessmentScanTriggerType, + VulnerabilityAssessmentScanState, InstanceFailoverGroupReplicationRole, LongTermRetentionDatabaseState, CapabilityGroup, @@ -419,6 +480,24 @@ 'SyncMember', 'SubscriptionUsage', 'VirtualNetworkRule', + 'DatabaseVulnerabilityAssessmentRuleBaselineItem', + 'DatabaseVulnerabilityAssessmentRuleBaseline', + 'VulnerabilityAssessmentRecurringScansProperties', + 'DatabaseVulnerabilityAssessment', + 'JobAgent', + 'JobAgentUpdate', + 'JobCredential', + 'JobExecutionTarget', + 'JobExecution', + 'JobSchedule', + 'Job', + 'JobStepAction', + 'JobStepOutput', + 'JobStepExecutionOptions', + 'JobStep', + 'JobTarget', + 'JobTargetGroup', + 'JobVersion', 'LongTermRetentionBackup', 'BackupLongTermRetentionPolicy', 'CompleteDatabaseRestoreDefinition', @@ -455,6 +534,9 @@ 'ElasticPoolPerDatabaseSettings', 'ElasticPool', 'ElasticPoolUpdate', + 'VulnerabilityAssessmentScanError', + 'VulnerabilityAssessmentScanRecord', + 'DatabaseVulnerabilityAssessmentScansExport', 'InstanceFailoverGroupReadWriteEndpoint', 'InstanceFailoverGroupReadOnlyEndpoint', 'PartnerRegionInfo', @@ -497,12 +579,20 @@ 'SyncMemberPaged', 'SubscriptionUsagePaged', 'VirtualNetworkRulePaged', + 'JobAgentPaged', + 'JobCredentialPaged', + 'JobExecutionPaged', + 'JobPaged', + 'JobStepPaged', + 'JobTargetGroupPaged', + 'JobVersionPaged', 'LongTermRetentionBackupPaged', 'ManagedDatabasePaged', 'ServerDnsAliasPaged', 'RestorePointPaged', 'DatabaseOperationPaged', 'ElasticPoolOperationPaged', + 'VulnerabilityAssessmentScanRecordPaged', 'InstanceFailoverGroupPaged', 'CheckNameAvailabilityReason', 'ServerConnectionType', @@ -547,6 +637,15 @@ 'SyncDirection', 'SyncMemberState', 'VirtualNetworkRuleState', + 'JobAgentState', + 'JobExecutionLifecycle', + 'ProvisioningState', + 'JobTargetType', + 'JobScheduleType', + 'JobStepActionType', + 'JobStepActionSource', + 'JobStepOutputType', + 'JobTargetGroupMembershipType', 'ManagedDatabaseStatus', 'CatalogCollationType', 'ManagedDatabaseCreateMode', @@ -565,6 +664,8 @@ 'DatabaseReadScale', 'ElasticPoolState', 'ElasticPoolLicenseType', + 'VulnerabilityAssessmentScanTriggerType', + 'VulnerabilityAssessmentScanState', 'InstanceFailoverGroupReplicationRole', 'LongTermRetentionDatabaseState', 'CapabilityGroup', diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/backup_long_term_retention_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/backup_long_term_retention_policy_py3.py index 1e740145e464..b075dac8562d 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/backup_long_term_retention_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/backup_long_term_retention_policy_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class BackupLongTermRetentionPolicy(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_policy_py3.py index 6c601254aa8b..c2227aeb60da 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_policy_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class DataMaskingPolicy(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_rule_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_rule_py3.py index e576d5643c02..775fd78a2d6b 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_rule_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_rule_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class DataMaskingRule(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_automatic_tuning_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_automatic_tuning_py3.py index ff274ebc8969..86bb068ce54f 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/database_automatic_tuning_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_automatic_tuning_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class DatabaseAutomaticTuning(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy_py3.py index d2dccefb38d9..bfc95370f0fc 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class DatabaseBlobAuditingPolicy(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_operation_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_operation_py3.py index 51f5690a2308..66fb0bb0c602 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/database_operation_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_operation_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class DatabaseOperation(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_py3.py index 29a2f6613d41..d8292104953f 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/database_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .tracked_resource import TrackedResource +from .tracked_resource_py3 import TrackedResource class Database(TrackedResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_security_alert_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_security_alert_policy_py3.py index 85b31a408282..8967d6a6e0f1 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/database_security_alert_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_security_alert_policy_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class DatabaseSecurityAlertPolicy(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment.py new file mode 100644 index 000000000000..a7e5921902ad --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment.py @@ -0,0 +1,63 @@ +# 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 .proxy_resource import ProxyResource + + +class DatabaseVulnerabilityAssessment(ProxyResource): + """A database vulnerability assessment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param storage_container_path: Required. A blob storage container path to + hold the scan results (e.g. + https://myStorage.blob.core.windows.net/VaScans/). + :type storage_container_path: str + :param storage_container_sas_key: Required. A shared access signature (SAS + Key) that has write access to the blob container specified in + 'storageContainerPath' parameter. + :type storage_container_sas_key: str + :param recurring_scans: The recurring scans settings + :type recurring_scans: + ~azure.mgmt.sql.models.VulnerabilityAssessmentRecurringScansProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'storage_container_path': {'required': True}, + 'storage_container_sas_key': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'storage_container_path': {'key': 'properties.storageContainerPath', 'type': 'str'}, + 'storage_container_sas_key': {'key': 'properties.storageContainerSasKey', 'type': 'str'}, + 'recurring_scans': {'key': 'properties.recurringScans', 'type': 'VulnerabilityAssessmentRecurringScansProperties'}, + } + + def __init__(self, **kwargs): + super(DatabaseVulnerabilityAssessment, self).__init__(**kwargs) + self.storage_container_path = kwargs.get('storage_container_path', None) + self.storage_container_sas_key = kwargs.get('storage_container_sas_key', None) + self.recurring_scans = kwargs.get('recurring_scans', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_py3.py new file mode 100644 index 000000000000..2dff8336ef3f --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_py3.py @@ -0,0 +1,63 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class DatabaseVulnerabilityAssessment(ProxyResource): + """A database vulnerability assessment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param storage_container_path: Required. A blob storage container path to + hold the scan results (e.g. + https://myStorage.blob.core.windows.net/VaScans/). + :type storage_container_path: str + :param storage_container_sas_key: Required. A shared access signature (SAS + Key) that has write access to the blob container specified in + 'storageContainerPath' parameter. + :type storage_container_sas_key: str + :param recurring_scans: The recurring scans settings + :type recurring_scans: + ~azure.mgmt.sql.models.VulnerabilityAssessmentRecurringScansProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'storage_container_path': {'required': True}, + 'storage_container_sas_key': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'storage_container_path': {'key': 'properties.storageContainerPath', 'type': 'str'}, + 'storage_container_sas_key': {'key': 'properties.storageContainerSasKey', 'type': 'str'}, + 'recurring_scans': {'key': 'properties.recurringScans', 'type': 'VulnerabilityAssessmentRecurringScansProperties'}, + } + + def __init__(self, *, storage_container_path: str, storage_container_sas_key: str, recurring_scans=None, **kwargs) -> None: + super(DatabaseVulnerabilityAssessment, self).__init__(**kwargs) + self.storage_container_path = storage_container_path + self.storage_container_sas_key = storage_container_sas_key + self.recurring_scans = recurring_scans diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline.py new file mode 100644 index 000000000000..66881dfb9b5c --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline.py @@ -0,0 +1,50 @@ +# 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 .proxy_resource import ProxyResource + + +class DatabaseVulnerabilityAssessmentRuleBaseline(ProxyResource): + """A database vulnerability assessment rule baseline. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param baseline_results: Required. The rule baseline result + :type baseline_results: + list[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaselineItem] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'baseline_results': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'baseline_results': {'key': 'properties.baselineResults', 'type': '[DatabaseVulnerabilityAssessmentRuleBaselineItem]'}, + } + + def __init__(self, **kwargs): + super(DatabaseVulnerabilityAssessmentRuleBaseline, self).__init__(**kwargs) + self.baseline_results = kwargs.get('baseline_results', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline_item.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline_item.py new file mode 100644 index 000000000000..4bd7d0e16f52 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline_item.py @@ -0,0 +1,35 @@ +# 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.serialization import Model + + +class DatabaseVulnerabilityAssessmentRuleBaselineItem(Model): + """Properties for an Azure SQL Database Vulnerability Assessment rule + baseline's result. + + All required parameters must be populated in order to send to Azure. + + :param result: Required. The rule baseline result + :type result: list[str] + """ + + _validation = { + 'result': {'required': True}, + } + + _attribute_map = { + 'result': {'key': 'result', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(DatabaseVulnerabilityAssessmentRuleBaselineItem, self).__init__(**kwargs) + self.result = kwargs.get('result', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline_item_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline_item_py3.py new file mode 100644 index 000000000000..9378a89cc0f0 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline_item_py3.py @@ -0,0 +1,35 @@ +# 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.serialization import Model + + +class DatabaseVulnerabilityAssessmentRuleBaselineItem(Model): + """Properties for an Azure SQL Database Vulnerability Assessment rule + baseline's result. + + All required parameters must be populated in order to send to Azure. + + :param result: Required. The rule baseline result + :type result: list[str] + """ + + _validation = { + 'result': {'required': True}, + } + + _attribute_map = { + 'result': {'key': 'result', 'type': '[str]'}, + } + + def __init__(self, *, result, **kwargs) -> None: + super(DatabaseVulnerabilityAssessmentRuleBaselineItem, self).__init__(**kwargs) + self.result = result diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline_py3.py new file mode 100644 index 000000000000..4997c258c475 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_rule_baseline_py3.py @@ -0,0 +1,50 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class DatabaseVulnerabilityAssessmentRuleBaseline(ProxyResource): + """A database vulnerability assessment rule baseline. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param baseline_results: Required. The rule baseline result + :type baseline_results: + list[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaselineItem] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'baseline_results': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'baseline_results': {'key': 'properties.baselineResults', 'type': '[DatabaseVulnerabilityAssessmentRuleBaselineItem]'}, + } + + def __init__(self, *, baseline_results, **kwargs) -> None: + super(DatabaseVulnerabilityAssessmentRuleBaseline, self).__init__(**kwargs) + self.baseline_results = baseline_results diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_scans_export.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_scans_export.py new file mode 100644 index 000000000000..4d088fd265c0 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_scans_export.py @@ -0,0 +1,48 @@ +# 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 .proxy_resource import ProxyResource + + +class DatabaseVulnerabilityAssessmentScansExport(ProxyResource): + """A database Vulnerability Assessment scan export resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar exported_report_location: Location of the exported report (e.g. + https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx). + :vartype exported_report_location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'exported_report_location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'exported_report_location': {'key': 'properties.exportedReportLocation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DatabaseVulnerabilityAssessmentScansExport, self).__init__(**kwargs) + self.exported_report_location = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_scans_export_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_scans_export_py3.py new file mode 100644 index 000000000000..7e925fb428ce --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_vulnerability_assessment_scans_export_py3.py @@ -0,0 +1,48 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class DatabaseVulnerabilityAssessmentScansExport(ProxyResource): + """A database Vulnerability Assessment scan export resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar exported_report_location: Location of the exported report (e.g. + https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx). + :vartype exported_report_location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'exported_report_location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'exported_report_location': {'key': 'properties.exportedReportLocation', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DatabaseVulnerabilityAssessmentScansExport, self).__init__(**kwargs) + self.exported_report_location = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_activity_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_activity_py3.py index 71f4b850d657..5d8d4f61727a 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_activity_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_activity_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class ElasticPoolActivity(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_database_activity_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_database_activity_py3.py index d650605d6e4c..2e2818eee69a 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_database_activity_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_database_activity_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class ElasticPoolDatabaseActivity(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_operation_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_operation_py3.py index 13add58062c7..c214b66532a5 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_operation_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_operation_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class ElasticPoolOperation(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_py3.py index 48fb5ad5412c..4a925d9ec66d 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .tracked_resource import TrackedResource +from .tracked_resource_py3 import TrackedResource class ElasticPool(TrackedResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/encryption_protector_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/encryption_protector_py3.py index 33e6c18db636..6dd4bad3cfbe 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/encryption_protector_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/encryption_protector_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class EncryptionProtector(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/failover_group_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/failover_group_py3.py index fdc42b2246c3..4b179cf5b45f 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/failover_group_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/failover_group_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class FailoverGroup(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/firewall_rule_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/firewall_rule_py3.py index c218f1eaebae..c292730d9653 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/firewall_rule_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/firewall_rule_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class FirewallRule(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/geo_backup_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/geo_backup_policy_py3.py index 12c801a92091..23941df5ee47 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/geo_backup_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/geo_backup_policy_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class GeoBackupPolicy(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/import_export_response_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/import_export_response_py3.py index 8603208ee044..a344fc99266b 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/import_export_response_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/import_export_response_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class ImportExportResponse(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/import_request_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/import_request_py3.py index 55f29f4735d0..68b97ae814a3 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/import_request_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/import_request_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .export_request import ExportRequest +from .export_request_py3 import ExportRequest class ImportRequest(ExportRequest): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_py3.py index 885fd2a8d52e..8959f26c9f69 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class InstanceFailoverGroup(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job.py b/azure-mgmt-sql/azure/mgmt/sql/models/job.py new file mode 100644 index 000000000000..6b2c60fd1d4b --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job.py @@ -0,0 +1,56 @@ +# 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 .proxy_resource import ProxyResource + + +class Job(ProxyResource): + """A job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param description: User-defined description of the job. Default value: "" + . + :type description: str + :ivar version: The job version number. + :vartype version: int + :param schedule: Schedule properties of the job. + :type schedule: ~azure.mgmt.sql.models.JobSchedule + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'int'}, + 'schedule': {'key': 'properties.schedule', 'type': 'JobSchedule'}, + } + + def __init__(self, **kwargs): + super(Job, self).__init__(**kwargs) + self.description = kwargs.get('description', "") + self.version = None + self.schedule = kwargs.get('schedule', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_agent.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_agent.py new file mode 100644 index 000000000000..3cb0df4642c4 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_agent.py @@ -0,0 +1,67 @@ +# 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 .tracked_resource import TrackedResource + + +class JobAgent(TrackedResource): + """An Azure SQL job agent. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. Resource location. + :type location: str + :param sku: The name and tier of the SKU. + :type sku: ~azure.mgmt.sql.models.Sku + :param database_id: Required. Resource ID of the database to store job + metadata in. + :type database_id: str + :ivar state: The state of the job agent. Possible values include: + 'Creating', 'Ready', 'Updating', 'Deleting', 'Disabled' + :vartype state: str or ~azure.mgmt.sql.models.JobAgentState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'database_id': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'database_id': {'key': 'properties.databaseId', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobAgent, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.database_id = kwargs.get('database_id', None) + self.state = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_paged.py new file mode 100644 index 000000000000..25dd750b9d1f --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class JobAgentPaged(Paged): + """ + A paging container for iterating over a list of :class:`JobAgent ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[JobAgent]'} + } + + def __init__(self, *args, **kwargs): + + super(JobAgentPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_py3.py new file mode 100644 index 000000000000..4a2fa86da554 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_py3.py @@ -0,0 +1,67 @@ +# 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 .tracked_resource_py3 import TrackedResource + + +class JobAgent(TrackedResource): + """An Azure SQL job agent. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. Resource location. + :type location: str + :param sku: The name and tier of the SKU. + :type sku: ~azure.mgmt.sql.models.Sku + :param database_id: Required. Resource ID of the database to store job + metadata in. + :type database_id: str + :ivar state: The state of the job agent. Possible values include: + 'Creating', 'Ready', 'Updating', 'Deleting', 'Disabled' + :vartype state: str or ~azure.mgmt.sql.models.JobAgentState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'database_id': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'database_id': {'key': 'properties.databaseId', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, *, location: str, database_id: str, tags=None, sku=None, **kwargs) -> None: + super(JobAgent, self).__init__(tags=tags, location=location, **kwargs) + self.sku = sku + self.database_id = database_id + self.state = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update.py new file mode 100644 index 000000000000..af781de91cbf --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update.py @@ -0,0 +1,28 @@ +# 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.serialization import Model + + +class JobAgentUpdate(Model): + """An update to an Azure SQL job agent. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(JobAgentUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update_py3.py new file mode 100644 index 000000000000..ab5e71f7b1d1 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update_py3.py @@ -0,0 +1,28 @@ +# 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.serialization import Model + + +class JobAgentUpdate(Model): + """An update to an Azure SQL job agent. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(JobAgentUpdate, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_credential.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_credential.py new file mode 100644 index 000000000000..807d34975114 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_credential.py @@ -0,0 +1,55 @@ +# 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 .proxy_resource import ProxyResource + + +class JobCredential(ProxyResource): + """A stored credential that can be used by a job to connect to target + databases. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param username: Required. The credential user name. + :type username: str + :param password: Required. The credential password. + :type password: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'username': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'username': {'key': 'properties.username', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobCredential, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_credential_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_credential_paged.py new file mode 100644 index 000000000000..550108e41c93 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_credential_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class JobCredentialPaged(Paged): + """ + A paging container for iterating over a list of :class:`JobCredential ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[JobCredential]'} + } + + def __init__(self, *args, **kwargs): + + super(JobCredentialPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_credential_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_credential_py3.py new file mode 100644 index 000000000000..5158010b9c74 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_credential_py3.py @@ -0,0 +1,55 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class JobCredential(ProxyResource): + """A stored credential that can be used by a job to connect to target + databases. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param username: Required. The credential user name. + :type username: str + :param password: Required. The credential password. + :type password: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'username': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'username': {'key': 'properties.username', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + } + + def __init__(self, *, username: str, password: str, **kwargs) -> None: + super(JobCredential, self).__init__(**kwargs) + self.username = username + self.password = password diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_execution.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_execution.py new file mode 100644 index 000000000000..92744fb7c75b --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_execution.py @@ -0,0 +1,113 @@ +# 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 .proxy_resource import ProxyResource + + +class JobExecution(ProxyResource): + """An execution of a job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar job_version: The job version number. + :vartype job_version: int + :ivar step_name: The job step name. + :vartype step_name: str + :ivar step_id: The job step id. + :vartype step_id: int + :ivar job_execution_id: The unique identifier of the job execution. + :vartype job_execution_id: str + :ivar lifecycle: The detailed state of the job execution. Possible values + include: 'Created', 'InProgress', 'WaitingForChildJobExecutions', + 'WaitingForRetry', 'Succeeded', 'SucceededWithSkipped', 'Failed', + 'TimedOut', 'Canceled', 'Skipped' + :vartype lifecycle: str or ~azure.mgmt.sql.models.JobExecutionLifecycle + :ivar provisioning_state: The ARM provisioning state of the job execution. + Possible values include: 'Created', 'InProgress', 'Succeeded', 'Failed', + 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.sql.models.ProvisioningState + :ivar create_time: The time that the job execution was created. + :vartype create_time: datetime + :ivar start_time: The time that the job execution started. + :vartype start_time: datetime + :ivar end_time: The time that the job execution completed. + :vartype end_time: datetime + :param current_attempts: Number of times the job execution has been + attempted. + :type current_attempts: int + :ivar current_attempt_start_time: Start time of the current attempt. + :vartype current_attempt_start_time: datetime + :ivar last_message: The last status or error message. + :vartype last_message: str + :ivar target: The target that this execution is executed on. + :vartype target: ~azure.mgmt.sql.models.JobExecutionTarget + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'job_version': {'readonly': True}, + 'step_name': {'readonly': True}, + 'step_id': {'readonly': True}, + 'job_execution_id': {'readonly': True}, + 'lifecycle': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'create_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'current_attempt_start_time': {'readonly': True}, + 'last_message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'job_version': {'key': 'properties.jobVersion', 'type': 'int'}, + 'step_name': {'key': 'properties.stepName', 'type': 'str'}, + 'step_id': {'key': 'properties.stepId', 'type': 'int'}, + 'job_execution_id': {'key': 'properties.jobExecutionId', 'type': 'str'}, + 'lifecycle': {'key': 'properties.lifecycle', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'current_attempts': {'key': 'properties.currentAttempts', 'type': 'int'}, + 'current_attempt_start_time': {'key': 'properties.currentAttemptStartTime', 'type': 'iso-8601'}, + 'last_message': {'key': 'properties.lastMessage', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'JobExecutionTarget'}, + } + + def __init__(self, **kwargs): + super(JobExecution, self).__init__(**kwargs) + self.job_version = None + self.step_name = None + self.step_id = None + self.job_execution_id = None + self.lifecycle = None + self.provisioning_state = None + self.create_time = None + self.start_time = None + self.end_time = None + self.current_attempts = kwargs.get('current_attempts', None) + self.current_attempt_start_time = None + self.last_message = None + self.target = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_paged.py new file mode 100644 index 000000000000..bfcdb03ea9aa --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class JobExecutionPaged(Paged): + """ + A paging container for iterating over a list of :class:`JobExecution ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[JobExecution]'} + } + + def __init__(self, *args, **kwargs): + + super(JobExecutionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_py3.py new file mode 100644 index 000000000000..b7fdaba7c147 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_py3.py @@ -0,0 +1,113 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class JobExecution(ProxyResource): + """An execution of a job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar job_version: The job version number. + :vartype job_version: int + :ivar step_name: The job step name. + :vartype step_name: str + :ivar step_id: The job step id. + :vartype step_id: int + :ivar job_execution_id: The unique identifier of the job execution. + :vartype job_execution_id: str + :ivar lifecycle: The detailed state of the job execution. Possible values + include: 'Created', 'InProgress', 'WaitingForChildJobExecutions', + 'WaitingForRetry', 'Succeeded', 'SucceededWithSkipped', 'Failed', + 'TimedOut', 'Canceled', 'Skipped' + :vartype lifecycle: str or ~azure.mgmt.sql.models.JobExecutionLifecycle + :ivar provisioning_state: The ARM provisioning state of the job execution. + Possible values include: 'Created', 'InProgress', 'Succeeded', 'Failed', + 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.sql.models.ProvisioningState + :ivar create_time: The time that the job execution was created. + :vartype create_time: datetime + :ivar start_time: The time that the job execution started. + :vartype start_time: datetime + :ivar end_time: The time that the job execution completed. + :vartype end_time: datetime + :param current_attempts: Number of times the job execution has been + attempted. + :type current_attempts: int + :ivar current_attempt_start_time: Start time of the current attempt. + :vartype current_attempt_start_time: datetime + :ivar last_message: The last status or error message. + :vartype last_message: str + :ivar target: The target that this execution is executed on. + :vartype target: ~azure.mgmt.sql.models.JobExecutionTarget + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'job_version': {'readonly': True}, + 'step_name': {'readonly': True}, + 'step_id': {'readonly': True}, + 'job_execution_id': {'readonly': True}, + 'lifecycle': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'create_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'current_attempt_start_time': {'readonly': True}, + 'last_message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'job_version': {'key': 'properties.jobVersion', 'type': 'int'}, + 'step_name': {'key': 'properties.stepName', 'type': 'str'}, + 'step_id': {'key': 'properties.stepId', 'type': 'int'}, + 'job_execution_id': {'key': 'properties.jobExecutionId', 'type': 'str'}, + 'lifecycle': {'key': 'properties.lifecycle', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'current_attempts': {'key': 'properties.currentAttempts', 'type': 'int'}, + 'current_attempt_start_time': {'key': 'properties.currentAttemptStartTime', 'type': 'iso-8601'}, + 'last_message': {'key': 'properties.lastMessage', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'JobExecutionTarget'}, + } + + def __init__(self, *, current_attempts: int=None, **kwargs) -> None: + super(JobExecution, self).__init__(**kwargs) + self.job_version = None + self.step_name = None + self.step_id = None + self.job_execution_id = None + self.lifecycle = None + self.provisioning_state = None + self.create_time = None + self.start_time = None + self.end_time = None + self.current_attempts = current_attempts + self.current_attempt_start_time = None + self.last_message = None + self.target = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target.py new file mode 100644 index 000000000000..50557aaf96d0 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target.py @@ -0,0 +1,46 @@ +# 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.serialization import Model + + +class JobExecutionTarget(Model): + """The target that a job execution is executed on. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the target. Possible values include: + 'TargetGroup', 'SqlDatabase', 'SqlElasticPool', 'SqlShardMap', 'SqlServer' + :vartype type: str or ~azure.mgmt.sql.models.JobTargetType + :ivar server_name: The server name. + :vartype server_name: str + :ivar database_name: The database name. + :vartype database_name: str + """ + + _validation = { + 'type': {'readonly': True}, + 'server_name': {'readonly': True}, + 'database_name': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobExecutionTarget, self).__init__(**kwargs) + self.type = None + self.server_name = None + self.database_name = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target_py3.py new file mode 100644 index 000000000000..551716c3cd31 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target_py3.py @@ -0,0 +1,46 @@ +# 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.serialization import Model + + +class JobExecutionTarget(Model): + """The target that a job execution is executed on. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the target. Possible values include: + 'TargetGroup', 'SqlDatabase', 'SqlElasticPool', 'SqlShardMap', 'SqlServer' + :vartype type: str or ~azure.mgmt.sql.models.JobTargetType + :ivar server_name: The server name. + :vartype server_name: str + :ivar database_name: The database name. + :vartype database_name: str + """ + + _validation = { + 'type': {'readonly': True}, + 'server_name': {'readonly': True}, + 'database_name': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(JobExecutionTarget, self).__init__(**kwargs) + self.type = None + self.server_name = None + self.database_name = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_paged.py new file mode 100644 index 000000000000..3b85770570f2 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class JobPaged(Paged): + """ + A paging container for iterating over a list of :class:`Job ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Job]'} + } + + def __init__(self, *args, **kwargs): + + super(JobPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_py3.py new file mode 100644 index 000000000000..5bfb9b53f03f --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_py3.py @@ -0,0 +1,56 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class Job(ProxyResource): + """A job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param description: User-defined description of the job. Default value: "" + . + :type description: str + :ivar version: The job version number. + :vartype version: int + :param schedule: Schedule properties of the job. + :type schedule: ~azure.mgmt.sql.models.JobSchedule + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'version': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'int'}, + 'schedule': {'key': 'properties.schedule', 'type': 'JobSchedule'}, + } + + def __init__(self, *, description: str="", schedule=None, **kwargs) -> None: + super(Job, self).__init__(**kwargs) + self.description = description + self.version = None + self.schedule = schedule diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_schedule.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_schedule.py new file mode 100644 index 000000000000..7fab31ef7b8c --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_schedule.py @@ -0,0 +1,48 @@ +# 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.serialization import Model + + +class JobSchedule(Model): + """Scheduling properties of a job. + + :param start_time: Schedule start time. Default value: + "0001-01-01T00:00:00Z" . + :type start_time: datetime + :param end_time: Schedule end time. Default value: "9999-12-31T11:59:59Z" + . + :type end_time: datetime + :param type: Schedule interval type. Possible values include: 'Once', + 'Recurring'. Default value: "Once" . + :type type: str or ~azure.mgmt.sql.models.JobScheduleType + :param enabled: Whether or not the schedule is enabled. + :type enabled: bool + :param interval: Value of the schedule's recurring interval, if the + scheduletype is recurring. ISO8601 duration format. + :type interval: str + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'JobScheduleType'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'interval': {'key': 'interval', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobSchedule, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', "0001-01-01T00:00:00Z") + self.end_time = kwargs.get('end_time', "9999-12-31T11:59:59Z") + self.type = kwargs.get('type', "Once") + self.enabled = kwargs.get('enabled', None) + self.interval = kwargs.get('interval', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_schedule_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_schedule_py3.py new file mode 100644 index 000000000000..8c0cd37ebefe --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_schedule_py3.py @@ -0,0 +1,48 @@ +# 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.serialization import Model + + +class JobSchedule(Model): + """Scheduling properties of a job. + + :param start_time: Schedule start time. Default value: + "0001-01-01T00:00:00Z" . + :type start_time: datetime + :param end_time: Schedule end time. Default value: "9999-12-31T11:59:59Z" + . + :type end_time: datetime + :param type: Schedule interval type. Possible values include: 'Once', + 'Recurring'. Default value: "Once" . + :type type: str or ~azure.mgmt.sql.models.JobScheduleType + :param enabled: Whether or not the schedule is enabled. + :type enabled: bool + :param interval: Value of the schedule's recurring interval, if the + scheduletype is recurring. ISO8601 duration format. + :type interval: str + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'JobScheduleType'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'interval': {'key': 'interval', 'type': 'str'}, + } + + def __init__(self, *, start_time="0001-01-01T00:00:00Z", end_time="9999-12-31T11:59:59Z", type="Once", enabled: bool=None, interval: str=None, **kwargs) -> None: + super(JobSchedule, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.type = type + self.enabled = enabled + self.interval = interval diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step.py new file mode 100644 index 000000000000..f032375dec32 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_step.py @@ -0,0 +1,75 @@ +# 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 .proxy_resource import ProxyResource + + +class JobStep(ProxyResource): + """A job step. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param step_id: The job step's index within the job. If not specified when + creating the job step, it will be created as the last step. If not + specified when updating the job step, the step id is not modified. + :type step_id: int + :param target_group: Required. The resource ID of the target group that + the job step will be executed on. + :type target_group: str + :param credential: Required. The resource ID of the job credential that + will be used to connect to the targets. + :type credential: str + :param action: Required. The action payload of the job step. + :type action: ~azure.mgmt.sql.models.JobStepAction + :param output: Output destination properties of the job step. + :type output: ~azure.mgmt.sql.models.JobStepOutput + :param execution_options: Execution options for the job step. + :type execution_options: ~azure.mgmt.sql.models.JobStepExecutionOptions + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'target_group': {'required': True}, + 'credential': {'required': True}, + 'action': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'step_id': {'key': 'properties.stepId', 'type': 'int'}, + 'target_group': {'key': 'properties.targetGroup', 'type': 'str'}, + 'credential': {'key': 'properties.credential', 'type': 'str'}, + 'action': {'key': 'properties.action', 'type': 'JobStepAction'}, + 'output': {'key': 'properties.output', 'type': 'JobStepOutput'}, + 'execution_options': {'key': 'properties.executionOptions', 'type': 'JobStepExecutionOptions'}, + } + + def __init__(self, **kwargs): + super(JobStep, self).__init__(**kwargs) + self.step_id = kwargs.get('step_id', None) + self.target_group = kwargs.get('target_group', None) + self.credential = kwargs.get('credential', None) + self.action = kwargs.get('action', None) + self.output = kwargs.get('output', None) + self.execution_options = kwargs.get('execution_options', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_action.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_action.py new file mode 100644 index 000000000000..68e55b1fa38f --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_action.py @@ -0,0 +1,45 @@ +# 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.serialization import Model + + +class JobStepAction(Model): + """The action to be executed by a job step. + + All required parameters must be populated in order to send to Azure. + + :param type: Type of action being executed by the job step. Possible + values include: 'TSql'. Default value: "TSql" . + :type type: str or ~azure.mgmt.sql.models.JobStepActionType + :param source: The source of the action to execute. Possible values + include: 'Inline'. Default value: "Inline" . + :type source: str or ~azure.mgmt.sql.models.JobStepActionSource + :param value: Required. The action value, for example the text of the + T-SQL script to execute. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobStepAction, self).__init__(**kwargs) + self.type = kwargs.get('type', "TSql") + self.source = kwargs.get('source', "Inline") + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_action_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_action_py3.py new file mode 100644 index 000000000000..4d8848c8eaef --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_action_py3.py @@ -0,0 +1,45 @@ +# 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.serialization import Model + + +class JobStepAction(Model): + """The action to be executed by a job step. + + All required parameters must be populated in order to send to Azure. + + :param type: Type of action being executed by the job step. Possible + values include: 'TSql'. Default value: "TSql" . + :type type: str or ~azure.mgmt.sql.models.JobStepActionType + :param source: The source of the action to execute. Possible values + include: 'Inline'. Default value: "Inline" . + :type source: str or ~azure.mgmt.sql.models.JobStepActionSource + :param value: Required. The action value, for example the text of the + T-SQL script to execute. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str, type="TSql", source="Inline", **kwargs) -> None: + super(JobStepAction, self).__init__(**kwargs) + self.type = type + self.source = source + self.value = value diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options.py new file mode 100644 index 000000000000..6a49f1d10f25 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options.py @@ -0,0 +1,49 @@ +# 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.serialization import Model + + +class JobStepExecutionOptions(Model): + """The execution options of a job step. + + :param timeout_seconds: Execution timeout for the job step. Default value: + 43200 . + :type timeout_seconds: int + :param retry_attempts: Maximum number of times the job step will be + reattempted if the first attempt fails. Default value: 10 . + :type retry_attempts: int + :param initial_retry_interval_seconds: Initial delay between retries for + job step execution. Default value: 1 . + :type initial_retry_interval_seconds: int + :param maximum_retry_interval_seconds: The maximum amount of time to wait + between retries for job step execution. Default value: 120 . + :type maximum_retry_interval_seconds: int + :param retry_interval_backoff_multiplier: The backoff multiplier for the + time between retries. Default value: 2 . + :type retry_interval_backoff_multiplier: float + """ + + _attribute_map = { + 'timeout_seconds': {'key': 'timeoutSeconds', 'type': 'int'}, + 'retry_attempts': {'key': 'retryAttempts', 'type': 'int'}, + 'initial_retry_interval_seconds': {'key': 'initialRetryIntervalSeconds', 'type': 'int'}, + 'maximum_retry_interval_seconds': {'key': 'maximumRetryIntervalSeconds', 'type': 'int'}, + 'retry_interval_backoff_multiplier': {'key': 'retryIntervalBackoffMultiplier', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(JobStepExecutionOptions, self).__init__(**kwargs) + self.timeout_seconds = kwargs.get('timeout_seconds', 43200) + self.retry_attempts = kwargs.get('retry_attempts', 10) + self.initial_retry_interval_seconds = kwargs.get('initial_retry_interval_seconds', 1) + self.maximum_retry_interval_seconds = kwargs.get('maximum_retry_interval_seconds', 120) + self.retry_interval_backoff_multiplier = kwargs.get('retry_interval_backoff_multiplier', 2) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options_py3.py new file mode 100644 index 000000000000..712f0e947436 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options_py3.py @@ -0,0 +1,49 @@ +# 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.serialization import Model + + +class JobStepExecutionOptions(Model): + """The execution options of a job step. + + :param timeout_seconds: Execution timeout for the job step. Default value: + 43200 . + :type timeout_seconds: int + :param retry_attempts: Maximum number of times the job step will be + reattempted if the first attempt fails. Default value: 10 . + :type retry_attempts: int + :param initial_retry_interval_seconds: Initial delay between retries for + job step execution. Default value: 1 . + :type initial_retry_interval_seconds: int + :param maximum_retry_interval_seconds: The maximum amount of time to wait + between retries for job step execution. Default value: 120 . + :type maximum_retry_interval_seconds: int + :param retry_interval_backoff_multiplier: The backoff multiplier for the + time between retries. Default value: 2 . + :type retry_interval_backoff_multiplier: float + """ + + _attribute_map = { + 'timeout_seconds': {'key': 'timeoutSeconds', 'type': 'int'}, + 'retry_attempts': {'key': 'retryAttempts', 'type': 'int'}, + 'initial_retry_interval_seconds': {'key': 'initialRetryIntervalSeconds', 'type': 'int'}, + 'maximum_retry_interval_seconds': {'key': 'maximumRetryIntervalSeconds', 'type': 'int'}, + 'retry_interval_backoff_multiplier': {'key': 'retryIntervalBackoffMultiplier', 'type': 'float'}, + } + + def __init__(self, *, timeout_seconds: int=43200, retry_attempts: int=10, initial_retry_interval_seconds: int=1, maximum_retry_interval_seconds: int=120, retry_interval_backoff_multiplier: float=2, **kwargs) -> None: + super(JobStepExecutionOptions, self).__init__(**kwargs) + self.timeout_seconds = timeout_seconds + self.retry_attempts = retry_attempts + self.initial_retry_interval_seconds = initial_retry_interval_seconds + self.maximum_retry_interval_seconds = maximum_retry_interval_seconds + self.retry_interval_backoff_multiplier = retry_interval_backoff_multiplier diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_output.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_output.py new file mode 100644 index 000000000000..8a015a7505bd --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_output.py @@ -0,0 +1,67 @@ +# 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.serialization import Model + + +class JobStepOutput(Model): + """The output configuration of a job step. + + All required parameters must be populated in order to send to Azure. + + :param type: The output destination type. Possible values include: + 'SqlDatabase'. Default value: "SqlDatabase" . + :type type: str or ~azure.mgmt.sql.models.JobStepOutputType + :param subscription_id: The output destination subscription id. + :type subscription_id: str + :param resource_group_name: The output destination resource group. + :type resource_group_name: str + :param server_name: Required. The output destination server name. + :type server_name: str + :param database_name: Required. The output destination database. + :type database_name: str + :param schema_name: The output destination schema. Default value: "dbo" . + :type schema_name: str + :param table_name: Required. The output destination table. + :type table_name: str + :param credential: Required. The resource ID of the credential to use to + connect to the output destination. + :type credential: str + """ + + _validation = { + 'server_name': {'required': True}, + 'database_name': {'required': True}, + 'table_name': {'required': True}, + 'credential': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + 'schema_name': {'key': 'schemaName', 'type': 'str'}, + 'table_name': {'key': 'tableName', 'type': 'str'}, + 'credential': {'key': 'credential', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobStepOutput, self).__init__(**kwargs) + self.type = kwargs.get('type', "SqlDatabase") + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group_name = kwargs.get('resource_group_name', None) + self.server_name = kwargs.get('server_name', None) + self.database_name = kwargs.get('database_name', None) + self.schema_name = kwargs.get('schema_name', "dbo") + self.table_name = kwargs.get('table_name', None) + self.credential = kwargs.get('credential', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_output_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_output_py3.py new file mode 100644 index 000000000000..d10ecbbd6f8c --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_output_py3.py @@ -0,0 +1,67 @@ +# 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.serialization import Model + + +class JobStepOutput(Model): + """The output configuration of a job step. + + All required parameters must be populated in order to send to Azure. + + :param type: The output destination type. Possible values include: + 'SqlDatabase'. Default value: "SqlDatabase" . + :type type: str or ~azure.mgmt.sql.models.JobStepOutputType + :param subscription_id: The output destination subscription id. + :type subscription_id: str + :param resource_group_name: The output destination resource group. + :type resource_group_name: str + :param server_name: Required. The output destination server name. + :type server_name: str + :param database_name: Required. The output destination database. + :type database_name: str + :param schema_name: The output destination schema. Default value: "dbo" . + :type schema_name: str + :param table_name: Required. The output destination table. + :type table_name: str + :param credential: Required. The resource ID of the credential to use to + connect to the output destination. + :type credential: str + """ + + _validation = { + 'server_name': {'required': True}, + 'database_name': {'required': True}, + 'table_name': {'required': True}, + 'credential': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + 'schema_name': {'key': 'schemaName', 'type': 'str'}, + 'table_name': {'key': 'tableName', 'type': 'str'}, + 'credential': {'key': 'credential', 'type': 'str'}, + } + + def __init__(self, *, server_name: str, database_name: str, table_name: str, credential: str, type="SqlDatabase", subscription_id: str=None, resource_group_name: str=None, schema_name: str="dbo", **kwargs) -> None: + super(JobStepOutput, self).__init__(**kwargs) + self.type = type + self.subscription_id = subscription_id + self.resource_group_name = resource_group_name + self.server_name = server_name + self.database_name = database_name + self.schema_name = schema_name + self.table_name = table_name + self.credential = credential diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_paged.py new file mode 100644 index 000000000000..1bda4f5adf6e --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class JobStepPaged(Paged): + """ + A paging container for iterating over a list of :class:`JobStep ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[JobStep]'} + } + + def __init__(self, *args, **kwargs): + + super(JobStepPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_py3.py new file mode 100644 index 000000000000..bd267f9fd9a6 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_py3.py @@ -0,0 +1,75 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class JobStep(ProxyResource): + """A job step. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param step_id: The job step's index within the job. If not specified when + creating the job step, it will be created as the last step. If not + specified when updating the job step, the step id is not modified. + :type step_id: int + :param target_group: Required. The resource ID of the target group that + the job step will be executed on. + :type target_group: str + :param credential: Required. The resource ID of the job credential that + will be used to connect to the targets. + :type credential: str + :param action: Required. The action payload of the job step. + :type action: ~azure.mgmt.sql.models.JobStepAction + :param output: Output destination properties of the job step. + :type output: ~azure.mgmt.sql.models.JobStepOutput + :param execution_options: Execution options for the job step. + :type execution_options: ~azure.mgmt.sql.models.JobStepExecutionOptions + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'target_group': {'required': True}, + 'credential': {'required': True}, + 'action': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'step_id': {'key': 'properties.stepId', 'type': 'int'}, + 'target_group': {'key': 'properties.targetGroup', 'type': 'str'}, + 'credential': {'key': 'properties.credential', 'type': 'str'}, + 'action': {'key': 'properties.action', 'type': 'JobStepAction'}, + 'output': {'key': 'properties.output', 'type': 'JobStepOutput'}, + 'execution_options': {'key': 'properties.executionOptions', 'type': 'JobStepExecutionOptions'}, + } + + def __init__(self, *, target_group: str, credential: str, action, step_id: int=None, output=None, execution_options=None, **kwargs) -> None: + super(JobStep, self).__init__(**kwargs) + self.step_id = step_id + self.target_group = target_group + self.credential = credential + self.action = action + self.output = output + self.execution_options = execution_options diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_target.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_target.py new file mode 100644 index 000000000000..a608d87c1af1 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_target.py @@ -0,0 +1,65 @@ +# 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.serialization import Model + + +class JobTarget(Model): + """A job target, for example a specific database or a container of databases + that is evaluated during job execution. + + All required parameters must be populated in order to send to Azure. + + :param membership_type: Whether the target is included or excluded from + the group. Possible values include: 'Include', 'Exclude'. Default value: + "Include" . + :type membership_type: str or + ~azure.mgmt.sql.models.JobTargetGroupMembershipType + :param type: Required. The target type. Possible values include: + 'TargetGroup', 'SqlDatabase', 'SqlElasticPool', 'SqlShardMap', 'SqlServer' + :type type: str or ~azure.mgmt.sql.models.JobTargetType + :param server_name: The target server name. + :type server_name: str + :param database_name: The target database name. + :type database_name: str + :param elastic_pool_name: The target elastic pool name. + :type elastic_pool_name: str + :param shard_map_name: The target shard map. + :type shard_map_name: str + :param refresh_credential: The resource ID of the credential that is used + during job execution to connect to the target and determine the list of + databases inside the target. + :type refresh_credential: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'membership_type': {'key': 'membershipType', 'type': 'JobTargetGroupMembershipType'}, + 'type': {'key': 'type', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + 'elastic_pool_name': {'key': 'elasticPoolName', 'type': 'str'}, + 'shard_map_name': {'key': 'shardMapName', 'type': 'str'}, + 'refresh_credential': {'key': 'refreshCredential', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobTarget, self).__init__(**kwargs) + self.membership_type = kwargs.get('membership_type', "Include") + self.type = kwargs.get('type', None) + self.server_name = kwargs.get('server_name', None) + self.database_name = kwargs.get('database_name', None) + self.elastic_pool_name = kwargs.get('elastic_pool_name', None) + self.shard_map_name = kwargs.get('shard_map_name', None) + self.refresh_credential = kwargs.get('refresh_credential', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group.py new file mode 100644 index 000000000000..38148fb244c4 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group.py @@ -0,0 +1,49 @@ +# 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 .proxy_resource import ProxyResource + + +class JobTargetGroup(ProxyResource): + """A group of job targets. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param members: Required. Members of the target group. + :type members: list[~azure.mgmt.sql.models.JobTarget] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'members': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'members': {'key': 'properties.members', 'type': '[JobTarget]'}, + } + + def __init__(self, **kwargs): + super(JobTargetGroup, self).__init__(**kwargs) + self.members = kwargs.get('members', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_paged.py new file mode 100644 index 000000000000..cd466e5afa84 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class JobTargetGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`JobTargetGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[JobTargetGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(JobTargetGroupPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_py3.py new file mode 100644 index 000000000000..a9582212ff82 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_py3.py @@ -0,0 +1,49 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class JobTargetGroup(ProxyResource): + """A group of job targets. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param members: Required. Members of the target group. + :type members: list[~azure.mgmt.sql.models.JobTarget] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'members': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'members': {'key': 'properties.members', 'type': '[JobTarget]'}, + } + + def __init__(self, *, members, **kwargs) -> None: + super(JobTargetGroup, self).__init__(**kwargs) + self.members = members diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_target_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_target_py3.py new file mode 100644 index 000000000000..281eb7598f18 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_target_py3.py @@ -0,0 +1,65 @@ +# 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.serialization import Model + + +class JobTarget(Model): + """A job target, for example a specific database or a container of databases + that is evaluated during job execution. + + All required parameters must be populated in order to send to Azure. + + :param membership_type: Whether the target is included or excluded from + the group. Possible values include: 'Include', 'Exclude'. Default value: + "Include" . + :type membership_type: str or + ~azure.mgmt.sql.models.JobTargetGroupMembershipType + :param type: Required. The target type. Possible values include: + 'TargetGroup', 'SqlDatabase', 'SqlElasticPool', 'SqlShardMap', 'SqlServer' + :type type: str or ~azure.mgmt.sql.models.JobTargetType + :param server_name: The target server name. + :type server_name: str + :param database_name: The target database name. + :type database_name: str + :param elastic_pool_name: The target elastic pool name. + :type elastic_pool_name: str + :param shard_map_name: The target shard map. + :type shard_map_name: str + :param refresh_credential: The resource ID of the credential that is used + during job execution to connect to the target and determine the list of + databases inside the target. + :type refresh_credential: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'membership_type': {'key': 'membershipType', 'type': 'JobTargetGroupMembershipType'}, + 'type': {'key': 'type', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + 'elastic_pool_name': {'key': 'elasticPoolName', 'type': 'str'}, + 'shard_map_name': {'key': 'shardMapName', 'type': 'str'}, + 'refresh_credential': {'key': 'refreshCredential', 'type': 'str'}, + } + + def __init__(self, *, type, membership_type="Include", server_name: str=None, database_name: str=None, elastic_pool_name: str=None, shard_map_name: str=None, refresh_credential: str=None, **kwargs) -> None: + super(JobTarget, self).__init__(**kwargs) + self.membership_type = membership_type + self.type = type + self.server_name = server_name + self.database_name = database_name + self.elastic_pool_name = elastic_pool_name + self.shard_map_name = shard_map_name + self.refresh_credential = refresh_credential diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_version.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_version.py new file mode 100644 index 000000000000..3c480e739607 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_version.py @@ -0,0 +1,42 @@ +# 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 .proxy_resource import ProxyResource + + +class JobVersion(ProxyResource): + """A job version. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobVersion, self).__init__(**kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_version_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_version_paged.py new file mode 100644 index 000000000000..162e4d8cfb5e --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_version_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class JobVersionPaged(Paged): + """ + A paging container for iterating over a list of :class:`JobVersion ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[JobVersion]'} + } + + def __init__(self, *args, **kwargs): + + super(JobVersionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_version_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_version_py3.py new file mode 100644 index 000000000000..16a8798c5949 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/job_version_py3.py @@ -0,0 +1,42 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class JobVersion(ProxyResource): + """A job version. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(JobVersion, self).__init__(**kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/long_term_retention_backup_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/long_term_retention_backup_py3.py index a7d128063b24..eb1372180fb0 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/long_term_retention_backup_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/long_term_retention_backup_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class LongTermRetentionBackup(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_py3.py index c17cd2ac18a5..a7f14a2f6bfc 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .tracked_resource import TrackedResource +from .tracked_resource_py3 import TrackedResource class ManagedDatabase(TrackedResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py index d6c710b8773b..1532bba0f060 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .tracked_resource import TrackedResource +from .tracked_resource_py3 import TrackedResource class ManagedInstance(TrackedResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/proxy_resource_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/proxy_resource_py3.py index 322fccf81120..707323dfc134 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/proxy_resource_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/proxy_resource_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class ProxyResource(Resource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool_py3.py index f11b8a1bc507..ee13abf5d237 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class RecommendedElasticPool(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/recommended_index_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/recommended_index_py3.py index 446e1fafd8e0..5aea5620371e 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/recommended_index_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/recommended_index_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class RecommendedIndex(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/recoverable_database_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/recoverable_database_py3.py index 5b753144dc76..8eb9d5510689 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/recoverable_database_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/recoverable_database_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class RecoverableDatabase(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/replication_link_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/replication_link_py3.py index 98ca741b476a..740748f154b2 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/replication_link_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/replication_link_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class ReplicationLink(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/restorable_dropped_database_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/restorable_dropped_database_py3.py index 80b7d9c9b02b..0e4a5f45ec89 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/restorable_dropped_database_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/restorable_dropped_database_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class RestorableDroppedDatabase(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/restore_point_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/restore_point_py3.py index f86ba3ed37b2..886f576a4575 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/restore_point_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/restore_point_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class RestorePoint(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_automatic_tuning_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_automatic_tuning_py3.py index 4c31615adcb9..fb8fb4804610 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_automatic_tuning_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_automatic_tuning_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class ServerAutomaticTuning(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_azure_ad_administrator_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_azure_ad_administrator_py3.py index fb5d93d90546..3dfeb71123c3 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_azure_ad_administrator_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_azure_ad_administrator_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class ServerAzureADAdministrator(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_communication_link_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_communication_link_py3.py index 58795afad14e..6a32069ca067 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_communication_link_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_communication_link_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class ServerCommunicationLink(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_connection_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_connection_policy_py3.py index 60164406821b..10bd81052301 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_connection_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_connection_policy_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class ServerConnectionPolicy(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_dns_alias_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_dns_alias_py3.py index 1a49b635ca8a..c57df1a85f06 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_dns_alias_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_dns_alias_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class ServerDnsAlias(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_key_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_key_py3.py index 5b8569a81ea3..41ef40ab165a 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_key_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_key_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class ServerKey(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_py3.py index f68696704197..0d0308dc0653 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .tracked_resource import TrackedResource +from .tracked_resource_py3 import TrackedResource class Server(TrackedResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/service_objective_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/service_objective_py3.py index e4e590716ec4..2fc00134e6ec 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/service_objective_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/service_objective_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class ServiceObjective(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/service_tier_advisor_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/service_tier_advisor_py3.py index 0cc77ab82872..04f5dceca1c0 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/service_tier_advisor_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/service_tier_advisor_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class ServiceTierAdvisor(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/short_term_retention_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/short_term_retention_policy_py3.py index 49d6849c203e..6770d92fa626 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/short_term_retention_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/short_term_retention_policy_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class ShortTermRetentionPolicy(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py b/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py index 3a82b6370cd3..e4a76e0f84e5 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py @@ -411,6 +411,74 @@ class VirtualNetworkRuleState(str, Enum): unknown = "Unknown" +class JobAgentState(str, Enum): + + creating = "Creating" + ready = "Ready" + updating = "Updating" + deleting = "Deleting" + disabled = "Disabled" + + +class JobExecutionLifecycle(str, Enum): + + created = "Created" + in_progress = "InProgress" + waiting_for_child_job_executions = "WaitingForChildJobExecutions" + waiting_for_retry = "WaitingForRetry" + succeeded = "Succeeded" + succeeded_with_skipped = "SucceededWithSkipped" + failed = "Failed" + timed_out = "TimedOut" + canceled = "Canceled" + skipped = "Skipped" + + +class ProvisioningState(str, Enum): + + created = "Created" + in_progress = "InProgress" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" + + +class JobTargetType(str, Enum): + + target_group = "TargetGroup" + sql_database = "SqlDatabase" + sql_elastic_pool = "SqlElasticPool" + sql_shard_map = "SqlShardMap" + sql_server = "SqlServer" + + +class JobScheduleType(str, Enum): + + once = "Once" + recurring = "Recurring" + + +class JobStepActionType(str, Enum): + + tsql = "TSql" + + +class JobStepActionSource(str, Enum): + + inline = "Inline" + + +class JobStepOutputType(str, Enum): + + sql_database = "SqlDatabase" + + +class JobTargetGroupMembershipType(str, Enum): + + include = "Include" + exclude = "Exclude" + + class ManagedDatabaseStatus(str, Enum): online = "Online" @@ -562,6 +630,20 @@ class ElasticPoolLicenseType(str, Enum): base_price = "BasePrice" +class VulnerabilityAssessmentScanTriggerType(str, Enum): + + on_demand = "OnDemand" + recurring = "Recurring" + + +class VulnerabilityAssessmentScanState(str, Enum): + + passed = "Passed" + failed = "Failed" + failed_to_run = "FailedToRun" + in_progress = "InProgress" + + class InstanceFailoverGroupReplicationRole(str, Enum): primary = "Primary" diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/subscription_usage_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/subscription_usage_py3.py index a4ba7cd8c102..d55e3275a74b 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/subscription_usage_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/subscription_usage_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class SubscriptionUsage(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_linked_database_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_linked_database_py3.py index 30a633cda9a1..7d92287e1a37 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_linked_database_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_linked_database_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class SyncAgentLinkedDatabase(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_py3.py index 06fa4a8f1100..f07649750457 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class SyncAgent(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sync_group_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/sync_group_py3.py index 8d1a557ef6ca..1654af79245f 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sync_group_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sync_group_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class SyncGroup(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sync_member_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/sync_member_py3.py index 74b903a63b0f..50cf8fe2d65c 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sync_member_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sync_member_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class SyncMember(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/tracked_resource_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/tracked_resource_py3.py index 4d8ec200976a..6375e9a90eba 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/tracked_resource_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/tracked_resource_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class TrackedResource(Resource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_activity_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_activity_py3.py index f8d509c9a56e..9bf146137c20 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_activity_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_activity_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class TransparentDataEncryptionActivity(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_py3.py index bc38ca655789..db2b2096f798 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class TransparentDataEncryption(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/virtual_network_rule_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/virtual_network_rule_py3.py index 4fd7a128505a..19e6bd30ff5e 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/virtual_network_rule_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/virtual_network_rule_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class VirtualNetworkRule(ProxyResource): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_recurring_scans_properties.py b/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_recurring_scans_properties.py new file mode 100644 index 000000000000..e7d424543f2b --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_recurring_scans_properties.py @@ -0,0 +1,39 @@ +# 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.serialization import Model + + +class VulnerabilityAssessmentRecurringScansProperties(Model): + """Properties of a Vulnerability Assessment recurring scans. + + :param is_enabled: Recurring scans state. + :type is_enabled: bool + :param email_subscription_admins: Specifies that the schedule scan + notification will be is sent to the subscription administrators. Default + value: True . + :type email_subscription_admins: bool + :param emails: Specifies an array of e-mail addresses to which the scan + notification is sent. + :type emails: list[str] + """ + + _attribute_map = { + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'email_subscription_admins': {'key': 'emailSubscriptionAdmins', 'type': 'bool'}, + 'emails': {'key': 'emails', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(VulnerabilityAssessmentRecurringScansProperties, self).__init__(**kwargs) + self.is_enabled = kwargs.get('is_enabled', None) + self.email_subscription_admins = kwargs.get('email_subscription_admins', True) + self.emails = kwargs.get('emails', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_recurring_scans_properties_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_recurring_scans_properties_py3.py new file mode 100644 index 000000000000..3a55afaa0a5e --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_recurring_scans_properties_py3.py @@ -0,0 +1,39 @@ +# 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.serialization import Model + + +class VulnerabilityAssessmentRecurringScansProperties(Model): + """Properties of a Vulnerability Assessment recurring scans. + + :param is_enabled: Recurring scans state. + :type is_enabled: bool + :param email_subscription_admins: Specifies that the schedule scan + notification will be is sent to the subscription administrators. Default + value: True . + :type email_subscription_admins: bool + :param emails: Specifies an array of e-mail addresses to which the scan + notification is sent. + :type emails: list[str] + """ + + _attribute_map = { + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'email_subscription_admins': {'key': 'emailSubscriptionAdmins', 'type': 'bool'}, + 'emails': {'key': 'emails', 'type': '[str]'}, + } + + def __init__(self, *, is_enabled: bool=None, email_subscription_admins: bool=True, emails=None, **kwargs) -> None: + super(VulnerabilityAssessmentRecurringScansProperties, self).__init__(**kwargs) + self.is_enabled = is_enabled + self.email_subscription_admins = email_subscription_admins + self.emails = emails diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_error.py b/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_error.py new file mode 100644 index 000000000000..1d465691ba60 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_error.py @@ -0,0 +1,40 @@ +# 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.serialization import Model + + +class VulnerabilityAssessmentScanError(Model): + """Properties of a vulnerability assessment scan error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VulnerabilityAssessmentScanError, self).__init__(**kwargs) + self.code = None + self.message = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_error_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_error_py3.py new file mode 100644 index 000000000000..93c13998eb25 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_error_py3.py @@ -0,0 +1,40 @@ +# 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.serialization import Model + + +class VulnerabilityAssessmentScanError(Model): + """Properties of a vulnerability assessment scan error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VulnerabilityAssessmentScanError, self).__init__(**kwargs) + self.code = None + self.message = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_record.py b/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_record.py new file mode 100644 index 000000000000..67a6d163f90c --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_record.py @@ -0,0 +1,88 @@ +# 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 .proxy_resource import ProxyResource + + +class VulnerabilityAssessmentScanRecord(ProxyResource): + """A vulnerability assessment scan record. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar scan_id: The scan ID. + :vartype scan_id: str + :ivar trigger_type: The scan trigger type. Possible values include: + 'OnDemand', 'Recurring' + :vartype trigger_type: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentScanTriggerType + :ivar state: The scan status. Possible values include: 'Passed', 'Failed', + 'FailedToRun', 'InProgress' + :vartype state: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentScanState + :ivar start_time: The scan start time (UTC). + :vartype start_time: datetime + :ivar end_time: The scan end time (UTC). + :vartype end_time: datetime + :ivar errors: The scan errors. + :vartype errors: + list[~azure.mgmt.sql.models.VulnerabilityAssessmentScanError] + :ivar storage_container_path: The scan results storage container path. + :vartype storage_container_path: str + :ivar number_of_failed_security_checks: The number of failed security + checks. + :vartype number_of_failed_security_checks: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'scan_id': {'readonly': True}, + 'trigger_type': {'readonly': True}, + 'state': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'errors': {'readonly': True}, + 'storage_container_path': {'readonly': True}, + 'number_of_failed_security_checks': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'scan_id': {'key': 'properties.scanId', 'type': 'str'}, + 'trigger_type': {'key': 'properties.triggerType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'errors': {'key': 'properties.errors', 'type': '[VulnerabilityAssessmentScanError]'}, + 'storage_container_path': {'key': 'properties.storageContainerPath', 'type': 'str'}, + 'number_of_failed_security_checks': {'key': 'properties.numberOfFailedSecurityChecks', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(VulnerabilityAssessmentScanRecord, self).__init__(**kwargs) + self.scan_id = None + self.trigger_type = None + self.state = None + self.start_time = None + self.end_time = None + self.errors = None + self.storage_container_path = None + self.number_of_failed_security_checks = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_record_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_record_paged.py new file mode 100644 index 000000000000..7076acc9290f --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_record_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class VulnerabilityAssessmentScanRecordPaged(Paged): + """ + A paging container for iterating over a list of :class:`VulnerabilityAssessmentScanRecord ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VulnerabilityAssessmentScanRecord]'} + } + + def __init__(self, *args, **kwargs): + + super(VulnerabilityAssessmentScanRecordPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_record_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_record_py3.py new file mode 100644 index 000000000000..e31d141065af --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/vulnerability_assessment_scan_record_py3.py @@ -0,0 +1,88 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class VulnerabilityAssessmentScanRecord(ProxyResource): + """A vulnerability assessment scan record. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar scan_id: The scan ID. + :vartype scan_id: str + :ivar trigger_type: The scan trigger type. Possible values include: + 'OnDemand', 'Recurring' + :vartype trigger_type: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentScanTriggerType + :ivar state: The scan status. Possible values include: 'Passed', 'Failed', + 'FailedToRun', 'InProgress' + :vartype state: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentScanState + :ivar start_time: The scan start time (UTC). + :vartype start_time: datetime + :ivar end_time: The scan end time (UTC). + :vartype end_time: datetime + :ivar errors: The scan errors. + :vartype errors: + list[~azure.mgmt.sql.models.VulnerabilityAssessmentScanError] + :ivar storage_container_path: The scan results storage container path. + :vartype storage_container_path: str + :ivar number_of_failed_security_checks: The number of failed security + checks. + :vartype number_of_failed_security_checks: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'scan_id': {'readonly': True}, + 'trigger_type': {'readonly': True}, + 'state': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'errors': {'readonly': True}, + 'storage_container_path': {'readonly': True}, + 'number_of_failed_security_checks': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'scan_id': {'key': 'properties.scanId', 'type': 'str'}, + 'trigger_type': {'key': 'properties.triggerType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'errors': {'key': 'properties.errors', 'type': '[VulnerabilityAssessmentScanError]'}, + 'storage_container_path': {'key': 'properties.storageContainerPath', 'type': 'str'}, + 'number_of_failed_security_checks': {'key': 'properties.numberOfFailedSecurityChecks', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(VulnerabilityAssessmentScanRecord, self).__init__(**kwargs) + self.scan_id = None + self.trigger_type = None + self.state = None + self.start_time = None + self.end_time = None + self.errors = None + self.storage_container_path = None + self.number_of_failed_security_checks = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py index 54f846ee2941..b66a0f4ac2fd 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py @@ -44,6 +44,17 @@ from .sync_members_operations import SyncMembersOperations from .subscription_usages_operations import SubscriptionUsagesOperations from .virtual_network_rules_operations import VirtualNetworkRulesOperations +from .database_vulnerability_assessment_rule_baselines_operations import DatabaseVulnerabilityAssessmentRuleBaselinesOperations +from .database_vulnerability_assessments_operations import DatabaseVulnerabilityAssessmentsOperations +from .job_agents_operations import JobAgentsOperations +from .job_credentials_operations import JobCredentialsOperations +from .job_executions_operations import JobExecutionsOperations +from .jobs_operations import JobsOperations +from .job_step_executions_operations import JobStepExecutionsOperations +from .job_steps_operations import JobStepsOperations +from .job_target_executions_operations import JobTargetExecutionsOperations +from .job_target_groups_operations import JobTargetGroupsOperations +from .job_versions_operations import JobVersionsOperations from .long_term_retention_backups_operations import LongTermRetentionBackupsOperations from .backup_long_term_retention_policies_operations import BackupLongTermRetentionPoliciesOperations from .managed_databases_operations import ManagedDatabasesOperations @@ -53,6 +64,7 @@ from .database_operations import DatabaseOperations from .elastic_pool_operations import ElasticPoolOperations from .capabilities_operations import CapabilitiesOperations +from .database_vulnerability_assessment_scans_operations import DatabaseVulnerabilityAssessmentScansOperations from .instance_failover_groups_operations import InstanceFailoverGroupsOperations from .short_term_retention_policies_operations import ShortTermRetentionPoliciesOperations @@ -92,6 +104,17 @@ 'SyncMembersOperations', 'SubscriptionUsagesOperations', 'VirtualNetworkRulesOperations', + 'DatabaseVulnerabilityAssessmentRuleBaselinesOperations', + 'DatabaseVulnerabilityAssessmentsOperations', + 'JobAgentsOperations', + 'JobCredentialsOperations', + 'JobExecutionsOperations', + 'JobsOperations', + 'JobStepExecutionsOperations', + 'JobStepsOperations', + 'JobTargetExecutionsOperations', + 'JobTargetGroupsOperations', + 'JobVersionsOperations', 'LongTermRetentionBackupsOperations', 'BackupLongTermRetentionPoliciesOperations', 'ManagedDatabasesOperations', @@ -101,6 +124,7 @@ 'DatabaseOperations', 'ElasticPoolOperations', 'CapabilitiesOperations', + 'DatabaseVulnerabilityAssessmentScansOperations', 'InstanceFailoverGroupsOperations', 'ShortTermRetentionPoliciesOperations', ] diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessment_rule_baselines_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessment_rule_baselines_operations.py new file mode 100644 index 000000000000..16a909e27a1a --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessment_rule_baselines_operations.py @@ -0,0 +1,266 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DatabaseVulnerabilityAssessmentRuleBaselinesOperations(object): + """DatabaseVulnerabilityAssessmentRuleBaselinesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar vulnerability_assessment_name: The name of the vulnerability assessment. Constant value: "default". + :ivar baseline_name: The name of the vulnerability assessment rule baseline. Constant value: "default". + :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.vulnerability_assessment_name = "default" + self.baseline_name = "default" + self.api_version = "2017-03-01-preview" + + self.config = config + + def get( + self, resource_group_name, server_name, database_name, rule_id, custom_headers=None, raw=False, **operation_config): + """Gets a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database for which the + vulnerability assessment rule baseline is defined. + :type database_name: str + :param rule_id: The vulnerability assessment rule ID. + :type rule_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatabaseVulnerabilityAssessmentRuleBaseline or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'ruleId': self._serialize.url("rule_id", rule_id, 'str'), + 'baselineName': self._serialize.url("self.baseline_name", self.baseline_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DatabaseVulnerabilityAssessmentRuleBaseline', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}'} + + def create_or_update( + self, resource_group_name, server_name, database_name, rule_id, baseline_results, custom_headers=None, raw=False, **operation_config): + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database for which the + vulnerability assessment rule baseline is defined. + :type database_name: str + :param rule_id: The vulnerability assessment rule ID. + :type rule_id: str + :param baseline_results: The rule baseline result + :type baseline_results: + list[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaselineItem] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatabaseVulnerabilityAssessmentRuleBaseline or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.DatabaseVulnerabilityAssessmentRuleBaseline(baseline_results=baseline_results) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'ruleId': self._serialize.url("rule_id", rule_id, 'str'), + 'baselineName': self._serialize.url("self.baseline_name", self.baseline_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DatabaseVulnerabilityAssessmentRuleBaseline') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DatabaseVulnerabilityAssessmentRuleBaseline', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}'} + + def delete( + self, resource_group_name, server_name, database_name, rule_id, custom_headers=None, raw=False, **operation_config): + """Removes the database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database for which the + vulnerability assessment rule baseline is defined. + :type database_name: str + :param rule_id: The vulnerability assessment rule ID. + :type rule_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'ruleId': self._serialize.url("rule_id", rule_id, 'str'), + 'baselineName': self._serialize.url("self.baseline_name", self.baseline_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessment_scans_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessment_scans_operations.py new file mode 100644 index 000000000000..e1d379ff4529 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessment_scans_operations.py @@ -0,0 +1,361 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DatabaseVulnerabilityAssessmentScansOperations(object): + """DatabaseVulnerabilityAssessmentScansOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar vulnerability_assessment_name: The name of the vulnerability assessment. Constant value: "default". + :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.vulnerability_assessment_name = "default" + self.api_version = "2017-10-01-preview" + + self.config = config + + def get( + self, resource_group_name, server_name, database_name, scan_id, custom_headers=None, raw=False, **operation_config): + """Gets a vulnerability assessment scan record of a database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param scan_id: The vulnerability assessment scan Id of the scan to + retrieve. + :type scan_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VulnerabilityAssessmentScanRecord or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'scanId': self._serialize.url("scan_id", scan_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VulnerabilityAssessmentScanRecord', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}'} + + + def _initiate_scan_initial( + self, resource_group_name, server_name, database_name, scan_id, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.initiate_scan.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'scanId': self._serialize.url("scan_id", scan_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def initiate_scan( + self, resource_group_name, server_name, database_name, scan_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Executes a Vulnerability Assessment database scan. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param scan_id: The vulnerability assessment scan Id of the scan to + retrieve. + :type scan_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._initiate_scan_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + scan_id=scan_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + initiate_scan.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan'} + + def list_by_database( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Lists the vulnerability assessment scans of a database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + VulnerabilityAssessmentScanRecord + :rtype: + ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecordPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.VulnerabilityAssessmentScanRecordPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VulnerabilityAssessmentScanRecordPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans'} + + def export( + self, resource_group_name, server_name, database_name, scan_id, custom_headers=None, raw=False, **operation_config): + """Convert an existing scan result to a human readable format. If already + exists nothing happens. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the scanned database. + :type database_name: str + :param scan_id: The vulnerability assessment scan Id. + :type scan_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatabaseVulnerabilityAssessmentScansExport or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScansExport or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.export.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'scanId': self._serialize.url("scan_id", scan_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DatabaseVulnerabilityAssessmentScansExport', response) + if response.status_code == 201: + deserialized = self._deserialize('DatabaseVulnerabilityAssessmentScansExport', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + export.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessments_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessments_operations.py new file mode 100644 index 000000000000..5f923f69d777 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessments_operations.py @@ -0,0 +1,250 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DatabaseVulnerabilityAssessmentsOperations(object): + """DatabaseVulnerabilityAssessmentsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar vulnerability_assessment_name: The name of the vulnerability assessment. Constant value: "default". + :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.vulnerability_assessment_name = "default" + self.api_version = "2017-03-01-preview" + + self.config = config + + def get( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database for which the + vulnerability assessment is defined. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatabaseVulnerabilityAssessment or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DatabaseVulnerabilityAssessment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}'} + + def create_or_update( + self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database for which the + vulnerability assessment is defined. + :type database_name: str + :param parameters: The requested resource. + :type parameters: + ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatabaseVulnerabilityAssessment or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DatabaseVulnerabilityAssessment') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DatabaseVulnerabilityAssessment', response) + if response.status_code == 201: + deserialized = self._deserialize('DatabaseVulnerabilityAssessment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}'} + + def delete( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Removes the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database for which the + vulnerability assessment is defined. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_agents_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_agents_operations.py new file mode 100644 index 000000000000..774fa59314ce --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/job_agents_operations.py @@ -0,0 +1,483 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class JobAgentsOperations(object): + """JobAgentsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-01-preview" + + self.config = config + + def list_by_server( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of job agents in a server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobAgent + :rtype: + ~azure.mgmt.sql.models.JobAgentPaged[~azure.mgmt.sql.models.JobAgent] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_server.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JobAgentPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobAgentPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents'} + + def get( + self, resource_group_name, server_name, job_agent_name, custom_headers=None, raw=False, **operation_config): + """Gets a job agent. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. + :type job_agent_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobAgent or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.JobAgent or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobAgent', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}'} + + + def _create_or_update_initial( + self, resource_group_name, server_name, job_agent_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'JobAgent') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobAgent', response) + if response.status_code == 201: + deserialized = self._deserialize('JobAgent', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, job_agent_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a job agent. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent to be created or + updated. + :type job_agent_name: str + :param parameters: The requested job agent resource state. + :type parameters: ~azure.mgmt.sql.models.JobAgent + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns JobAgent or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.JobAgent] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.JobAgent]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('JobAgent', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}'} + + + def _delete_initial( + self, resource_group_name, server_name, job_agent_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, server_name, job_agent_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a job agent. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent to be deleted. + :type job_agent_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}'} + + + def _update_initial( + self, resource_group_name, server_name, job_agent_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.JobAgentUpdate(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'JobAgentUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobAgent', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, server_name, job_agent_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a job agent. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent to be updated. + :type job_agent_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns JobAgent or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.JobAgent] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.JobAgent]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('JobAgent', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_credentials_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_credentials_operations.py new file mode 100644 index 000000000000..c4bf415fe5e4 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/job_credentials_operations.py @@ -0,0 +1,328 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class JobCredentialsOperations(object): + """JobCredentialsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-01-preview" + + self.config = config + + def list_by_agent( + self, resource_group_name, server_name, job_agent_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of jobs credentials. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobCredential + :rtype: + ~azure.mgmt.sql.models.JobCredentialPaged[~azure.mgmt.sql.models.JobCredential] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_agent.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JobCredentialPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobCredentialPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_agent.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials'} + + def get( + self, resource_group_name, server_name, job_agent_name, credential_name, custom_headers=None, raw=False, **operation_config): + """Gets a jobs credential. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param credential_name: The name of the credential. + :type credential_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobCredential or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.JobCredential or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobCredential', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}'} + + def create_or_update( + self, resource_group_name, server_name, job_agent_name, credential_name, username, password, custom_headers=None, raw=False, **operation_config): + """Creates or updates a job credential. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param credential_name: The name of the credential. + :type credential_name: str + :param username: The credential user name. + :type username: str + :param password: The credential password. + :type password: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobCredential or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.JobCredential or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.JobCredential(username=username, password=password) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'JobCredential') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobCredential', response) + if response.status_code == 201: + deserialized = self._deserialize('JobCredential', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}'} + + def delete( + self, resource_group_name, server_name, job_agent_name, credential_name, custom_headers=None, raw=False, **operation_config): + """Deletes a job credential. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param credential_name: The name of the credential. + :type credential_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_executions_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_executions_operations.py new file mode 100644 index 000000000000..3a9c7cd1c597 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/job_executions_operations.py @@ -0,0 +1,612 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class JobExecutionsOperations(object): + """JobExecutionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-01-preview" + + self.config = config + + def list_by_agent( + self, resource_group_name, server_name, job_agent_name, create_time_min=None, create_time_max=None, end_time_min=None, end_time_max=None, is_active=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists all executions in a job agent. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param create_time_min: If specified, only job executions created at + or after the specified time are included. + :type create_time_min: datetime + :param create_time_max: If specified, only job executions created + before the specified time are included. + :type create_time_max: datetime + :param end_time_min: If specified, only job executions completed at or + after the specified time are included. + :type end_time_min: datetime + :param end_time_max: If specified, only job executions completed + before the specified time are included. + :type end_time_max: datetime + :param is_active: If specified, only active or only completed job + executions are included. + :type is_active: bool + :param skip: The number of elements in the collection to skip. + :type skip: int + :param top: The number of elements to return from the collection. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobExecution + :rtype: + ~azure.mgmt.sql.models.JobExecutionPaged[~azure.mgmt.sql.models.JobExecution] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_agent.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if create_time_min is not None: + query_parameters['createTimeMin'] = self._serialize.query("create_time_min", create_time_min, 'iso-8601') + if create_time_max is not None: + query_parameters['createTimeMax'] = self._serialize.query("create_time_max", create_time_max, 'iso-8601') + if end_time_min is not None: + query_parameters['endTimeMin'] = self._serialize.query("end_time_min", end_time_min, 'iso-8601') + if end_time_max is not None: + query_parameters['endTimeMax'] = self._serialize.query("end_time_max", end_time_max, 'iso-8601') + if is_active is not None: + query_parameters['isActive'] = self._serialize.query("is_active", is_active, 'bool') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_agent.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/executions'} + + def cancel( + self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers=None, raw=False, **operation_config): + """Requests cancellation of a job execution. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job. + :type job_name: str + :param job_execution_id: The id of the job execution to cancel. + :type job_execution_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.cancel.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/cancel'} + + + def _create_initial( + self, resource_group_name, server_name, job_agent_name, job_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobExecution', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, server_name, job_agent_name, job_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Starts an elastic job execution. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job to get. + :type job_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns JobExecution or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.JobExecution] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.JobExecution]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('JobExecution', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start'} + + def list_by_job( + self, resource_group_name, server_name, job_agent_name, job_name, create_time_min=None, create_time_max=None, end_time_min=None, end_time_max=None, is_active=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists a job's executions. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job to get. + :type job_name: str + :param create_time_min: If specified, only job executions created at + or after the specified time are included. + :type create_time_min: datetime + :param create_time_max: If specified, only job executions created + before the specified time are included. + :type create_time_max: datetime + :param end_time_min: If specified, only job executions completed at or + after the specified time are included. + :type end_time_min: datetime + :param end_time_max: If specified, only job executions completed + before the specified time are included. + :type end_time_max: datetime + :param is_active: If specified, only active or only completed job + executions are included. + :type is_active: bool + :param skip: The number of elements in the collection to skip. + :type skip: int + :param top: The number of elements to return from the collection. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobExecution + :rtype: + ~azure.mgmt.sql.models.JobExecutionPaged[~azure.mgmt.sql.models.JobExecution] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_job.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if create_time_min is not None: + query_parameters['createTimeMin'] = self._serialize.query("create_time_min", create_time_min, 'iso-8601') + if create_time_max is not None: + query_parameters['createTimeMax'] = self._serialize.query("create_time_max", create_time_max, 'iso-8601') + if end_time_min is not None: + query_parameters['endTimeMin'] = self._serialize.query("end_time_min", end_time_min, 'iso-8601') + if end_time_max is not None: + query_parameters['endTimeMax'] = self._serialize.query("end_time_max", end_time_max, 'iso-8601') + if is_active is not None: + query_parameters['isActive'] = self._serialize.query("is_active", is_active, 'bool') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions'} + + def get( + self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers=None, raw=False, **operation_config): + """Gets a job execution. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job. + :type job_name: str + :param job_execution_id: The id of the job execution + :type job_execution_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobExecution or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.JobExecution or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobExecution', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}'} + + + def _create_or_update_initial( + self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobExecution', response) + if response.status_code == 201: + deserialized = self._deserialize('JobExecution', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updatess a job execution. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job to get. + :type job_name: str + :param job_execution_id: The job execution id to create the job + execution under. + :type job_execution_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns JobExecution or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.JobExecution] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.JobExecution]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('JobExecution', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_step_executions_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_step_executions_operations.py new file mode 100644 index 000000000000..3a2c37310f40 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/job_step_executions_operations.py @@ -0,0 +1,229 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class JobStepExecutionsOperations(object): + """JobStepExecutionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-01-preview" + + self.config = config + + def list_by_job_execution( + self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, create_time_min=None, create_time_max=None, end_time_min=None, end_time_max=None, is_active=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the step executions of a job execution. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job to get. + :type job_name: str + :param job_execution_id: The id of the job execution + :type job_execution_id: str + :param create_time_min: If specified, only job executions created at + or after the specified time are included. + :type create_time_min: datetime + :param create_time_max: If specified, only job executions created + before the specified time are included. + :type create_time_max: datetime + :param end_time_min: If specified, only job executions completed at or + after the specified time are included. + :type end_time_min: datetime + :param end_time_max: If specified, only job executions completed + before the specified time are included. + :type end_time_max: datetime + :param is_active: If specified, only active or only completed job + executions are included. + :type is_active: bool + :param skip: The number of elements in the collection to skip. + :type skip: int + :param top: The number of elements to return from the collection. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobExecution + :rtype: + ~azure.mgmt.sql.models.JobExecutionPaged[~azure.mgmt.sql.models.JobExecution] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_job_execution.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if create_time_min is not None: + query_parameters['createTimeMin'] = self._serialize.query("create_time_min", create_time_min, 'iso-8601') + if create_time_max is not None: + query_parameters['createTimeMax'] = self._serialize.query("create_time_max", create_time_max, 'iso-8601') + if end_time_min is not None: + query_parameters['endTimeMin'] = self._serialize.query("end_time_min", end_time_min, 'iso-8601') + if end_time_max is not None: + query_parameters['endTimeMax'] = self._serialize.query("end_time_max", end_time_max, 'iso-8601') + if is_active is not None: + query_parameters['isActive'] = self._serialize.query("is_active", is_active, 'bool') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_job_execution.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps'} + + def get( + self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, step_name, custom_headers=None, raw=False, **operation_config): + """Gets a step execution of a job execution. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job to get. + :type job_name: str + :param job_execution_id: The unique id of the job execution + :type job_execution_id: str + :param step_name: The name of the step. + :type step_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobExecution or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.JobExecution or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), + 'stepName': self._serialize.url("step_name", step_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobExecution', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_steps_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_steps_operations.py new file mode 100644 index 000000000000..0cd2ba4bc13d --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/job_steps_operations.py @@ -0,0 +1,495 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class JobStepsOperations(object): + """JobStepsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-01-preview" + + self.config = config + + def list_by_version( + self, resource_group_name, server_name, job_agent_name, job_name, job_version, custom_headers=None, raw=False, **operation_config): + """Gets all job steps in the specified job version. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job to get. + :type job_name: str + :param job_version: The version of the job to get. + :type job_version: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobStep + :rtype: + ~azure.mgmt.sql.models.JobStepPaged[~azure.mgmt.sql.models.JobStep] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_version.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'jobVersion': self._serialize.url("job_version", job_version, 'int'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JobStepPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobStepPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps'} + + def get_by_version( + self, resource_group_name, server_name, job_agent_name, job_name, job_version, step_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified version of a job step. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job. + :type job_name: str + :param job_version: The version of the job to get. + :type job_version: int + :param step_name: The name of the job step. + :type step_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobStep or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.JobStep or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_by_version.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'jobVersion': self._serialize.url("job_version", job_version, 'int'), + 'stepName': self._serialize.url("step_name", step_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobStep', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps/{stepName}'} + + def list_by_job( + self, resource_group_name, server_name, job_agent_name, job_name, custom_headers=None, raw=False, **operation_config): + """Gets all job steps for a job's current version. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job to get. + :type job_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobStep + :rtype: + ~azure.mgmt.sql.models.JobStepPaged[~azure.mgmt.sql.models.JobStep] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_job.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JobStepPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobStepPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps'} + + def get( + self, resource_group_name, server_name, job_agent_name, job_name, step_name, custom_headers=None, raw=False, **operation_config): + """Gets a job step in a job's current version. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job. + :type job_name: str + :param step_name: The name of the job step. + :type step_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobStep or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.JobStep or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'stepName': self._serialize.url("step_name", step_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobStep', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}'} + + def create_or_update( + self, resource_group_name, server_name, job_agent_name, job_name, step_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a job step. This will implicitly create a new job + version. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job. + :type job_name: str + :param step_name: The name of the job step. + :type step_name: str + :param parameters: The requested state of the job step. + :type parameters: ~azure.mgmt.sql.models.JobStep + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobStep or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.JobStep or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'stepName': self._serialize.url("step_name", step_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'JobStep') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobStep', response) + if response.status_code == 201: + deserialized = self._deserialize('JobStep', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}'} + + def delete( + self, resource_group_name, server_name, job_agent_name, job_name, step_name, custom_headers=None, raw=False, **operation_config): + """Deletes a job step. This will implicitly create a new job version. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job. + :type job_name: str + :param step_name: The name of the job step to delete. + :type step_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'stepName': self._serialize.url("step_name", step_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_target_executions_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_target_executions_operations.py new file mode 100644 index 000000000000..3224d6ec2d87 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/job_target_executions_operations.py @@ -0,0 +1,350 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class JobTargetExecutionsOperations(object): + """JobTargetExecutionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-01-preview" + + self.config = config + + def list_by_job_execution( + self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, create_time_min=None, create_time_max=None, end_time_min=None, end_time_max=None, is_active=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists target executions for all steps of a job execution. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job to get. + :type job_name: str + :param job_execution_id: The id of the job execution + :type job_execution_id: str + :param create_time_min: If specified, only job executions created at + or after the specified time are included. + :type create_time_min: datetime + :param create_time_max: If specified, only job executions created + before the specified time are included. + :type create_time_max: datetime + :param end_time_min: If specified, only job executions completed at or + after the specified time are included. + :type end_time_min: datetime + :param end_time_max: If specified, only job executions completed + before the specified time are included. + :type end_time_max: datetime + :param is_active: If specified, only active or only completed job + executions are included. + :type is_active: bool + :param skip: The number of elements in the collection to skip. + :type skip: int + :param top: The number of elements to return from the collection. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobExecution + :rtype: + ~azure.mgmt.sql.models.JobExecutionPaged[~azure.mgmt.sql.models.JobExecution] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_job_execution.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if create_time_min is not None: + query_parameters['createTimeMin'] = self._serialize.query("create_time_min", create_time_min, 'iso-8601') + if create_time_max is not None: + query_parameters['createTimeMax'] = self._serialize.query("create_time_max", create_time_max, 'iso-8601') + if end_time_min is not None: + query_parameters['endTimeMin'] = self._serialize.query("end_time_min", end_time_min, 'iso-8601') + if end_time_max is not None: + query_parameters['endTimeMax'] = self._serialize.query("end_time_max", end_time_max, 'iso-8601') + if is_active is not None: + query_parameters['isActive'] = self._serialize.query("is_active", is_active, 'bool') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_job_execution.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets'} + + def list_by_step( + self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, step_name, create_time_min=None, create_time_max=None, end_time_min=None, end_time_max=None, is_active=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the target executions of a job step execution. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job to get. + :type job_name: str + :param job_execution_id: The id of the job execution + :type job_execution_id: str + :param step_name: The name of the step. + :type step_name: str + :param create_time_min: If specified, only job executions created at + or after the specified time are included. + :type create_time_min: datetime + :param create_time_max: If specified, only job executions created + before the specified time are included. + :type create_time_max: datetime + :param end_time_min: If specified, only job executions completed at or + after the specified time are included. + :type end_time_min: datetime + :param end_time_max: If specified, only job executions completed + before the specified time are included. + :type end_time_max: datetime + :param is_active: If specified, only active or only completed job + executions are included. + :type is_active: bool + :param skip: The number of elements in the collection to skip. + :type skip: int + :param top: The number of elements to return from the collection. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobExecution + :rtype: + ~azure.mgmt.sql.models.JobExecutionPaged[~azure.mgmt.sql.models.JobExecution] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_step.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), + 'stepName': self._serialize.url("step_name", step_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if create_time_min is not None: + query_parameters['createTimeMin'] = self._serialize.query("create_time_min", create_time_min, 'iso-8601') + if create_time_max is not None: + query_parameters['createTimeMax'] = self._serialize.query("create_time_max", create_time_max, 'iso-8601') + if end_time_min is not None: + query_parameters['endTimeMin'] = self._serialize.query("end_time_min", end_time_min, 'iso-8601') + if end_time_max is not None: + query_parameters['endTimeMax'] = self._serialize.query("end_time_max", end_time_max, 'iso-8601') + if is_active is not None: + query_parameters['isActive'] = self._serialize.query("is_active", is_active, 'bool') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_step.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets'} + + def get( + self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, step_name, target_id, custom_headers=None, raw=False, **operation_config): + """Gets a target execution. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job to get. + :type job_name: str + :param job_execution_id: The unique id of the job execution + :type job_execution_id: str + :param step_name: The name of the step. + :type step_name: str + :param target_id: The target id. + :type target_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobExecution or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.JobExecution or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), + 'stepName': self._serialize.url("step_name", step_name, 'str'), + 'targetId': self._serialize.url("target_id", target_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobExecution', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets/{targetId}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_target_groups_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_target_groups_operations.py new file mode 100644 index 000000000000..0bf98a502cb8 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/job_target_groups_operations.py @@ -0,0 +1,326 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class JobTargetGroupsOperations(object): + """JobTargetGroupsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-01-preview" + + self.config = config + + def list_by_agent( + self, resource_group_name, server_name, job_agent_name, custom_headers=None, raw=False, **operation_config): + """Gets all target groups in an agent. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobTargetGroup + :rtype: + ~azure.mgmt.sql.models.JobTargetGroupPaged[~azure.mgmt.sql.models.JobTargetGroup] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_agent.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JobTargetGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobTargetGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_agent.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups'} + + def get( + self, resource_group_name, server_name, job_agent_name, target_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a target group. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param target_group_name: The name of the target group. + :type target_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobTargetGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.JobTargetGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'targetGroupName': self._serialize.url("target_group_name", target_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobTargetGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}'} + + def create_or_update( + self, resource_group_name, server_name, job_agent_name, target_group_name, members, custom_headers=None, raw=False, **operation_config): + """Creates or updates a target group. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param target_group_name: The name of the target group. + :type target_group_name: str + :param members: Members of the target group. + :type members: list[~azure.mgmt.sql.models.JobTarget] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobTargetGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.JobTargetGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.JobTargetGroup(members=members) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'targetGroupName': self._serialize.url("target_group_name", target_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'JobTargetGroup') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobTargetGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('JobTargetGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}'} + + def delete( + self, resource_group_name, server_name, job_agent_name, target_group_name, custom_headers=None, raw=False, **operation_config): + """Deletes a target group. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param target_group_name: The name of the target group. + :type target_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'targetGroupName': self._serialize.url("target_group_name", target_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_versions_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_versions_operations.py new file mode 100644 index 000000000000..ec9e2ff23061 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/job_versions_operations.py @@ -0,0 +1,190 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class JobVersionsOperations(object): + """JobVersionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-01-preview" + + self.config = config + + def list_by_job( + self, resource_group_name, server_name, job_agent_name, job_name, custom_headers=None, raw=False, **operation_config): + """Gets all versions of a job. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job to get. + :type job_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobVersion + :rtype: + ~azure.mgmt.sql.models.JobVersionPaged[~azure.mgmt.sql.models.JobVersion] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_job.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JobVersionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobVersionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions'} + + def get( + self, resource_group_name, server_name, job_agent_name, job_name, job_version, custom_headers=None, raw=False, **operation_config): + """Gets a job version. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job. + :type job_name: str + :param job_version: The version of the job to get. + :type job_version: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobVersion or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.JobVersion or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'jobVersion': self._serialize.url("job_version", job_version, 'int'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JobVersion', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/jobs_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/jobs_operations.py new file mode 100644 index 000000000000..042336e20941 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/jobs_operations.py @@ -0,0 +1,327 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class JobsOperations(object): + """JobsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-01-preview" + + self.config = config + + def list_by_agent( + self, resource_group_name, server_name, job_agent_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of jobs. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Job + :rtype: ~azure.mgmt.sql.models.JobPaged[~azure.mgmt.sql.models.Job] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_agent.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JobPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_agent.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs'} + + def get( + self, resource_group_name, server_name, job_agent_name, job_name, custom_headers=None, raw=False, **operation_config): + """Gets a job. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job to get. + :type job_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Job or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.Job or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Job', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}'} + + def create_or_update( + self, resource_group_name, server_name, job_agent_name, job_name, description="", schedule=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates a job. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job to get. + :type job_name: str + :param description: User-defined description of the job. + :type description: str + :param schedule: Schedule properties of the job. + :type schedule: ~azure.mgmt.sql.models.JobSchedule + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Job or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.Job or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.Job(description=description, schedule=schedule) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Job') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Job', response) + if response.status_code == 201: + deserialized = self._deserialize('Job', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}'} + + def delete( + self, resource_group_name, server_name, job_agent_name, job_name, custom_headers=None, raw=False, **operation_config): + """Deletes a job. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param job_agent_name: The name of the job agent. + :type job_agent_name: str + :param job_name: The name of the job to delete. + :type job_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py b/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py index 9aa7e05bf265..869e3e0a4034 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py +++ b/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py @@ -48,6 +48,17 @@ from .operations.sync_members_operations import SyncMembersOperations from .operations.subscription_usages_operations import SubscriptionUsagesOperations from .operations.virtual_network_rules_operations import VirtualNetworkRulesOperations +from .operations.database_vulnerability_assessment_rule_baselines_operations import DatabaseVulnerabilityAssessmentRuleBaselinesOperations +from .operations.database_vulnerability_assessments_operations import DatabaseVulnerabilityAssessmentsOperations +from .operations.job_agents_operations import JobAgentsOperations +from .operations.job_credentials_operations import JobCredentialsOperations +from .operations.job_executions_operations import JobExecutionsOperations +from .operations.jobs_operations import JobsOperations +from .operations.job_step_executions_operations import JobStepExecutionsOperations +from .operations.job_steps_operations import JobStepsOperations +from .operations.job_target_executions_operations import JobTargetExecutionsOperations +from .operations.job_target_groups_operations import JobTargetGroupsOperations +from .operations.job_versions_operations import JobVersionsOperations from .operations.long_term_retention_backups_operations import LongTermRetentionBackupsOperations from .operations.backup_long_term_retention_policies_operations import BackupLongTermRetentionPoliciesOperations from .operations.managed_databases_operations import ManagedDatabasesOperations @@ -57,6 +68,7 @@ from .operations.database_operations import DatabaseOperations from .operations.elastic_pool_operations import ElasticPoolOperations from .operations.capabilities_operations import CapabilitiesOperations +from .operations.database_vulnerability_assessment_scans_operations import DatabaseVulnerabilityAssessmentScansOperations from .operations.instance_failover_groups_operations import InstanceFailoverGroupsOperations from .operations.short_term_retention_policies_operations import ShortTermRetentionPoliciesOperations from . import models @@ -171,6 +183,28 @@ class SqlManagementClient(SDKClient): :vartype subscription_usages: azure.mgmt.sql.operations.SubscriptionUsagesOperations :ivar virtual_network_rules: VirtualNetworkRules operations :vartype virtual_network_rules: azure.mgmt.sql.operations.VirtualNetworkRulesOperations + :ivar database_vulnerability_assessment_rule_baselines: DatabaseVulnerabilityAssessmentRuleBaselines operations + :vartype database_vulnerability_assessment_rule_baselines: azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations + :ivar database_vulnerability_assessments: DatabaseVulnerabilityAssessments operations + :vartype database_vulnerability_assessments: azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations + :ivar job_agents: JobAgents operations + :vartype job_agents: azure.mgmt.sql.operations.JobAgentsOperations + :ivar job_credentials: JobCredentials operations + :vartype job_credentials: azure.mgmt.sql.operations.JobCredentialsOperations + :ivar job_executions: JobExecutions operations + :vartype job_executions: azure.mgmt.sql.operations.JobExecutionsOperations + :ivar jobs: Jobs operations + :vartype jobs: azure.mgmt.sql.operations.JobsOperations + :ivar job_step_executions: JobStepExecutions operations + :vartype job_step_executions: azure.mgmt.sql.operations.JobStepExecutionsOperations + :ivar job_steps: JobSteps operations + :vartype job_steps: azure.mgmt.sql.operations.JobStepsOperations + :ivar job_target_executions: JobTargetExecutions operations + :vartype job_target_executions: azure.mgmt.sql.operations.JobTargetExecutionsOperations + :ivar job_target_groups: JobTargetGroups operations + :vartype job_target_groups: azure.mgmt.sql.operations.JobTargetGroupsOperations + :ivar job_versions: JobVersions operations + :vartype job_versions: azure.mgmt.sql.operations.JobVersionsOperations :ivar long_term_retention_backups: LongTermRetentionBackups operations :vartype long_term_retention_backups: azure.mgmt.sql.operations.LongTermRetentionBackupsOperations :ivar backup_long_term_retention_policies: BackupLongTermRetentionPolicies operations @@ -189,6 +223,8 @@ class SqlManagementClient(SDKClient): :vartype elastic_pool_operations: azure.mgmt.sql.operations.ElasticPoolOperations :ivar capabilities: Capabilities operations :vartype capabilities: azure.mgmt.sql.operations.CapabilitiesOperations + :ivar database_vulnerability_assessment_scans: DatabaseVulnerabilityAssessmentScans operations + :vartype database_vulnerability_assessment_scans: azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations :ivar instance_failover_groups: InstanceFailoverGroups operations :vartype instance_failover_groups: azure.mgmt.sql.operations.InstanceFailoverGroupsOperations :ivar short_term_retention_policies: ShortTermRetentionPolicies operations @@ -283,6 +319,28 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.virtual_network_rules = VirtualNetworkRulesOperations( self._client, self.config, self._serialize, self._deserialize) + self.database_vulnerability_assessment_rule_baselines = DatabaseVulnerabilityAssessmentRuleBaselinesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.database_vulnerability_assessments = DatabaseVulnerabilityAssessmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.job_agents = JobAgentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.job_credentials = JobCredentialsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.job_executions = JobExecutionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.job_step_executions = JobStepExecutionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.job_steps = JobStepsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.job_target_executions = JobTargetExecutionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.job_target_groups = JobTargetGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.job_versions = JobVersionsOperations( + self._client, self.config, self._serialize, self._deserialize) self.long_term_retention_backups = LongTermRetentionBackupsOperations( self._client, self.config, self._serialize, self._deserialize) self.backup_long_term_retention_policies = BackupLongTermRetentionPoliciesOperations( @@ -301,6 +359,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.capabilities = CapabilitiesOperations( self._client, self.config, self._serialize, self._deserialize) + self.database_vulnerability_assessment_scans = DatabaseVulnerabilityAssessmentScansOperations( + self._client, self.config, self._serialize, self._deserialize) self.instance_failover_groups = InstanceFailoverGroupsOperations( self._client, self.config, self._serialize, self._deserialize) self.short_term_retention_policies = ShortTermRetentionPoliciesOperations( From 405813da500458771a80ebcf5d58b1fae83edefd Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 23 May 2018 21:12:05 +0000 Subject: [PATCH 2/2] Generated from 839446dd054ae837881ba5f11e54779782dde49d Update readme.md --- .../azure/mgmt/sql/models/__init__.py | 74 --- azure-mgmt-sql/azure/mgmt/sql/models/job.py | 56 -- .../azure/mgmt/sql/models/job_agent.py | 67 -- .../azure/mgmt/sql/models/job_agent_paged.py | 27 - .../azure/mgmt/sql/models/job_agent_py3.py | 67 -- .../azure/mgmt/sql/models/job_agent_update.py | 28 - .../mgmt/sql/models/job_agent_update_py3.py | 28 - .../azure/mgmt/sql/models/job_credential.py | 55 -- .../mgmt/sql/models/job_credential_paged.py | 27 - .../mgmt/sql/models/job_credential_py3.py | 55 -- .../azure/mgmt/sql/models/job_execution.py | 113 ---- .../mgmt/sql/models/job_execution_paged.py | 27 - .../mgmt/sql/models/job_execution_py3.py | 113 ---- .../mgmt/sql/models/job_execution_target.py | 46 -- .../sql/models/job_execution_target_py3.py | 46 -- .../azure/mgmt/sql/models/job_paged.py | 27 - .../azure/mgmt/sql/models/job_py3.py | 56 -- .../azure/mgmt/sql/models/job_schedule.py | 48 -- .../azure/mgmt/sql/models/job_schedule_py3.py | 48 -- .../azure/mgmt/sql/models/job_step.py | 75 --- .../azure/mgmt/sql/models/job_step_action.py | 45 -- .../mgmt/sql/models/job_step_action_py3.py | 45 -- .../sql/models/job_step_execution_options.py | 49 -- .../models/job_step_execution_options_py3.py | 49 -- .../azure/mgmt/sql/models/job_step_output.py | 67 -- .../mgmt/sql/models/job_step_output_py3.py | 67 -- .../azure/mgmt/sql/models/job_step_paged.py | 27 - .../azure/mgmt/sql/models/job_step_py3.py | 75 --- .../azure/mgmt/sql/models/job_target.py | 65 -- .../azure/mgmt/sql/models/job_target_group.py | 49 -- .../mgmt/sql/models/job_target_group_paged.py | 27 - .../mgmt/sql/models/job_target_group_py3.py | 49 -- .../azure/mgmt/sql/models/job_target_py3.py | 65 -- .../azure/mgmt/sql/models/job_version.py | 42 -- .../mgmt/sql/models/job_version_paged.py | 27 - .../azure/mgmt/sql/models/job_version_py3.py | 42 -- .../sql/models/sql_management_client_enums.py | 68 -- .../azure/mgmt/sql/operations/__init__.py | 18 - .../sql/operations/job_agents_operations.py | 483 -------------- .../operations/job_credentials_operations.py | 328 ---------- .../operations/job_executions_operations.py | 612 ------------------ .../job_step_executions_operations.py | 229 ------- .../sql/operations/job_steps_operations.py | 495 -------------- .../job_target_executions_operations.py | 350 ---------- .../job_target_groups_operations.py | 326 ---------- .../sql/operations/job_versions_operations.py | 190 ------ .../mgmt/sql/operations/jobs_operations.py | 327 ---------- .../azure/mgmt/sql/sql_management_client.py | 45 -- 48 files changed, 5344 deletions(-) delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_agent.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_agent_paged.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_agent_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_credential.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_credential_paged.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_credential_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_execution.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_execution_paged.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_execution_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_paged.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_schedule.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_schedule_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_action.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_action_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_output.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_output_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_paged.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_step_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_target.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_target_group.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_paged.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_target_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_version.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_version_paged.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/job_version_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_agents_operations.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_credentials_operations.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_executions_operations.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_step_executions_operations.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_steps_operations.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_target_executions_operations.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_target_groups_operations.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/job_versions_operations.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/jobs_operations.py diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index f088c63870d9..8a906d96f6af 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py @@ -85,20 +85,6 @@ from .database_vulnerability_assessment_rule_baseline_py3 import DatabaseVulnerabilityAssessmentRuleBaseline from .vulnerability_assessment_recurring_scans_properties_py3 import VulnerabilityAssessmentRecurringScansProperties from .database_vulnerability_assessment_py3 import DatabaseVulnerabilityAssessment - from .job_agent_py3 import JobAgent - from .job_agent_update_py3 import JobAgentUpdate - from .job_credential_py3 import JobCredential - from .job_execution_target_py3 import JobExecutionTarget - from .job_execution_py3 import JobExecution - from .job_schedule_py3 import JobSchedule - from .job_py3 import Job - from .job_step_action_py3 import JobStepAction - from .job_step_output_py3 import JobStepOutput - from .job_step_execution_options_py3 import JobStepExecutionOptions - from .job_step_py3 import JobStep - from .job_target_py3 import JobTarget - from .job_target_group_py3 import JobTargetGroup - from .job_version_py3 import JobVersion from .long_term_retention_backup_py3 import LongTermRetentionBackup from .backup_long_term_retention_policy_py3 import BackupLongTermRetentionPolicy from .complete_database_restore_definition_py3 import CompleteDatabaseRestoreDefinition @@ -220,20 +206,6 @@ from .database_vulnerability_assessment_rule_baseline import DatabaseVulnerabilityAssessmentRuleBaseline from .vulnerability_assessment_recurring_scans_properties import VulnerabilityAssessmentRecurringScansProperties from .database_vulnerability_assessment import DatabaseVulnerabilityAssessment - from .job_agent import JobAgent - from .job_agent_update import JobAgentUpdate - from .job_credential import JobCredential - from .job_execution_target import JobExecutionTarget - from .job_execution import JobExecution - from .job_schedule import JobSchedule - from .job import Job - from .job_step_action import JobStepAction - from .job_step_output import JobStepOutput - from .job_step_execution_options import JobStepExecutionOptions - from .job_step import JobStep - from .job_target import JobTarget - from .job_target_group import JobTargetGroup - from .job_version import JobVersion from .long_term_retention_backup import LongTermRetentionBackup from .backup_long_term_retention_policy import BackupLongTermRetentionPolicy from .complete_database_restore_definition import CompleteDatabaseRestoreDefinition @@ -315,13 +287,6 @@ from .sync_member_paged import SyncMemberPaged from .subscription_usage_paged import SubscriptionUsagePaged from .virtual_network_rule_paged import VirtualNetworkRulePaged -from .job_agent_paged import JobAgentPaged -from .job_credential_paged import JobCredentialPaged -from .job_execution_paged import JobExecutionPaged -from .job_paged import JobPaged -from .job_step_paged import JobStepPaged -from .job_target_group_paged import JobTargetGroupPaged -from .job_version_paged import JobVersionPaged from .long_term_retention_backup_paged import LongTermRetentionBackupPaged from .managed_database_paged import ManagedDatabasePaged from .server_dns_alias_paged import ServerDnsAliasPaged @@ -374,15 +339,6 @@ SyncDirection, SyncMemberState, VirtualNetworkRuleState, - JobAgentState, - JobExecutionLifecycle, - ProvisioningState, - JobTargetType, - JobScheduleType, - JobStepActionType, - JobStepActionSource, - JobStepOutputType, - JobTargetGroupMembershipType, ManagedDatabaseStatus, CatalogCollationType, ManagedDatabaseCreateMode, @@ -484,20 +440,6 @@ 'DatabaseVulnerabilityAssessmentRuleBaseline', 'VulnerabilityAssessmentRecurringScansProperties', 'DatabaseVulnerabilityAssessment', - 'JobAgent', - 'JobAgentUpdate', - 'JobCredential', - 'JobExecutionTarget', - 'JobExecution', - 'JobSchedule', - 'Job', - 'JobStepAction', - 'JobStepOutput', - 'JobStepExecutionOptions', - 'JobStep', - 'JobTarget', - 'JobTargetGroup', - 'JobVersion', 'LongTermRetentionBackup', 'BackupLongTermRetentionPolicy', 'CompleteDatabaseRestoreDefinition', @@ -579,13 +521,6 @@ 'SyncMemberPaged', 'SubscriptionUsagePaged', 'VirtualNetworkRulePaged', - 'JobAgentPaged', - 'JobCredentialPaged', - 'JobExecutionPaged', - 'JobPaged', - 'JobStepPaged', - 'JobTargetGroupPaged', - 'JobVersionPaged', 'LongTermRetentionBackupPaged', 'ManagedDatabasePaged', 'ServerDnsAliasPaged', @@ -637,15 +572,6 @@ 'SyncDirection', 'SyncMemberState', 'VirtualNetworkRuleState', - 'JobAgentState', - 'JobExecutionLifecycle', - 'ProvisioningState', - 'JobTargetType', - 'JobScheduleType', - 'JobStepActionType', - 'JobStepActionSource', - 'JobStepOutputType', - 'JobTargetGroupMembershipType', 'ManagedDatabaseStatus', 'CatalogCollationType', 'ManagedDatabaseCreateMode', diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job.py b/azure-mgmt-sql/azure/mgmt/sql/models/job.py deleted file mode 100644 index 6b2c60fd1d4b..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 .proxy_resource import ProxyResource - - -class Job(ProxyResource): - """A job. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param description: User-defined description of the job. Default value: "" - . - :type description: str - :ivar version: The job version number. - :vartype version: int - :param schedule: Schedule properties of the job. - :type schedule: ~azure.mgmt.sql.models.JobSchedule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'int'}, - 'schedule': {'key': 'properties.schedule', 'type': 'JobSchedule'}, - } - - def __init__(self, **kwargs): - super(Job, self).__init__(**kwargs) - self.description = kwargs.get('description', "") - self.version = None - self.schedule = kwargs.get('schedule', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_agent.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_agent.py deleted file mode 100644 index 3cb0df4642c4..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_agent.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 .tracked_resource import TrackedResource - - -class JobAgent(TrackedResource): - """An Azure SQL job agent. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. Resource location. - :type location: str - :param sku: The name and tier of the SKU. - :type sku: ~azure.mgmt.sql.models.Sku - :param database_id: Required. Resource ID of the database to store job - metadata in. - :type database_id: str - :ivar state: The state of the job agent. Possible values include: - 'Creating', 'Ready', 'Updating', 'Deleting', 'Disabled' - :vartype state: str or ~azure.mgmt.sql.models.JobAgentState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'database_id': {'required': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'database_id': {'key': 'properties.databaseId', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(JobAgent, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.database_id = kwargs.get('database_id', None) - self.state = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_paged.py deleted file mode 100644 index 25dd750b9d1f..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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.paging import Paged - - -class JobAgentPaged(Paged): - """ - A paging container for iterating over a list of :class:`JobAgent ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[JobAgent]'} - } - - def __init__(self, *args, **kwargs): - - super(JobAgentPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_py3.py deleted file mode 100644 index 4a2fa86da554..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 .tracked_resource_py3 import TrackedResource - - -class JobAgent(TrackedResource): - """An Azure SQL job agent. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. Resource location. - :type location: str - :param sku: The name and tier of the SKU. - :type sku: ~azure.mgmt.sql.models.Sku - :param database_id: Required. Resource ID of the database to store job - metadata in. - :type database_id: str - :ivar state: The state of the job agent. Possible values include: - 'Creating', 'Ready', 'Updating', 'Deleting', 'Disabled' - :vartype state: str or ~azure.mgmt.sql.models.JobAgentState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'database_id': {'required': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'database_id': {'key': 'properties.databaseId', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, *, location: str, database_id: str, tags=None, sku=None, **kwargs) -> None: - super(JobAgent, self).__init__(tags=tags, location=location, **kwargs) - self.sku = sku - self.database_id = database_id - self.state = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update.py deleted file mode 100644 index af781de91cbf..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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.serialization import Model - - -class JobAgentUpdate(Model): - """An update to an Azure SQL job agent. - - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(JobAgentUpdate, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update_py3.py deleted file mode 100644 index ab5e71f7b1d1..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_agent_update_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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.serialization import Model - - -class JobAgentUpdate(Model): - """An update to an Azure SQL job agent. - - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(JobAgentUpdate, self).__init__(**kwargs) - self.tags = tags diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_credential.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_credential.py deleted file mode 100644 index 807d34975114..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_credential.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 .proxy_resource import ProxyResource - - -class JobCredential(ProxyResource): - """A stored credential that can be used by a job to connect to target - databases. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param username: Required. The credential user name. - :type username: str - :param password: Required. The credential password. - :type password: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'username': {'required': True}, - 'password': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'username': {'key': 'properties.username', 'type': 'str'}, - 'password': {'key': 'properties.password', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(JobCredential, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_credential_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_credential_paged.py deleted file mode 100644 index 550108e41c93..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_credential_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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.paging import Paged - - -class JobCredentialPaged(Paged): - """ - A paging container for iterating over a list of :class:`JobCredential ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[JobCredential]'} - } - - def __init__(self, *args, **kwargs): - - super(JobCredentialPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_credential_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_credential_py3.py deleted file mode 100644 index 5158010b9c74..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_credential_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 .proxy_resource_py3 import ProxyResource - - -class JobCredential(ProxyResource): - """A stored credential that can be used by a job to connect to target - databases. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param username: Required. The credential user name. - :type username: str - :param password: Required. The credential password. - :type password: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'username': {'required': True}, - 'password': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'username': {'key': 'properties.username', 'type': 'str'}, - 'password': {'key': 'properties.password', 'type': 'str'}, - } - - def __init__(self, *, username: str, password: str, **kwargs) -> None: - super(JobCredential, self).__init__(**kwargs) - self.username = username - self.password = password diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_execution.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_execution.py deleted file mode 100644 index 92744fb7c75b..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_execution.py +++ /dev/null @@ -1,113 +0,0 @@ -# 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 .proxy_resource import ProxyResource - - -class JobExecution(ProxyResource): - """An execution of a job. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar job_version: The job version number. - :vartype job_version: int - :ivar step_name: The job step name. - :vartype step_name: str - :ivar step_id: The job step id. - :vartype step_id: int - :ivar job_execution_id: The unique identifier of the job execution. - :vartype job_execution_id: str - :ivar lifecycle: The detailed state of the job execution. Possible values - include: 'Created', 'InProgress', 'WaitingForChildJobExecutions', - 'WaitingForRetry', 'Succeeded', 'SucceededWithSkipped', 'Failed', - 'TimedOut', 'Canceled', 'Skipped' - :vartype lifecycle: str or ~azure.mgmt.sql.models.JobExecutionLifecycle - :ivar provisioning_state: The ARM provisioning state of the job execution. - Possible values include: 'Created', 'InProgress', 'Succeeded', 'Failed', - 'Canceled' - :vartype provisioning_state: str or - ~azure.mgmt.sql.models.ProvisioningState - :ivar create_time: The time that the job execution was created. - :vartype create_time: datetime - :ivar start_time: The time that the job execution started. - :vartype start_time: datetime - :ivar end_time: The time that the job execution completed. - :vartype end_time: datetime - :param current_attempts: Number of times the job execution has been - attempted. - :type current_attempts: int - :ivar current_attempt_start_time: Start time of the current attempt. - :vartype current_attempt_start_time: datetime - :ivar last_message: The last status or error message. - :vartype last_message: str - :ivar target: The target that this execution is executed on. - :vartype target: ~azure.mgmt.sql.models.JobExecutionTarget - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'job_version': {'readonly': True}, - 'step_name': {'readonly': True}, - 'step_id': {'readonly': True}, - 'job_execution_id': {'readonly': True}, - 'lifecycle': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'create_time': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'current_attempt_start_time': {'readonly': True}, - 'last_message': {'readonly': True}, - 'target': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'job_version': {'key': 'properties.jobVersion', 'type': 'int'}, - 'step_name': {'key': 'properties.stepName', 'type': 'str'}, - 'step_id': {'key': 'properties.stepId', 'type': 'int'}, - 'job_execution_id': {'key': 'properties.jobExecutionId', 'type': 'str'}, - 'lifecycle': {'key': 'properties.lifecycle', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, - 'current_attempts': {'key': 'properties.currentAttempts', 'type': 'int'}, - 'current_attempt_start_time': {'key': 'properties.currentAttemptStartTime', 'type': 'iso-8601'}, - 'last_message': {'key': 'properties.lastMessage', 'type': 'str'}, - 'target': {'key': 'properties.target', 'type': 'JobExecutionTarget'}, - } - - def __init__(self, **kwargs): - super(JobExecution, self).__init__(**kwargs) - self.job_version = None - self.step_name = None - self.step_id = None - self.job_execution_id = None - self.lifecycle = None - self.provisioning_state = None - self.create_time = None - self.start_time = None - self.end_time = None - self.current_attempts = kwargs.get('current_attempts', None) - self.current_attempt_start_time = None - self.last_message = None - self.target = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_paged.py deleted file mode 100644 index bfcdb03ea9aa..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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.paging import Paged - - -class JobExecutionPaged(Paged): - """ - A paging container for iterating over a list of :class:`JobExecution ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[JobExecution]'} - } - - def __init__(self, *args, **kwargs): - - super(JobExecutionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_py3.py deleted file mode 100644 index b7fdaba7c147..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_py3.py +++ /dev/null @@ -1,113 +0,0 @@ -# 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 .proxy_resource_py3 import ProxyResource - - -class JobExecution(ProxyResource): - """An execution of a job. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar job_version: The job version number. - :vartype job_version: int - :ivar step_name: The job step name. - :vartype step_name: str - :ivar step_id: The job step id. - :vartype step_id: int - :ivar job_execution_id: The unique identifier of the job execution. - :vartype job_execution_id: str - :ivar lifecycle: The detailed state of the job execution. Possible values - include: 'Created', 'InProgress', 'WaitingForChildJobExecutions', - 'WaitingForRetry', 'Succeeded', 'SucceededWithSkipped', 'Failed', - 'TimedOut', 'Canceled', 'Skipped' - :vartype lifecycle: str or ~azure.mgmt.sql.models.JobExecutionLifecycle - :ivar provisioning_state: The ARM provisioning state of the job execution. - Possible values include: 'Created', 'InProgress', 'Succeeded', 'Failed', - 'Canceled' - :vartype provisioning_state: str or - ~azure.mgmt.sql.models.ProvisioningState - :ivar create_time: The time that the job execution was created. - :vartype create_time: datetime - :ivar start_time: The time that the job execution started. - :vartype start_time: datetime - :ivar end_time: The time that the job execution completed. - :vartype end_time: datetime - :param current_attempts: Number of times the job execution has been - attempted. - :type current_attempts: int - :ivar current_attempt_start_time: Start time of the current attempt. - :vartype current_attempt_start_time: datetime - :ivar last_message: The last status or error message. - :vartype last_message: str - :ivar target: The target that this execution is executed on. - :vartype target: ~azure.mgmt.sql.models.JobExecutionTarget - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'job_version': {'readonly': True}, - 'step_name': {'readonly': True}, - 'step_id': {'readonly': True}, - 'job_execution_id': {'readonly': True}, - 'lifecycle': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'create_time': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'current_attempt_start_time': {'readonly': True}, - 'last_message': {'readonly': True}, - 'target': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'job_version': {'key': 'properties.jobVersion', 'type': 'int'}, - 'step_name': {'key': 'properties.stepName', 'type': 'str'}, - 'step_id': {'key': 'properties.stepId', 'type': 'int'}, - 'job_execution_id': {'key': 'properties.jobExecutionId', 'type': 'str'}, - 'lifecycle': {'key': 'properties.lifecycle', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, - 'current_attempts': {'key': 'properties.currentAttempts', 'type': 'int'}, - 'current_attempt_start_time': {'key': 'properties.currentAttemptStartTime', 'type': 'iso-8601'}, - 'last_message': {'key': 'properties.lastMessage', 'type': 'str'}, - 'target': {'key': 'properties.target', 'type': 'JobExecutionTarget'}, - } - - def __init__(self, *, current_attempts: int=None, **kwargs) -> None: - super(JobExecution, self).__init__(**kwargs) - self.job_version = None - self.step_name = None - self.step_id = None - self.job_execution_id = None - self.lifecycle = None - self.provisioning_state = None - self.create_time = None - self.start_time = None - self.end_time = None - self.current_attempts = current_attempts - self.current_attempt_start_time = None - self.last_message = None - self.target = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target.py deleted file mode 100644 index 50557aaf96d0..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.serialization import Model - - -class JobExecutionTarget(Model): - """The target that a job execution is executed on. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of the target. Possible values include: - 'TargetGroup', 'SqlDatabase', 'SqlElasticPool', 'SqlShardMap', 'SqlServer' - :vartype type: str or ~azure.mgmt.sql.models.JobTargetType - :ivar server_name: The server name. - :vartype server_name: str - :ivar database_name: The database name. - :vartype database_name: str - """ - - _validation = { - 'type': {'readonly': True}, - 'server_name': {'readonly': True}, - 'database_name': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'server_name': {'key': 'serverName', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(JobExecutionTarget, self).__init__(**kwargs) - self.type = None - self.server_name = None - self.database_name = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target_py3.py deleted file mode 100644 index 551716c3cd31..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_execution_target_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.serialization import Model - - -class JobExecutionTarget(Model): - """The target that a job execution is executed on. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of the target. Possible values include: - 'TargetGroup', 'SqlDatabase', 'SqlElasticPool', 'SqlShardMap', 'SqlServer' - :vartype type: str or ~azure.mgmt.sql.models.JobTargetType - :ivar server_name: The server name. - :vartype server_name: str - :ivar database_name: The database name. - :vartype database_name: str - """ - - _validation = { - 'type': {'readonly': True}, - 'server_name': {'readonly': True}, - 'database_name': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'server_name': {'key': 'serverName', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(JobExecutionTarget, self).__init__(**kwargs) - self.type = None - self.server_name = None - self.database_name = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_paged.py deleted file mode 100644 index 3b85770570f2..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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.paging import Paged - - -class JobPaged(Paged): - """ - A paging container for iterating over a list of :class:`Job ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Job]'} - } - - def __init__(self, *args, **kwargs): - - super(JobPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_py3.py deleted file mode 100644 index 5bfb9b53f03f..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 .proxy_resource_py3 import ProxyResource - - -class Job(ProxyResource): - """A job. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param description: User-defined description of the job. Default value: "" - . - :type description: str - :ivar version: The job version number. - :vartype version: int - :param schedule: Schedule properties of the job. - :type schedule: ~azure.mgmt.sql.models.JobSchedule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'version': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'int'}, - 'schedule': {'key': 'properties.schedule', 'type': 'JobSchedule'}, - } - - def __init__(self, *, description: str="", schedule=None, **kwargs) -> None: - super(Job, self).__init__(**kwargs) - self.description = description - self.version = None - self.schedule = schedule diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_schedule.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_schedule.py deleted file mode 100644 index 7fab31ef7b8c..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_schedule.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.serialization import Model - - -class JobSchedule(Model): - """Scheduling properties of a job. - - :param start_time: Schedule start time. Default value: - "0001-01-01T00:00:00Z" . - :type start_time: datetime - :param end_time: Schedule end time. Default value: "9999-12-31T11:59:59Z" - . - :type end_time: datetime - :param type: Schedule interval type. Possible values include: 'Once', - 'Recurring'. Default value: "Once" . - :type type: str or ~azure.mgmt.sql.models.JobScheduleType - :param enabled: Whether or not the schedule is enabled. - :type enabled: bool - :param interval: Value of the schedule's recurring interval, if the - scheduletype is recurring. ISO8601 duration format. - :type interval: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'type': {'key': 'type', 'type': 'JobScheduleType'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'interval': {'key': 'interval', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(JobSchedule, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', "0001-01-01T00:00:00Z") - self.end_time = kwargs.get('end_time', "9999-12-31T11:59:59Z") - self.type = kwargs.get('type', "Once") - self.enabled = kwargs.get('enabled', None) - self.interval = kwargs.get('interval', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_schedule_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_schedule_py3.py deleted file mode 100644 index 8c0cd37ebefe..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_schedule_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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.serialization import Model - - -class JobSchedule(Model): - """Scheduling properties of a job. - - :param start_time: Schedule start time. Default value: - "0001-01-01T00:00:00Z" . - :type start_time: datetime - :param end_time: Schedule end time. Default value: "9999-12-31T11:59:59Z" - . - :type end_time: datetime - :param type: Schedule interval type. Possible values include: 'Once', - 'Recurring'. Default value: "Once" . - :type type: str or ~azure.mgmt.sql.models.JobScheduleType - :param enabled: Whether or not the schedule is enabled. - :type enabled: bool - :param interval: Value of the schedule's recurring interval, if the - scheduletype is recurring. ISO8601 duration format. - :type interval: str - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'type': {'key': 'type', 'type': 'JobScheduleType'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'interval': {'key': 'interval', 'type': 'str'}, - } - - def __init__(self, *, start_time="0001-01-01T00:00:00Z", end_time="9999-12-31T11:59:59Z", type="Once", enabled: bool=None, interval: str=None, **kwargs) -> None: - super(JobSchedule, self).__init__(**kwargs) - self.start_time = start_time - self.end_time = end_time - self.type = type - self.enabled = enabled - self.interval = interval diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step.py deleted file mode 100644 index f032375dec32..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_step.py +++ /dev/null @@ -1,75 +0,0 @@ -# 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 .proxy_resource import ProxyResource - - -class JobStep(ProxyResource): - """A job step. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param step_id: The job step's index within the job. If not specified when - creating the job step, it will be created as the last step. If not - specified when updating the job step, the step id is not modified. - :type step_id: int - :param target_group: Required. The resource ID of the target group that - the job step will be executed on. - :type target_group: str - :param credential: Required. The resource ID of the job credential that - will be used to connect to the targets. - :type credential: str - :param action: Required. The action payload of the job step. - :type action: ~azure.mgmt.sql.models.JobStepAction - :param output: Output destination properties of the job step. - :type output: ~azure.mgmt.sql.models.JobStepOutput - :param execution_options: Execution options for the job step. - :type execution_options: ~azure.mgmt.sql.models.JobStepExecutionOptions - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'target_group': {'required': True}, - 'credential': {'required': True}, - 'action': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'step_id': {'key': 'properties.stepId', 'type': 'int'}, - 'target_group': {'key': 'properties.targetGroup', 'type': 'str'}, - 'credential': {'key': 'properties.credential', 'type': 'str'}, - 'action': {'key': 'properties.action', 'type': 'JobStepAction'}, - 'output': {'key': 'properties.output', 'type': 'JobStepOutput'}, - 'execution_options': {'key': 'properties.executionOptions', 'type': 'JobStepExecutionOptions'}, - } - - def __init__(self, **kwargs): - super(JobStep, self).__init__(**kwargs) - self.step_id = kwargs.get('step_id', None) - self.target_group = kwargs.get('target_group', None) - self.credential = kwargs.get('credential', None) - self.action = kwargs.get('action', None) - self.output = kwargs.get('output', None) - self.execution_options = kwargs.get('execution_options', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_action.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_action.py deleted file mode 100644 index 68e55b1fa38f..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_action.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.serialization import Model - - -class JobStepAction(Model): - """The action to be executed by a job step. - - All required parameters must be populated in order to send to Azure. - - :param type: Type of action being executed by the job step. Possible - values include: 'TSql'. Default value: "TSql" . - :type type: str or ~azure.mgmt.sql.models.JobStepActionType - :param source: The source of the action to execute. Possible values - include: 'Inline'. Default value: "Inline" . - :type source: str or ~azure.mgmt.sql.models.JobStepActionSource - :param value: Required. The action value, for example the text of the - T-SQL script to execute. - :type value: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(JobStepAction, self).__init__(**kwargs) - self.type = kwargs.get('type', "TSql") - self.source = kwargs.get('source', "Inline") - self.value = kwargs.get('value', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_action_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_action_py3.py deleted file mode 100644 index 4d8848c8eaef..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_action_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.serialization import Model - - -class JobStepAction(Model): - """The action to be executed by a job step. - - All required parameters must be populated in order to send to Azure. - - :param type: Type of action being executed by the job step. Possible - values include: 'TSql'. Default value: "TSql" . - :type type: str or ~azure.mgmt.sql.models.JobStepActionType - :param source: The source of the action to execute. Possible values - include: 'Inline'. Default value: "Inline" . - :type source: str or ~azure.mgmt.sql.models.JobStepActionSource - :param value: Required. The action value, for example the text of the - T-SQL script to execute. - :type value: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, *, value: str, type="TSql", source="Inline", **kwargs) -> None: - super(JobStepAction, self).__init__(**kwargs) - self.type = type - self.source = source - self.value = value diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options.py deleted file mode 100644 index 6a49f1d10f25..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.serialization import Model - - -class JobStepExecutionOptions(Model): - """The execution options of a job step. - - :param timeout_seconds: Execution timeout for the job step. Default value: - 43200 . - :type timeout_seconds: int - :param retry_attempts: Maximum number of times the job step will be - reattempted if the first attempt fails. Default value: 10 . - :type retry_attempts: int - :param initial_retry_interval_seconds: Initial delay between retries for - job step execution. Default value: 1 . - :type initial_retry_interval_seconds: int - :param maximum_retry_interval_seconds: The maximum amount of time to wait - between retries for job step execution. Default value: 120 . - :type maximum_retry_interval_seconds: int - :param retry_interval_backoff_multiplier: The backoff multiplier for the - time between retries. Default value: 2 . - :type retry_interval_backoff_multiplier: float - """ - - _attribute_map = { - 'timeout_seconds': {'key': 'timeoutSeconds', 'type': 'int'}, - 'retry_attempts': {'key': 'retryAttempts', 'type': 'int'}, - 'initial_retry_interval_seconds': {'key': 'initialRetryIntervalSeconds', 'type': 'int'}, - 'maximum_retry_interval_seconds': {'key': 'maximumRetryIntervalSeconds', 'type': 'int'}, - 'retry_interval_backoff_multiplier': {'key': 'retryIntervalBackoffMultiplier', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(JobStepExecutionOptions, self).__init__(**kwargs) - self.timeout_seconds = kwargs.get('timeout_seconds', 43200) - self.retry_attempts = kwargs.get('retry_attempts', 10) - self.initial_retry_interval_seconds = kwargs.get('initial_retry_interval_seconds', 1) - self.maximum_retry_interval_seconds = kwargs.get('maximum_retry_interval_seconds', 120) - self.retry_interval_backoff_multiplier = kwargs.get('retry_interval_backoff_multiplier', 2) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options_py3.py deleted file mode 100644 index 712f0e947436..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_execution_options_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.serialization import Model - - -class JobStepExecutionOptions(Model): - """The execution options of a job step. - - :param timeout_seconds: Execution timeout for the job step. Default value: - 43200 . - :type timeout_seconds: int - :param retry_attempts: Maximum number of times the job step will be - reattempted if the first attempt fails. Default value: 10 . - :type retry_attempts: int - :param initial_retry_interval_seconds: Initial delay between retries for - job step execution. Default value: 1 . - :type initial_retry_interval_seconds: int - :param maximum_retry_interval_seconds: The maximum amount of time to wait - between retries for job step execution. Default value: 120 . - :type maximum_retry_interval_seconds: int - :param retry_interval_backoff_multiplier: The backoff multiplier for the - time between retries. Default value: 2 . - :type retry_interval_backoff_multiplier: float - """ - - _attribute_map = { - 'timeout_seconds': {'key': 'timeoutSeconds', 'type': 'int'}, - 'retry_attempts': {'key': 'retryAttempts', 'type': 'int'}, - 'initial_retry_interval_seconds': {'key': 'initialRetryIntervalSeconds', 'type': 'int'}, - 'maximum_retry_interval_seconds': {'key': 'maximumRetryIntervalSeconds', 'type': 'int'}, - 'retry_interval_backoff_multiplier': {'key': 'retryIntervalBackoffMultiplier', 'type': 'float'}, - } - - def __init__(self, *, timeout_seconds: int=43200, retry_attempts: int=10, initial_retry_interval_seconds: int=1, maximum_retry_interval_seconds: int=120, retry_interval_backoff_multiplier: float=2, **kwargs) -> None: - super(JobStepExecutionOptions, self).__init__(**kwargs) - self.timeout_seconds = timeout_seconds - self.retry_attempts = retry_attempts - self.initial_retry_interval_seconds = initial_retry_interval_seconds - self.maximum_retry_interval_seconds = maximum_retry_interval_seconds - self.retry_interval_backoff_multiplier = retry_interval_backoff_multiplier diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_output.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_output.py deleted file mode 100644 index 8a015a7505bd..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_output.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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.serialization import Model - - -class JobStepOutput(Model): - """The output configuration of a job step. - - All required parameters must be populated in order to send to Azure. - - :param type: The output destination type. Possible values include: - 'SqlDatabase'. Default value: "SqlDatabase" . - :type type: str or ~azure.mgmt.sql.models.JobStepOutputType - :param subscription_id: The output destination subscription id. - :type subscription_id: str - :param resource_group_name: The output destination resource group. - :type resource_group_name: str - :param server_name: Required. The output destination server name. - :type server_name: str - :param database_name: Required. The output destination database. - :type database_name: str - :param schema_name: The output destination schema. Default value: "dbo" . - :type schema_name: str - :param table_name: Required. The output destination table. - :type table_name: str - :param credential: Required. The resource ID of the credential to use to - connect to the output destination. - :type credential: str - """ - - _validation = { - 'server_name': {'required': True}, - 'database_name': {'required': True}, - 'table_name': {'required': True}, - 'credential': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, - 'server_name': {'key': 'serverName', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'schema_name': {'key': 'schemaName', 'type': 'str'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(JobStepOutput, self).__init__(**kwargs) - self.type = kwargs.get('type', "SqlDatabase") - self.subscription_id = kwargs.get('subscription_id', None) - self.resource_group_name = kwargs.get('resource_group_name', None) - self.server_name = kwargs.get('server_name', None) - self.database_name = kwargs.get('database_name', None) - self.schema_name = kwargs.get('schema_name', "dbo") - self.table_name = kwargs.get('table_name', None) - self.credential = kwargs.get('credential', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_output_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_output_py3.py deleted file mode 100644 index d10ecbbd6f8c..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_output_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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.serialization import Model - - -class JobStepOutput(Model): - """The output configuration of a job step. - - All required parameters must be populated in order to send to Azure. - - :param type: The output destination type. Possible values include: - 'SqlDatabase'. Default value: "SqlDatabase" . - :type type: str or ~azure.mgmt.sql.models.JobStepOutputType - :param subscription_id: The output destination subscription id. - :type subscription_id: str - :param resource_group_name: The output destination resource group. - :type resource_group_name: str - :param server_name: Required. The output destination server name. - :type server_name: str - :param database_name: Required. The output destination database. - :type database_name: str - :param schema_name: The output destination schema. Default value: "dbo" . - :type schema_name: str - :param table_name: Required. The output destination table. - :type table_name: str - :param credential: Required. The resource ID of the credential to use to - connect to the output destination. - :type credential: str - """ - - _validation = { - 'server_name': {'required': True}, - 'database_name': {'required': True}, - 'table_name': {'required': True}, - 'credential': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, - 'server_name': {'key': 'serverName', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'schema_name': {'key': 'schemaName', 'type': 'str'}, - 'table_name': {'key': 'tableName', 'type': 'str'}, - 'credential': {'key': 'credential', 'type': 'str'}, - } - - def __init__(self, *, server_name: str, database_name: str, table_name: str, credential: str, type="SqlDatabase", subscription_id: str=None, resource_group_name: str=None, schema_name: str="dbo", **kwargs) -> None: - super(JobStepOutput, self).__init__(**kwargs) - self.type = type - self.subscription_id = subscription_id - self.resource_group_name = resource_group_name - self.server_name = server_name - self.database_name = database_name - self.schema_name = schema_name - self.table_name = table_name - self.credential = credential diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_paged.py deleted file mode 100644 index 1bda4f5adf6e..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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.paging import Paged - - -class JobStepPaged(Paged): - """ - A paging container for iterating over a list of :class:`JobStep ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[JobStep]'} - } - - def __init__(self, *args, **kwargs): - - super(JobStepPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_step_py3.py deleted file mode 100644 index bd267f9fd9a6..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_step_py3.py +++ /dev/null @@ -1,75 +0,0 @@ -# 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 .proxy_resource_py3 import ProxyResource - - -class JobStep(ProxyResource): - """A job step. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param step_id: The job step's index within the job. If not specified when - creating the job step, it will be created as the last step. If not - specified when updating the job step, the step id is not modified. - :type step_id: int - :param target_group: Required. The resource ID of the target group that - the job step will be executed on. - :type target_group: str - :param credential: Required. The resource ID of the job credential that - will be used to connect to the targets. - :type credential: str - :param action: Required. The action payload of the job step. - :type action: ~azure.mgmt.sql.models.JobStepAction - :param output: Output destination properties of the job step. - :type output: ~azure.mgmt.sql.models.JobStepOutput - :param execution_options: Execution options for the job step. - :type execution_options: ~azure.mgmt.sql.models.JobStepExecutionOptions - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'target_group': {'required': True}, - 'credential': {'required': True}, - 'action': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'step_id': {'key': 'properties.stepId', 'type': 'int'}, - 'target_group': {'key': 'properties.targetGroup', 'type': 'str'}, - 'credential': {'key': 'properties.credential', 'type': 'str'}, - 'action': {'key': 'properties.action', 'type': 'JobStepAction'}, - 'output': {'key': 'properties.output', 'type': 'JobStepOutput'}, - 'execution_options': {'key': 'properties.executionOptions', 'type': 'JobStepExecutionOptions'}, - } - - def __init__(self, *, target_group: str, credential: str, action, step_id: int=None, output=None, execution_options=None, **kwargs) -> None: - super(JobStep, self).__init__(**kwargs) - self.step_id = step_id - self.target_group = target_group - self.credential = credential - self.action = action - self.output = output - self.execution_options = execution_options diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_target.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_target.py deleted file mode 100644 index a608d87c1af1..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_target.py +++ /dev/null @@ -1,65 +0,0 @@ -# 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.serialization import Model - - -class JobTarget(Model): - """A job target, for example a specific database or a container of databases - that is evaluated during job execution. - - All required parameters must be populated in order to send to Azure. - - :param membership_type: Whether the target is included or excluded from - the group. Possible values include: 'Include', 'Exclude'. Default value: - "Include" . - :type membership_type: str or - ~azure.mgmt.sql.models.JobTargetGroupMembershipType - :param type: Required. The target type. Possible values include: - 'TargetGroup', 'SqlDatabase', 'SqlElasticPool', 'SqlShardMap', 'SqlServer' - :type type: str or ~azure.mgmt.sql.models.JobTargetType - :param server_name: The target server name. - :type server_name: str - :param database_name: The target database name. - :type database_name: str - :param elastic_pool_name: The target elastic pool name. - :type elastic_pool_name: str - :param shard_map_name: The target shard map. - :type shard_map_name: str - :param refresh_credential: The resource ID of the credential that is used - during job execution to connect to the target and determine the list of - databases inside the target. - :type refresh_credential: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'membership_type': {'key': 'membershipType', 'type': 'JobTargetGroupMembershipType'}, - 'type': {'key': 'type', 'type': 'str'}, - 'server_name': {'key': 'serverName', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'elastic_pool_name': {'key': 'elasticPoolName', 'type': 'str'}, - 'shard_map_name': {'key': 'shardMapName', 'type': 'str'}, - 'refresh_credential': {'key': 'refreshCredential', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(JobTarget, self).__init__(**kwargs) - self.membership_type = kwargs.get('membership_type', "Include") - self.type = kwargs.get('type', None) - self.server_name = kwargs.get('server_name', None) - self.database_name = kwargs.get('database_name', None) - self.elastic_pool_name = kwargs.get('elastic_pool_name', None) - self.shard_map_name = kwargs.get('shard_map_name', None) - self.refresh_credential = kwargs.get('refresh_credential', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group.py deleted file mode 100644 index 38148fb244c4..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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 .proxy_resource import ProxyResource - - -class JobTargetGroup(ProxyResource): - """A group of job targets. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param members: Required. Members of the target group. - :type members: list[~azure.mgmt.sql.models.JobTarget] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'members': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'members': {'key': 'properties.members', 'type': '[JobTarget]'}, - } - - def __init__(self, **kwargs): - super(JobTargetGroup, self).__init__(**kwargs) - self.members = kwargs.get('members', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_paged.py deleted file mode 100644 index cd466e5afa84..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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.paging import Paged - - -class JobTargetGroupPaged(Paged): - """ - A paging container for iterating over a list of :class:`JobTargetGroup ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[JobTargetGroup]'} - } - - def __init__(self, *args, **kwargs): - - super(JobTargetGroupPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_py3.py deleted file mode 100644 index a9582212ff82..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_target_group_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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 .proxy_resource_py3 import ProxyResource - - -class JobTargetGroup(ProxyResource): - """A group of job targets. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param members: Required. Members of the target group. - :type members: list[~azure.mgmt.sql.models.JobTarget] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'members': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'members': {'key': 'properties.members', 'type': '[JobTarget]'}, - } - - def __init__(self, *, members, **kwargs) -> None: - super(JobTargetGroup, self).__init__(**kwargs) - self.members = members diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_target_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_target_py3.py deleted file mode 100644 index 281eb7598f18..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_target_py3.py +++ /dev/null @@ -1,65 +0,0 @@ -# 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.serialization import Model - - -class JobTarget(Model): - """A job target, for example a specific database or a container of databases - that is evaluated during job execution. - - All required parameters must be populated in order to send to Azure. - - :param membership_type: Whether the target is included or excluded from - the group. Possible values include: 'Include', 'Exclude'. Default value: - "Include" . - :type membership_type: str or - ~azure.mgmt.sql.models.JobTargetGroupMembershipType - :param type: Required. The target type. Possible values include: - 'TargetGroup', 'SqlDatabase', 'SqlElasticPool', 'SqlShardMap', 'SqlServer' - :type type: str or ~azure.mgmt.sql.models.JobTargetType - :param server_name: The target server name. - :type server_name: str - :param database_name: The target database name. - :type database_name: str - :param elastic_pool_name: The target elastic pool name. - :type elastic_pool_name: str - :param shard_map_name: The target shard map. - :type shard_map_name: str - :param refresh_credential: The resource ID of the credential that is used - during job execution to connect to the target and determine the list of - databases inside the target. - :type refresh_credential: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'membership_type': {'key': 'membershipType', 'type': 'JobTargetGroupMembershipType'}, - 'type': {'key': 'type', 'type': 'str'}, - 'server_name': {'key': 'serverName', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'elastic_pool_name': {'key': 'elasticPoolName', 'type': 'str'}, - 'shard_map_name': {'key': 'shardMapName', 'type': 'str'}, - 'refresh_credential': {'key': 'refreshCredential', 'type': 'str'}, - } - - def __init__(self, *, type, membership_type="Include", server_name: str=None, database_name: str=None, elastic_pool_name: str=None, shard_map_name: str=None, refresh_credential: str=None, **kwargs) -> None: - super(JobTarget, self).__init__(**kwargs) - self.membership_type = membership_type - self.type = type - self.server_name = server_name - self.database_name = database_name - self.elastic_pool_name = elastic_pool_name - self.shard_map_name = shard_map_name - self.refresh_credential = refresh_credential diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_version.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_version.py deleted file mode 100644 index 3c480e739607..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_version.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 .proxy_resource import ProxyResource - - -class JobVersion(ProxyResource): - """A job version. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(JobVersion, self).__init__(**kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_version_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_version_paged.py deleted file mode 100644 index 162e4d8cfb5e..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_version_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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.paging import Paged - - -class JobVersionPaged(Paged): - """ - A paging container for iterating over a list of :class:`JobVersion ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[JobVersion]'} - } - - def __init__(self, *args, **kwargs): - - super(JobVersionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/job_version_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/job_version_py3.py deleted file mode 100644 index 16a8798c5949..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/job_version_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 .proxy_resource_py3 import ProxyResource - - -class JobVersion(ProxyResource): - """A job version. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(JobVersion, self).__init__(**kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py b/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py index e4a76e0f84e5..a9155eeb23f8 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py @@ -411,74 +411,6 @@ class VirtualNetworkRuleState(str, Enum): unknown = "Unknown" -class JobAgentState(str, Enum): - - creating = "Creating" - ready = "Ready" - updating = "Updating" - deleting = "Deleting" - disabled = "Disabled" - - -class JobExecutionLifecycle(str, Enum): - - created = "Created" - in_progress = "InProgress" - waiting_for_child_job_executions = "WaitingForChildJobExecutions" - waiting_for_retry = "WaitingForRetry" - succeeded = "Succeeded" - succeeded_with_skipped = "SucceededWithSkipped" - failed = "Failed" - timed_out = "TimedOut" - canceled = "Canceled" - skipped = "Skipped" - - -class ProvisioningState(str, Enum): - - created = "Created" - in_progress = "InProgress" - succeeded = "Succeeded" - failed = "Failed" - canceled = "Canceled" - - -class JobTargetType(str, Enum): - - target_group = "TargetGroup" - sql_database = "SqlDatabase" - sql_elastic_pool = "SqlElasticPool" - sql_shard_map = "SqlShardMap" - sql_server = "SqlServer" - - -class JobScheduleType(str, Enum): - - once = "Once" - recurring = "Recurring" - - -class JobStepActionType(str, Enum): - - tsql = "TSql" - - -class JobStepActionSource(str, Enum): - - inline = "Inline" - - -class JobStepOutputType(str, Enum): - - sql_database = "SqlDatabase" - - -class JobTargetGroupMembershipType(str, Enum): - - include = "Include" - exclude = "Exclude" - - class ManagedDatabaseStatus(str, Enum): online = "Online" diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py index b66a0f4ac2fd..40147522719e 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py @@ -46,15 +46,6 @@ from .virtual_network_rules_operations import VirtualNetworkRulesOperations from .database_vulnerability_assessment_rule_baselines_operations import DatabaseVulnerabilityAssessmentRuleBaselinesOperations from .database_vulnerability_assessments_operations import DatabaseVulnerabilityAssessmentsOperations -from .job_agents_operations import JobAgentsOperations -from .job_credentials_operations import JobCredentialsOperations -from .job_executions_operations import JobExecutionsOperations -from .jobs_operations import JobsOperations -from .job_step_executions_operations import JobStepExecutionsOperations -from .job_steps_operations import JobStepsOperations -from .job_target_executions_operations import JobTargetExecutionsOperations -from .job_target_groups_operations import JobTargetGroupsOperations -from .job_versions_operations import JobVersionsOperations from .long_term_retention_backups_operations import LongTermRetentionBackupsOperations from .backup_long_term_retention_policies_operations import BackupLongTermRetentionPoliciesOperations from .managed_databases_operations import ManagedDatabasesOperations @@ -106,15 +97,6 @@ 'VirtualNetworkRulesOperations', 'DatabaseVulnerabilityAssessmentRuleBaselinesOperations', 'DatabaseVulnerabilityAssessmentsOperations', - 'JobAgentsOperations', - 'JobCredentialsOperations', - 'JobExecutionsOperations', - 'JobsOperations', - 'JobStepExecutionsOperations', - 'JobStepsOperations', - 'JobTargetExecutionsOperations', - 'JobTargetGroupsOperations', - 'JobVersionsOperations', 'LongTermRetentionBackupsOperations', 'BackupLongTermRetentionPoliciesOperations', 'ManagedDatabasesOperations', diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_agents_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_agents_operations.py deleted file mode 100644 index 774fa59314ce..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/job_agents_operations.py +++ /dev/null @@ -1,483 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class JobAgentsOperations(object): - """JobAgentsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-03-01-preview" - - self.config = config - - def list_by_server( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of job agents in a server. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of JobAgent - :rtype: - ~azure.mgmt.sql.models.JobAgentPaged[~azure.mgmt.sql.models.JobAgent] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_server.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.JobAgentPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.JobAgentPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents'} - - def get( - self, resource_group_name, server_name, job_agent_name, custom_headers=None, raw=False, **operation_config): - """Gets a job agent. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent to be retrieved. - :type job_agent_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: JobAgent or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.JobAgent or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobAgent', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}'} - - - def _create_or_update_initial( - self, resource_group_name, server_name, job_agent_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'JobAgent') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 201, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobAgent', response) - if response.status_code == 201: - deserialized = self._deserialize('JobAgent', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, server_name, job_agent_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates or updates a job agent. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent to be created or - updated. - :type job_agent_name: str - :param parameters: The requested job agent resource state. - :type parameters: ~azure.mgmt.sql.models.JobAgent - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns JobAgent or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.JobAgent] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.JobAgent]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('JobAgent', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}'} - - - def _delete_initial( - self, resource_group_name, server_name, job_agent_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, server_name, job_agent_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes a job agent. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent to be deleted. - :type job_agent_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}'} - - - def _update_initial( - self, resource_group_name, server_name, job_agent_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.JobAgentUpdate(tags=tags) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'JobAgentUpdate') - - # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobAgent', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, server_name, job_agent_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates a job agent. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent to be updated. - :type job_agent_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns JobAgent or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.JobAgent] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.JobAgent]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('JobAgent', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_credentials_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_credentials_operations.py deleted file mode 100644 index c4bf415fe5e4..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/job_credentials_operations.py +++ /dev/null @@ -1,328 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class JobCredentialsOperations(object): - """JobCredentialsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-03-01-preview" - - self.config = config - - def list_by_agent( - self, resource_group_name, server_name, job_agent_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of jobs credentials. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of JobCredential - :rtype: - ~azure.mgmt.sql.models.JobCredentialPaged[~azure.mgmt.sql.models.JobCredential] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_agent.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.JobCredentialPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.JobCredentialPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_agent.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials'} - - def get( - self, resource_group_name, server_name, job_agent_name, credential_name, custom_headers=None, raw=False, **operation_config): - """Gets a jobs credential. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param credential_name: The name of the credential. - :type credential_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: JobCredential or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.JobCredential or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobCredential', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}'} - - def create_or_update( - self, resource_group_name, server_name, job_agent_name, credential_name, username, password, custom_headers=None, raw=False, **operation_config): - """Creates or updates a job credential. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param credential_name: The name of the credential. - :type credential_name: str - :param username: The credential user name. - :type username: str - :param password: The credential password. - :type password: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: JobCredential or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.JobCredential or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = models.JobCredential(username=username, password=password) - - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'JobCredential') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobCredential', response) - if response.status_code == 201: - deserialized = self._deserialize('JobCredential', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}'} - - def delete( - self, resource_group_name, server_name, job_agent_name, credential_name, custom_headers=None, raw=False, **operation_config): - """Deletes a job credential. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param credential_name: The name of the credential. - :type credential_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_executions_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_executions_operations.py deleted file mode 100644 index 3a9c7cd1c597..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/job_executions_operations.py +++ /dev/null @@ -1,612 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class JobExecutionsOperations(object): - """JobExecutionsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-03-01-preview" - - self.config = config - - def list_by_agent( - self, resource_group_name, server_name, job_agent_name, create_time_min=None, create_time_max=None, end_time_min=None, end_time_max=None, is_active=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists all executions in a job agent. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param create_time_min: If specified, only job executions created at - or after the specified time are included. - :type create_time_min: datetime - :param create_time_max: If specified, only job executions created - before the specified time are included. - :type create_time_max: datetime - :param end_time_min: If specified, only job executions completed at or - after the specified time are included. - :type end_time_min: datetime - :param end_time_max: If specified, only job executions completed - before the specified time are included. - :type end_time_max: datetime - :param is_active: If specified, only active or only completed job - executions are included. - :type is_active: bool - :param skip: The number of elements in the collection to skip. - :type skip: int - :param top: The number of elements to return from the collection. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of JobExecution - :rtype: - ~azure.mgmt.sql.models.JobExecutionPaged[~azure.mgmt.sql.models.JobExecution] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_agent.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if create_time_min is not None: - query_parameters['createTimeMin'] = self._serialize.query("create_time_min", create_time_min, 'iso-8601') - if create_time_max is not None: - query_parameters['createTimeMax'] = self._serialize.query("create_time_max", create_time_max, 'iso-8601') - if end_time_min is not None: - query_parameters['endTimeMin'] = self._serialize.query("end_time_min", end_time_min, 'iso-8601') - if end_time_max is not None: - query_parameters['endTimeMax'] = self._serialize.query("end_time_max", end_time_max, 'iso-8601') - if is_active is not None: - query_parameters['isActive'] = self._serialize.query("is_active", is_active, 'bool') - if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_agent.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/executions'} - - def cancel( - self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers=None, raw=False, **operation_config): - """Requests cancellation of a job execution. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job. - :type job_name: str - :param job_execution_id: The id of the job execution to cancel. - :type job_execution_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.cancel.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/cancel'} - - - def _create_initial( - self, resource_group_name, server_name, job_agent_name, job_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobExecution', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, server_name, job_agent_name, job_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Starts an elastic job execution. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job to get. - :type job_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns JobExecution or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.JobExecution] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.JobExecution]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('JobExecution', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start'} - - def list_by_job( - self, resource_group_name, server_name, job_agent_name, job_name, create_time_min=None, create_time_max=None, end_time_min=None, end_time_max=None, is_active=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists a job's executions. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job to get. - :type job_name: str - :param create_time_min: If specified, only job executions created at - or after the specified time are included. - :type create_time_min: datetime - :param create_time_max: If specified, only job executions created - before the specified time are included. - :type create_time_max: datetime - :param end_time_min: If specified, only job executions completed at or - after the specified time are included. - :type end_time_min: datetime - :param end_time_max: If specified, only job executions completed - before the specified time are included. - :type end_time_max: datetime - :param is_active: If specified, only active or only completed job - executions are included. - :type is_active: bool - :param skip: The number of elements in the collection to skip. - :type skip: int - :param top: The number of elements to return from the collection. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of JobExecution - :rtype: - ~azure.mgmt.sql.models.JobExecutionPaged[~azure.mgmt.sql.models.JobExecution] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_job.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if create_time_min is not None: - query_parameters['createTimeMin'] = self._serialize.query("create_time_min", create_time_min, 'iso-8601') - if create_time_max is not None: - query_parameters['createTimeMax'] = self._serialize.query("create_time_max", create_time_max, 'iso-8601') - if end_time_min is not None: - query_parameters['endTimeMin'] = self._serialize.query("end_time_min", end_time_min, 'iso-8601') - if end_time_max is not None: - query_parameters['endTimeMax'] = self._serialize.query("end_time_max", end_time_max, 'iso-8601') - if is_active is not None: - query_parameters['isActive'] = self._serialize.query("is_active", is_active, 'bool') - if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions'} - - def get( - self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers=None, raw=False, **operation_config): - """Gets a job execution. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job. - :type job_name: str - :param job_execution_id: The id of the job execution - :type job_execution_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: JobExecution or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.JobExecution or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobExecution', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}'} - - - def _create_or_update_initial( - self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200, 201, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobExecution', response) - if response.status_code == 201: - deserialized = self._deserialize('JobExecution', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates or updatess a job execution. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job to get. - :type job_name: str - :param job_execution_id: The job execution id to create the job - execution under. - :type job_execution_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns JobExecution or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.JobExecution] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.JobExecution]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('JobExecution', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_step_executions_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_step_executions_operations.py deleted file mode 100644 index 3a2c37310f40..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/job_step_executions_operations.py +++ /dev/null @@ -1,229 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class JobStepExecutionsOperations(object): - """JobStepExecutionsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-03-01-preview" - - self.config = config - - def list_by_job_execution( - self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, create_time_min=None, create_time_max=None, end_time_min=None, end_time_max=None, is_active=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the step executions of a job execution. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job to get. - :type job_name: str - :param job_execution_id: The id of the job execution - :type job_execution_id: str - :param create_time_min: If specified, only job executions created at - or after the specified time are included. - :type create_time_min: datetime - :param create_time_max: If specified, only job executions created - before the specified time are included. - :type create_time_max: datetime - :param end_time_min: If specified, only job executions completed at or - after the specified time are included. - :type end_time_min: datetime - :param end_time_max: If specified, only job executions completed - before the specified time are included. - :type end_time_max: datetime - :param is_active: If specified, only active or only completed job - executions are included. - :type is_active: bool - :param skip: The number of elements in the collection to skip. - :type skip: int - :param top: The number of elements to return from the collection. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of JobExecution - :rtype: - ~azure.mgmt.sql.models.JobExecutionPaged[~azure.mgmt.sql.models.JobExecution] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_job_execution.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if create_time_min is not None: - query_parameters['createTimeMin'] = self._serialize.query("create_time_min", create_time_min, 'iso-8601') - if create_time_max is not None: - query_parameters['createTimeMax'] = self._serialize.query("create_time_max", create_time_max, 'iso-8601') - if end_time_min is not None: - query_parameters['endTimeMin'] = self._serialize.query("end_time_min", end_time_min, 'iso-8601') - if end_time_max is not None: - query_parameters['endTimeMax'] = self._serialize.query("end_time_max", end_time_max, 'iso-8601') - if is_active is not None: - query_parameters['isActive'] = self._serialize.query("is_active", is_active, 'bool') - if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_job_execution.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps'} - - def get( - self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, step_name, custom_headers=None, raw=False, **operation_config): - """Gets a step execution of a job execution. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job to get. - :type job_name: str - :param job_execution_id: The unique id of the job execution - :type job_execution_id: str - :param step_name: The name of the step. - :type step_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: JobExecution or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.JobExecution or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), - 'stepName': self._serialize.url("step_name", step_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobExecution', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_steps_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_steps_operations.py deleted file mode 100644 index 0cd2ba4bc13d..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/job_steps_operations.py +++ /dev/null @@ -1,495 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class JobStepsOperations(object): - """JobStepsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-03-01-preview" - - self.config = config - - def list_by_version( - self, resource_group_name, server_name, job_agent_name, job_name, job_version, custom_headers=None, raw=False, **operation_config): - """Gets all job steps in the specified job version. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job to get. - :type job_name: str - :param job_version: The version of the job to get. - :type job_version: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of JobStep - :rtype: - ~azure.mgmt.sql.models.JobStepPaged[~azure.mgmt.sql.models.JobStep] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_version.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'jobVersion': self._serialize.url("job_version", job_version, 'int'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.JobStepPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.JobStepPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps'} - - def get_by_version( - self, resource_group_name, server_name, job_agent_name, job_name, job_version, step_name, custom_headers=None, raw=False, **operation_config): - """Gets the specified version of a job step. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job. - :type job_name: str - :param job_version: The version of the job to get. - :type job_version: int - :param step_name: The name of the job step. - :type step_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: JobStep or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.JobStep or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_by_version.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'jobVersion': self._serialize.url("job_version", job_version, 'int'), - 'stepName': self._serialize.url("step_name", step_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobStep', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_by_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps/{stepName}'} - - def list_by_job( - self, resource_group_name, server_name, job_agent_name, job_name, custom_headers=None, raw=False, **operation_config): - """Gets all job steps for a job's current version. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job to get. - :type job_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of JobStep - :rtype: - ~azure.mgmt.sql.models.JobStepPaged[~azure.mgmt.sql.models.JobStep] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_job.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.JobStepPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.JobStepPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps'} - - def get( - self, resource_group_name, server_name, job_agent_name, job_name, step_name, custom_headers=None, raw=False, **operation_config): - """Gets a job step in a job's current version. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job. - :type job_name: str - :param step_name: The name of the job step. - :type step_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: JobStep or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.JobStep or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'stepName': self._serialize.url("step_name", step_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobStep', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}'} - - def create_or_update( - self, resource_group_name, server_name, job_agent_name, job_name, step_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates or updates a job step. This will implicitly create a new job - version. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job. - :type job_name: str - :param step_name: The name of the job step. - :type step_name: str - :param parameters: The requested state of the job step. - :type parameters: ~azure.mgmt.sql.models.JobStep - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: JobStep or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.JobStep or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'stepName': self._serialize.url("step_name", step_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'JobStep') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobStep', response) - if response.status_code == 201: - deserialized = self._deserialize('JobStep', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}'} - - def delete( - self, resource_group_name, server_name, job_agent_name, job_name, step_name, custom_headers=None, raw=False, **operation_config): - """Deletes a job step. This will implicitly create a new job version. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job. - :type job_name: str - :param step_name: The name of the job step to delete. - :type step_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'stepName': self._serialize.url("step_name", step_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_target_executions_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_target_executions_operations.py deleted file mode 100644 index 3224d6ec2d87..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/job_target_executions_operations.py +++ /dev/null @@ -1,350 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class JobTargetExecutionsOperations(object): - """JobTargetExecutionsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-03-01-preview" - - self.config = config - - def list_by_job_execution( - self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, create_time_min=None, create_time_max=None, end_time_min=None, end_time_max=None, is_active=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists target executions for all steps of a job execution. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job to get. - :type job_name: str - :param job_execution_id: The id of the job execution - :type job_execution_id: str - :param create_time_min: If specified, only job executions created at - or after the specified time are included. - :type create_time_min: datetime - :param create_time_max: If specified, only job executions created - before the specified time are included. - :type create_time_max: datetime - :param end_time_min: If specified, only job executions completed at or - after the specified time are included. - :type end_time_min: datetime - :param end_time_max: If specified, only job executions completed - before the specified time are included. - :type end_time_max: datetime - :param is_active: If specified, only active or only completed job - executions are included. - :type is_active: bool - :param skip: The number of elements in the collection to skip. - :type skip: int - :param top: The number of elements to return from the collection. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of JobExecution - :rtype: - ~azure.mgmt.sql.models.JobExecutionPaged[~azure.mgmt.sql.models.JobExecution] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_job_execution.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if create_time_min is not None: - query_parameters['createTimeMin'] = self._serialize.query("create_time_min", create_time_min, 'iso-8601') - if create_time_max is not None: - query_parameters['createTimeMax'] = self._serialize.query("create_time_max", create_time_max, 'iso-8601') - if end_time_min is not None: - query_parameters['endTimeMin'] = self._serialize.query("end_time_min", end_time_min, 'iso-8601') - if end_time_max is not None: - query_parameters['endTimeMax'] = self._serialize.query("end_time_max", end_time_max, 'iso-8601') - if is_active is not None: - query_parameters['isActive'] = self._serialize.query("is_active", is_active, 'bool') - if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_job_execution.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets'} - - def list_by_step( - self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, step_name, create_time_min=None, create_time_max=None, end_time_min=None, end_time_max=None, is_active=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the target executions of a job step execution. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job to get. - :type job_name: str - :param job_execution_id: The id of the job execution - :type job_execution_id: str - :param step_name: The name of the step. - :type step_name: str - :param create_time_min: If specified, only job executions created at - or after the specified time are included. - :type create_time_min: datetime - :param create_time_max: If specified, only job executions created - before the specified time are included. - :type create_time_max: datetime - :param end_time_min: If specified, only job executions completed at or - after the specified time are included. - :type end_time_min: datetime - :param end_time_max: If specified, only job executions completed - before the specified time are included. - :type end_time_max: datetime - :param is_active: If specified, only active or only completed job - executions are included. - :type is_active: bool - :param skip: The number of elements in the collection to skip. - :type skip: int - :param top: The number of elements to return from the collection. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of JobExecution - :rtype: - ~azure.mgmt.sql.models.JobExecutionPaged[~azure.mgmt.sql.models.JobExecution] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_step.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), - 'stepName': self._serialize.url("step_name", step_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if create_time_min is not None: - query_parameters['createTimeMin'] = self._serialize.query("create_time_min", create_time_min, 'iso-8601') - if create_time_max is not None: - query_parameters['createTimeMax'] = self._serialize.query("create_time_max", create_time_max, 'iso-8601') - if end_time_min is not None: - query_parameters['endTimeMin'] = self._serialize.query("end_time_min", end_time_min, 'iso-8601') - if end_time_max is not None: - query_parameters['endTimeMax'] = self._serialize.query("end_time_max", end_time_max, 'iso-8601') - if is_active is not None: - query_parameters['isActive'] = self._serialize.query("is_active", is_active, 'bool') - if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.JobExecutionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_step.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets'} - - def get( - self, resource_group_name, server_name, job_agent_name, job_name, job_execution_id, step_name, target_id, custom_headers=None, raw=False, **operation_config): - """Gets a target execution. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job to get. - :type job_name: str - :param job_execution_id: The unique id of the job execution - :type job_execution_id: str - :param step_name: The name of the step. - :type step_name: str - :param target_id: The target id. - :type target_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: JobExecution or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.JobExecution or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'jobExecutionId': self._serialize.url("job_execution_id", job_execution_id, 'str'), - 'stepName': self._serialize.url("step_name", step_name, 'str'), - 'targetId': self._serialize.url("target_id", target_id, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobExecution', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets/{targetId}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_target_groups_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_target_groups_operations.py deleted file mode 100644 index 0bf98a502cb8..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/job_target_groups_operations.py +++ /dev/null @@ -1,326 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class JobTargetGroupsOperations(object): - """JobTargetGroupsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-03-01-preview" - - self.config = config - - def list_by_agent( - self, resource_group_name, server_name, job_agent_name, custom_headers=None, raw=False, **operation_config): - """Gets all target groups in an agent. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of JobTargetGroup - :rtype: - ~azure.mgmt.sql.models.JobTargetGroupPaged[~azure.mgmt.sql.models.JobTargetGroup] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_agent.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.JobTargetGroupPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.JobTargetGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_agent.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups'} - - def get( - self, resource_group_name, server_name, job_agent_name, target_group_name, custom_headers=None, raw=False, **operation_config): - """Gets a target group. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param target_group_name: The name of the target group. - :type target_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: JobTargetGroup or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.JobTargetGroup or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'targetGroupName': self._serialize.url("target_group_name", target_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobTargetGroup', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}'} - - def create_or_update( - self, resource_group_name, server_name, job_agent_name, target_group_name, members, custom_headers=None, raw=False, **operation_config): - """Creates or updates a target group. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param target_group_name: The name of the target group. - :type target_group_name: str - :param members: Members of the target group. - :type members: list[~azure.mgmt.sql.models.JobTarget] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: JobTargetGroup or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.JobTargetGroup or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = models.JobTargetGroup(members=members) - - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'targetGroupName': self._serialize.url("target_group_name", target_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'JobTargetGroup') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobTargetGroup', response) - if response.status_code == 201: - deserialized = self._deserialize('JobTargetGroup', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}'} - - def delete( - self, resource_group_name, server_name, job_agent_name, target_group_name, custom_headers=None, raw=False, **operation_config): - """Deletes a target group. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param target_group_name: The name of the target group. - :type target_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'targetGroupName': self._serialize.url("target_group_name", target_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/job_versions_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/job_versions_operations.py deleted file mode 100644 index ec9e2ff23061..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/job_versions_operations.py +++ /dev/null @@ -1,190 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class JobVersionsOperations(object): - """JobVersionsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-03-01-preview" - - self.config = config - - def list_by_job( - self, resource_group_name, server_name, job_agent_name, job_name, custom_headers=None, raw=False, **operation_config): - """Gets all versions of a job. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job to get. - :type job_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of JobVersion - :rtype: - ~azure.mgmt.sql.models.JobVersionPaged[~azure.mgmt.sql.models.JobVersion] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_job.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.JobVersionPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.JobVersionPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions'} - - def get( - self, resource_group_name, server_name, job_agent_name, job_name, job_version, custom_headers=None, raw=False, **operation_config): - """Gets a job version. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job. - :type job_name: str - :param job_version: The version of the job to get. - :type job_version: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: JobVersion or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.JobVersion or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'jobVersion': self._serialize.url("job_version", job_version, 'int'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('JobVersion', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/jobs_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/jobs_operations.py deleted file mode 100644 index 042336e20941..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/jobs_operations.py +++ /dev/null @@ -1,327 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class JobsOperations(object): - """JobsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-03-01-preview" - - self.config = config - - def list_by_agent( - self, resource_group_name, server_name, job_agent_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of jobs. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Job - :rtype: ~azure.mgmt.sql.models.JobPaged[~azure.mgmt.sql.models.Job] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_agent.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.JobPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.JobPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_agent.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs'} - - def get( - self, resource_group_name, server_name, job_agent_name, job_name, custom_headers=None, raw=False, **operation_config): - """Gets a job. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job to get. - :type job_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Job or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.Job or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Job', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}'} - - def create_or_update( - self, resource_group_name, server_name, job_agent_name, job_name, description="", schedule=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates a job. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job to get. - :type job_name: str - :param description: User-defined description of the job. - :type description: str - :param schedule: Schedule properties of the job. - :type schedule: ~azure.mgmt.sql.models.JobSchedule - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Job or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.Job or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = models.Job(description=description, schedule=schedule) - - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'Job') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Job', response) - if response.status_code == 201: - deserialized = self._deserialize('Job', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}'} - - def delete( - self, resource_group_name, server_name, job_agent_name, job_name, custom_headers=None, raw=False, **operation_config): - """Deletes a job. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param job_agent_name: The name of the job agent. - :type job_agent_name: str - :param job_name: The name of the job to delete. - :type job_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'jobAgentName': self._serialize.url("job_agent_name", job_agent_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py b/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py index 869e3e0a4034..9c990c2c2c26 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py +++ b/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py @@ -50,15 +50,6 @@ from .operations.virtual_network_rules_operations import VirtualNetworkRulesOperations from .operations.database_vulnerability_assessment_rule_baselines_operations import DatabaseVulnerabilityAssessmentRuleBaselinesOperations from .operations.database_vulnerability_assessments_operations import DatabaseVulnerabilityAssessmentsOperations -from .operations.job_agents_operations import JobAgentsOperations -from .operations.job_credentials_operations import JobCredentialsOperations -from .operations.job_executions_operations import JobExecutionsOperations -from .operations.jobs_operations import JobsOperations -from .operations.job_step_executions_operations import JobStepExecutionsOperations -from .operations.job_steps_operations import JobStepsOperations -from .operations.job_target_executions_operations import JobTargetExecutionsOperations -from .operations.job_target_groups_operations import JobTargetGroupsOperations -from .operations.job_versions_operations import JobVersionsOperations from .operations.long_term_retention_backups_operations import LongTermRetentionBackupsOperations from .operations.backup_long_term_retention_policies_operations import BackupLongTermRetentionPoliciesOperations from .operations.managed_databases_operations import ManagedDatabasesOperations @@ -187,24 +178,6 @@ class SqlManagementClient(SDKClient): :vartype database_vulnerability_assessment_rule_baselines: azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations :ivar database_vulnerability_assessments: DatabaseVulnerabilityAssessments operations :vartype database_vulnerability_assessments: azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations - :ivar job_agents: JobAgents operations - :vartype job_agents: azure.mgmt.sql.operations.JobAgentsOperations - :ivar job_credentials: JobCredentials operations - :vartype job_credentials: azure.mgmt.sql.operations.JobCredentialsOperations - :ivar job_executions: JobExecutions operations - :vartype job_executions: azure.mgmt.sql.operations.JobExecutionsOperations - :ivar jobs: Jobs operations - :vartype jobs: azure.mgmt.sql.operations.JobsOperations - :ivar job_step_executions: JobStepExecutions operations - :vartype job_step_executions: azure.mgmt.sql.operations.JobStepExecutionsOperations - :ivar job_steps: JobSteps operations - :vartype job_steps: azure.mgmt.sql.operations.JobStepsOperations - :ivar job_target_executions: JobTargetExecutions operations - :vartype job_target_executions: azure.mgmt.sql.operations.JobTargetExecutionsOperations - :ivar job_target_groups: JobTargetGroups operations - :vartype job_target_groups: azure.mgmt.sql.operations.JobTargetGroupsOperations - :ivar job_versions: JobVersions operations - :vartype job_versions: azure.mgmt.sql.operations.JobVersionsOperations :ivar long_term_retention_backups: LongTermRetentionBackups operations :vartype long_term_retention_backups: azure.mgmt.sql.operations.LongTermRetentionBackupsOperations :ivar backup_long_term_retention_policies: BackupLongTermRetentionPolicies operations @@ -323,24 +296,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.database_vulnerability_assessments = DatabaseVulnerabilityAssessmentsOperations( self._client, self.config, self._serialize, self._deserialize) - self.job_agents = JobAgentsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.job_credentials = JobCredentialsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.job_executions = JobExecutionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.jobs = JobsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.job_step_executions = JobStepExecutionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.job_steps = JobStepsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.job_target_executions = JobTargetExecutionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.job_target_groups = JobTargetGroupsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.job_versions = JobVersionsOperations( - self._client, self.config, self._serialize, self._deserialize) self.long_term_retention_backups = LongTermRetentionBackupsOperations( self._client, self.config, self._serialize, self._deserialize) self.backup_long_term_retention_policies = BackupLongTermRetentionPoliciesOperations(