Class: Azure::SQL::Mgmt::V2015_05_01_preview::SqlManagementClient
- Inherits:
-
MsRestAzure::AzureServiceClient
- Object
- MsRestAzure::AzureServiceClient
- Azure::SQL::Mgmt::V2015_05_01_preview::SqlManagementClient
- Includes:
- MsRestAzure, MsRestAzure::Serialization
- Defined in:
- lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb
Overview
A service client - single point of access to the REST API.
Instance Attribute Summary collapse
-
#accept_language ⇒ String
The preferred language for the response.
-
#api_version ⇒ String
readonly
The API version to use for the request.
-
#base_url ⇒ String
The base URI of the service.
-
#credentials ⇒ Object
readonly
Credentials needed for the client to connect to Azure.
-
#database_advisors ⇒ DatabaseAdvisors
readonly
Database_advisors.
-
#database_automatic_tuning_operations ⇒ DatabaseAutomaticTuningOperations
readonly
database_automatic_tuning_operations.
-
#database_blob_auditing_policies ⇒ DatabaseBlobAuditingPolicies
readonly
Database_blob_auditing_policies.
-
#database_recommended_actions ⇒ DatabaseRecommendedActions
readonly
Database_recommended_actions.
-
#encryption_protectors ⇒ EncryptionProtectors
readonly
Encryption_protectors.
-
#failover_groups ⇒ FailoverGroups
readonly
Failover_groups.
-
#firewall_rules ⇒ FirewallRules
readonly
Firewall_rules.
-
#generate_client_request_id ⇒ Boolean
generated.
-
#long_running_operation_retry_timeout ⇒ Integer
Operations.
-
#managed_instances ⇒ ManagedInstances
readonly
Managed_instances.
-
#operations ⇒ Operations
readonly
Operations.
-
#server_advisors ⇒ ServerAdvisors
readonly
Server_advisors.
-
#server_keys ⇒ ServerKeys
readonly
Server_keys.
-
#servers ⇒ Servers
readonly
Servers.
-
#subscription_id ⇒ String
subscription.
-
#subscription_usages ⇒ SubscriptionUsages
readonly
Subscription_usages.
-
#sync_agents ⇒ SyncAgents
readonly
Sync_agents.
-
#sync_groups ⇒ SyncGroups
readonly
Sync_groups.
-
#sync_members ⇒ SyncMembers
readonly
Sync_members.
-
#virtual_clusters ⇒ VirtualClusters
readonly
Virtual_clusters.
-
#virtual_network_rules ⇒ VirtualNetworkRules
readonly
Virtual_network_rules.
Instance Method Summary collapse
-
#initialize(credentials = nil, base_url = nil, options = nil) ⇒ SqlManagementClient
constructor
Creates initializes a new instance of the SqlManagementClient class.
-
#make_request(method, path, options = {}) ⇒ Hash{String=>String}
Makes a request and returns the body of the response.
-
#make_request_async(method, path, options = {}) ⇒ Concurrent::Promise
Makes a request asynchronously.
-
#make_request_with_http_info(method, path, options = {}) ⇒ MsRestAzure::AzureOperationResponse
Makes a request and returns the operation response.
Constructor Details
#initialize(credentials = nil, base_url = nil, options = nil) ⇒ SqlManagementClient
Creates initializes a new instance of the SqlManagementClient class.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 100 def initialize(credentials = nil, base_url = nil, = nil) super(credentials, ) @base_url = base_url || 'https://management.azure.com' fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? @credentials = credentials @database_advisors = DatabaseAdvisors.new(self) @database_recommended_actions = DatabaseRecommendedActions.new(self) @server_advisors = ServerAdvisors.new(self) @database_blob_auditing_policies = DatabaseBlobAuditingPolicies.new(self) @database_automatic_tuning_operations = DatabaseAutomaticTuningOperations.new(self) @encryption_protectors = EncryptionProtectors.new(self) @failover_groups = FailoverGroups.new(self) @firewall_rules = FirewallRules.new(self) @managed_instances = ManagedInstances.new(self) @operations = Operations.new(self) @server_keys = ServerKeys.new(self) @servers = Servers.new(self) @sync_agents = SyncAgents.new(self) @sync_groups = SyncGroups.new(self) @sync_members = SyncMembers.new(self) @subscription_usages = SubscriptionUsages.new(self) @virtual_clusters = VirtualClusters.new(self) @virtual_network_rules = VirtualNetworkRules.new(self) @api_version = '2015-05-01-preview' @accept_language = 'en-US' @long_running_operation_retry_timeout = 30 @generate_client_request_id = true add_telemetry end |
Instance Attribute Details
#accept_language ⇒ String
28 29 30 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 28 def accept_language @accept_language end |
#api_version ⇒ String (readonly)
25 26 27 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 25 def api_version @api_version end |
#base_url ⇒ String
15 16 17 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 15 def base_url @base_url end |
#credentials ⇒ Object (readonly)
18 19 20 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 18 def credentials @credentials end |
#database_advisors ⇒ DatabaseAdvisors (readonly)
40 41 42 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 40 def database_advisors @database_advisors end |
#database_automatic_tuning_operations ⇒ DatabaseAutomaticTuningOperations (readonly)
database_automatic_tuning_operations
53 54 55 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 53 def database_automatic_tuning_operations @database_automatic_tuning_operations end |
#database_blob_auditing_policies ⇒ DatabaseBlobAuditingPolicies (readonly)
49 50 51 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 49 def database_blob_auditing_policies @database_blob_auditing_policies end |
#database_recommended_actions ⇒ DatabaseRecommendedActions (readonly)
43 44 45 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 43 def database_recommended_actions @database_recommended_actions end |
#encryption_protectors ⇒ EncryptionProtectors (readonly)
56 57 58 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 56 def encryption_protectors @encryption_protectors end |
#failover_groups ⇒ FailoverGroups (readonly)
59 60 61 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 59 def failover_groups @failover_groups end |
#firewall_rules ⇒ FirewallRules (readonly)
62 63 64 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 62 def firewall_rules @firewall_rules end |
#generate_client_request_id ⇒ Boolean
generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
37 38 39 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 37 def generate_client_request_id @generate_client_request_id end |
#long_running_operation_retry_timeout ⇒ Integer
Operations. Default value is 30.
32 33 34 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 32 def long_running_operation_retry_timeout @long_running_operation_retry_timeout end |
#managed_instances ⇒ ManagedInstances (readonly)
65 66 67 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 65 def managed_instances @managed_instances end |
#operations ⇒ Operations (readonly)
68 69 70 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 68 def operations @operations end |
#server_advisors ⇒ ServerAdvisors (readonly)
46 47 48 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 46 def server_advisors @server_advisors end |
#server_keys ⇒ ServerKeys (readonly)
71 72 73 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 71 def server_keys @server_keys end |
#servers ⇒ Servers (readonly)
74 75 76 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 74 def servers @servers end |
#subscription_id ⇒ String
subscription.
22 23 24 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 22 def subscription_id @subscription_id end |
#subscription_usages ⇒ SubscriptionUsages (readonly)
86 87 88 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 86 def subscription_usages @subscription_usages end |
#sync_agents ⇒ SyncAgents (readonly)
77 78 79 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 77 def sync_agents @sync_agents end |
#sync_groups ⇒ SyncGroups (readonly)
80 81 82 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 80 def sync_groups @sync_groups end |
#sync_members ⇒ SyncMembers (readonly)
83 84 85 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 83 def sync_members @sync_members end |
#virtual_clusters ⇒ VirtualClusters (readonly)
89 90 91 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 89 def virtual_clusters @virtual_clusters end |
#virtual_network_rules ⇒ VirtualNetworkRules (readonly)
92 93 94 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 92 def virtual_network_rules @virtual_network_rules end |
Instance Method Details
#make_request(method, path, options = {}) ⇒ Hash{String=>String}
Makes a request and returns the body of the response. Example:
request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
path = "/path"
= {
body: request_content,
query_params: {'api-version' => '2016-02-01'}
}
result = @client.make_request(:put, path, )
148 149 150 151 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 148 def make_request(method, path, = {}) result = make_request_with_http_info(method, path, ) result.body unless result.nil? end |
#make_request_async(method, path, options = {}) ⇒ Concurrent::Promise
Makes a request asynchronously.
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 173 def make_request_async(method, path, = {}) fail ArgumentError, 'method is nil' if method.nil? fail ArgumentError, 'path is nil' if path.nil? request_url = [:base_url] || @base_url if(![:headers].nil? && ![:headers]['Content-Type'].nil?) @request_headers['Content-Type'] = [:headers]['Content-Type'] end request_headers = @request_headers request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? .merge!({headers: request_headers.merge([:headers] || {})}) .merge!({credentials: @credentials}) unless @credentials.nil? super(request_url, method, path, ) end |
#make_request_with_http_info(method, path, options = {}) ⇒ MsRestAzure::AzureOperationResponse
Makes a request and returns the operation response.
160 161 162 163 164 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 160 def make_request_with_http_info(method, path, = {}) result = make_request_async(method, path, ).value! result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) result end |