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
Gets or sets 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_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.
-
#generate_client_request_id ⇒ Boolean
is generated and included in each request.
-
#long_running_operation_retry_timeout ⇒ Integer
Running Operations.
-
#operations ⇒ Operations
readonly
Operations.
-
#server_advisors ⇒ ServerAdvisors
readonly
Server_advisors.
-
#server_keys ⇒ ServerKeys
readonly
Server_keys.
-
#servers ⇒ Servers
readonly
Servers.
-
#subscription_id ⇒ String
subscription.
-
#sync_agents ⇒ SyncAgents
readonly
Sync_agents.
-
#sync_groups ⇒ SyncGroups
readonly
Sync_groups.
-
#sync_members ⇒ SyncMembers
readonly
Sync_members.
-
#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.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 83 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) @encryption_protectors = EncryptionProtectors.new(self) @failover_groups = FailoverGroups.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) @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
Returns Gets or sets the preferred language for the response.
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)
Returns The API version to use for the request.
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
Returns the base URI of the service.
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)
Returns Credentials needed for the client to connect to Azure.
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)
Returns database_advisors.
39 40 41 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 39 def database_advisors @database_advisors end |
#database_blob_auditing_policies ⇒ DatabaseBlobAuditingPolicies (readonly)
Returns database_blob_auditing_policies.
48 49 50 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 48 def database_blob_auditing_policies @database_blob_auditing_policies end |
#database_recommended_actions ⇒ DatabaseRecommendedActions (readonly)
Returns database_recommended_actions.
42 43 44 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 42 def database_recommended_actions @database_recommended_actions end |
#encryption_protectors ⇒ EncryptionProtectors (readonly)
Returns encryption_protectors.
51 52 53 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 51 def encryption_protectors @encryption_protectors end |
#failover_groups ⇒ FailoverGroups (readonly)
Returns failover_groups.
54 55 56 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 54 def failover_groups @failover_groups end |
#generate_client_request_id ⇒ Boolean
is generated and included in each request. Default is true.
36 37 38 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 36 def generate_client_request_id @generate_client_request_id end |
#long_running_operation_retry_timeout ⇒ Integer
Running 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 |
#operations ⇒ Operations (readonly)
Returns operations.
57 58 59 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 57 def operations @operations end |
#server_advisors ⇒ ServerAdvisors (readonly)
Returns server_advisors.
45 46 47 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 45 def server_advisors @server_advisors end |
#server_keys ⇒ ServerKeys (readonly)
Returns server_keys.
60 61 62 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 60 def server_keys @server_keys end |
#servers ⇒ Servers (readonly)
Returns servers.
63 64 65 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 63 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 |
#sync_agents ⇒ SyncAgents (readonly)
Returns sync_agents.
66 67 68 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 66 def sync_agents @sync_agents end |
#sync_groups ⇒ SyncGroups (readonly)
Returns sync_groups.
69 70 71 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 69 def sync_groups @sync_groups end |
#sync_members ⇒ SyncMembers (readonly)
Returns sync_members.
72 73 74 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 72 def sync_members @sync_members end |
#virtual_network_rules ⇒ VirtualNetworkRules (readonly)
Returns virtual_network_rules.
75 76 77 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 75 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, )
126 127 128 129 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 126 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.
151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 151 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 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.
138 139 140 141 142 |
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb', line 138 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 |