Class: Azure::ARM::SQL::Models::Database

Inherits:
TrackedResource
  • Object
show all
Includes:
MsRest::JSONable, MsRestAzure
Defined in:
lib/generated/azure_mgmt_sql/models/database.rb

Overview

Represents a database.

Instance Attribute Summary collapse

Attributes inherited from TrackedResource

#location, #tags

Class Method Summary collapse

Instance Attribute Details

#collationString

Default, this value is ignored.

Returns:

  • (String)

    The collation of the database. If createMode is not



22
23
24
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 22

def collation
  @collation
end

#containment_stateInteger

Returns The containment state of the database.

Returns:

  • (Integer)

    The containment state of the database.



28
29
30
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 28

def containment_state
  @containment_state
end

#create_modeCreateMode

Default: regular database creation.

Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.

OnlineSecondary/NonReadableSecondary: creates a database as a (readable or nonreadable) secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.

PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.

Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.

Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database’s original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.

RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.

Copy, NonReadableSecondary, OnlineSecondary and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. Possible values include: ‘Copy’, ‘Default’, ‘NonReadableSecondary’, ‘OnlineSecondary’, ‘PointInTimeRestore’, ‘Recovery’, ‘Restore’, ‘RestoreLongTermRetentionBackup’

Returns:

  • (CreateMode)

    Specifies the mode of database creation.



80
81
82
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 80

def create_mode
  @create_mode
end

#creation_dateDateTime

Returns The creation date of the database (ISO8601 format).

Returns:

  • (DateTime)

    The creation date of the database (ISO8601 format).



25
26
27
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 25

def creation_date
  @creation_date
end

#current_service_objective_idObject

the ID of the service level objective that is currently active.

Returns:

  • The current service level objective ID of the database. This is



32
33
34
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 32

def current_service_objective_id
  @current_service_objective_id
end

#database_idObject

Returns The ID of the database.

Returns:

  • The ID of the database.



35
36
37
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 35

def database_id
  @database_id
end

#default_secondary_locationString

Returns The default secondary region for this database.

Returns:

  • (String)

    The default secondary region for this database.



166
167
168
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 166

def default_secondary_location
  @default_secondary_location
end

#earliest_restore_dateDateTime

restore is available for this database (ISO8601 format).

Returns:

  • (DateTime)

    This records the earliest start date and time that



39
40
41
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 39

def earliest_restore_date
  @earliest_restore_date
end

#editionDatabaseEdition

DatabaseEditions enumeration contains all the valid editions. If createMode is NonReadableSecondary or OnlineSecondary, this value is ignored. To see possible values, query the capabilities API (/subscriptions/subscriptionId/providers/Microsoft.Sql/locations/locationID/capabilities) referred to by operationId: “Capabilities_ListByLocation.”. Possible values include: ‘Web’, ‘Business’, ‘Basic’, ‘Standard’, ‘Premium’, ‘Free’, ‘Stretch’, ‘DataWarehouse’, ‘System’, ‘System2’

Returns:



118
119
120
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 118

def edition
  @edition
end

#elastic_pool_nameString

elasticPoolName and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveName is ignored. Not supported for DataWarehouse edition.

Returns:

  • (String)

    The name of the elastic pool the database is in. If



163
164
165
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 163

def elastic_pool_name
  @elastic_pool_name
end

#failover_group_idString

containing this database.

Returns:

  • (String)

    The resource identifier of the failover group



182
183
184
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 182

def failover_group_id
  @failover_group_id
end

#kindString

portal experience.

Returns:

  • (String)

    Kind of database. This is metadata used for the Azure



18
19
20
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 18

def kind
  @kind
end

#max_size_bytesString

createMode is not Default, this value is ignored. To see possible values, query the capabilities API (/subscriptions/subscriptionId/providers/Microsoft.Sql/locations/locationID/capabilities) referred to by operationId: “Capabilities_ListByLocation.”

Returns:

  • (String)

    The max size of the database expressed in bytes. If



125
126
127
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 125

def max_size_bytes
  @max_size_bytes
end

#read_scaleReadScale

readScale indicates whether read-only connections are allowed to this database or not. Not supported for DataWarehouse edition. Possible values include: ‘Enabled’, ‘Disabled’

Returns:

  • (ReadScale)

    Conditional. If the database is a geo-secondary,



188
189
190
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 188

def read_scale
  @read_scale
end

database.

Returns:



178
179
180
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 178

def recommended_index
  @recommended_index
end

#recovery_services_recovery_point_resource_idString

RestoreLongTermRetentionBackup, then this value is required. Specifies the resource ID of the recovery point to restore from.

Returns:

  • (String)

    Conditional. If createMode is



108
109
110
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 108

def recovery_services_recovery_point_resource_id
  @recovery_services_recovery_point_resource_id
end

#requested_service_objective_idObject

is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of currentServiceObjectiveId property. If requestedServiceObjectiveId and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveId overrides the value of requestedServiceObjectiveName. To see possible values, query the capabilities API (/subscriptions/subscriptionId/providers/Microsoft.Sql/locations/locationID/capabilities) referred to by operationId: “Capabilities_ListByLocation.”

Returns:

  • The configured service level objective ID of the database. This



137
138
139
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 137

def requested_service_objective_id
  @requested_service_objective_id
end

#requested_service_objective_nameServiceObjectiveName

objective of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of serviceLevelObjective property. To see possible values, query the capabilities API (/subscriptions/subscriptionId/providers/Microsoft.Sql/locations/locationID/capabilities) referred to by operationId: “Capabilities_ListByLocation.”. Possible values include: ‘Basic’, ‘S0’, ‘S1’, ‘S2’, ‘S3’, ‘P1’, ‘P2’, ‘P3’, ‘P4’, ‘P6’, ‘P11’, ‘P15’, ‘System’, ‘System2’, ‘ElasticPool’

Returns:



148
149
150
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 148

def requested_service_objective_name
  @requested_service_objective_name
end

#restore_point_in_timeDateTime

this value is required. If createMode is Restore, this value is optional. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. Must be greater than or equal to the source database’s earliestRestoreDate value.

Returns:

  • (DateTime)

    Conditional. If createMode is PointInTimeRestore,



103
104
105
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 103

def restore_point_in_time
  @restore_point_in_time
end

#sample_nameSampleName

when creating this database. If createMode is not Default, this value is ignored. Not supported for DataWarehouse edition. Possible values include: ‘AdventureWorksLT’

Returns:

  • (SampleName)

    Indicates the name of the sample schema to apply



194
195
196
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 194

def sample_name
  @sample_name
end

#service_level_objectiveServiceObjectiveName

the database. Possible values include: ‘Basic’, ‘S0’, ‘S1’, ‘S2’, ‘S3’, ‘P1’, ‘P2’, ‘P3’, ‘P4’, ‘P6’, ‘P11’, ‘P15’, ‘System’, ‘System2’, ‘ElasticPool’

Returns:



154
155
156
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 154

def service_level_objective
  @service_level_objective
end

#service_tier_advisorsArray<ServiceTierAdvisor>

for this database. Expanded property

Returns:



170
171
172
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 170

def service_tier_advisors
  @service_tier_advisors
end

#source_database_deletion_dateDateTime

sourceDatabaseId is the deleted database’s original resource id when it existed (as opposed to its current restorable dropped database id), then this value is required. Specifies the time that the database was deleted.

Returns:

  • (DateTime)

    Conditional. If createMode is Restore and



95
96
97
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 95

def source_database_deletion_date
  @source_database_deletion_date
end

#source_database_idString

NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or Restore, then this value is required. Specifies the resource ID of the source database. If createMode is NonReadableSecondary or OnlineSecondary, the name of the source database must be the same as the new database being created.

Returns:

  • (String)

    Conditional. If createMode is Copy,



88
89
90
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 88

def source_database_id
  @source_database_id
end

#statusString

Returns The status of the database.

Returns:

  • (String)

    The status of the database.



157
158
159
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 157

def status
  @status
end

#transparent_data_encryptionArray<TransparentDataEncryption>

encryption info for this database.

Returns:



174
175
176
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 174

def transparent_data_encryption
  @transparent_data_encryption
end

Class Method Details

.mapperObject

Mapper for Database class as Ruby Hash. This will be used for serialization/deserialization.



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
# File 'lib/generated/azure_mgmt_sql/models/database.rb', line 201

def self.mapper()
  {
    required: false,
    serialized_name: 'Database',
    type: {
      name: 'Composite',
      class_name: 'Database',
      model_properties: {
        id: {
          required: false,
          read_only: true,
          serialized_name: 'id',
          type: {
            name: 'String'
          }
        },
        name: {
          required: false,
          read_only: true,
          serialized_name: 'name',
          type: {
            name: 'String'
          }
        },
        type: {
          required: false,
          read_only: true,
          serialized_name: 'type',
          type: {
            name: 'String'
          }
        },
        tags: {
          required: false,
          serialized_name: 'tags',
          type: {
            name: 'Dictionary',
            value: {
                required: false,
                serialized_name: 'StringElementType',
                type: {
                  name: 'String'
                }
            }
          }
        },
        location: {
          required: true,
          serialized_name: 'location',
          type: {
            name: 'String'
          }
        },
        kind: {
          required: false,
          read_only: true,
          serialized_name: 'kind',
          type: {
            name: 'String'
          }
        },
        collation: {
          required: false,
          serialized_name: 'properties.collation',
          type: {
            name: 'String'
          }
        },
        creation_date: {
          required: false,
          read_only: true,
          serialized_name: 'properties.creationDate',
          type: {
            name: 'DateTime'
          }
        },
        containment_state: {
          required: false,
          read_only: true,
          serialized_name: 'properties.containmentState',
          type: {
            name: 'Number'
          }
        },
        current_service_objective_id: {
          required: false,
          read_only: true,
          serialized_name: 'properties.currentServiceObjectiveId',
          type: {
            name: 'String'
          }
        },
        database_id: {
          required: false,
          read_only: true,
          serialized_name: 'properties.databaseId',
          type: {
            name: 'String'
          }
        },
        earliest_restore_date: {
          required: false,
          read_only: true,
          serialized_name: 'properties.earliestRestoreDate',
          type: {
            name: 'DateTime'
          }
        },
        create_mode: {
          required: false,
          serialized_name: 'properties.createMode',
          type: {
            name: 'String'
          }
        },
        source_database_id: {
          required: false,
          serialized_name: 'properties.sourceDatabaseId',
          type: {
            name: 'String'
          }
        },
        source_database_deletion_date: {
          required: false,
          serialized_name: 'properties.sourceDatabaseDeletionDate',
          type: {
            name: 'DateTime'
          }
        },
        restore_point_in_time: {
          required: false,
          serialized_name: 'properties.restorePointInTime',
          type: {
            name: 'DateTime'
          }
        },
        recovery_services_recovery_point_resource_id: {
          required: false,
          serialized_name: 'properties.recoveryServicesRecoveryPointResourceId',
          type: {
            name: 'String'
          }
        },
        edition: {
          required: false,
          serialized_name: 'properties.edition',
          type: {
            name: 'String'
          }
        },
        max_size_bytes: {
          required: false,
          serialized_name: 'properties.maxSizeBytes',
          type: {
            name: 'String'
          }
        },
        requested_service_objective_id: {
          required: false,
          serialized_name: 'properties.requestedServiceObjectiveId',
          type: {
            name: 'String'
          }
        },
        requested_service_objective_name: {
          required: false,
          serialized_name: 'properties.requestedServiceObjectiveName',
          type: {
            name: 'String'
          }
        },
        service_level_objective: {
          required: false,
          read_only: true,
          serialized_name: 'properties.serviceLevelObjective',
          type: {
            name: 'String'
          }
        },
        status: {
          required: false,
          read_only: true,
          serialized_name: 'properties.status',
          type: {
            name: 'String'
          }
        },
        elastic_pool_name: {
          required: false,
          serialized_name: 'properties.elasticPoolName',
          type: {
            name: 'String'
          }
        },
        default_secondary_location: {
          required: false,
          read_only: true,
          serialized_name: 'properties.defaultSecondaryLocation',
          type: {
            name: 'String'
          }
        },
        service_tier_advisors: {
          required: false,
          read_only: true,
          serialized_name: 'properties.serviceTierAdvisors',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serialized_name: 'ServiceTierAdvisorElementType',
                type: {
                  name: 'Composite',
                  class_name: 'ServiceTierAdvisor'
                }
            }
          }
        },
        transparent_data_encryption: {
          required: false,
          read_only: true,
          serialized_name: 'properties.transparentDataEncryption',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serialized_name: 'TransparentDataEncryptionElementType',
                type: {
                  name: 'Composite',
                  class_name: 'TransparentDataEncryption'
                }
            }
          }
        },
        recommended_index: {
          required: false,
          read_only: true,
          serialized_name: 'properties.recommendedIndex',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serialized_name: 'RecommendedIndexElementType',
                type: {
                  name: 'Composite',
                  class_name: 'RecommendedIndex'
                }
            }
          }
        },
        failover_group_id: {
          required: false,
          read_only: true,
          serialized_name: 'properties.failoverGroupId',
          type: {
            name: 'String'
          }
        },
        read_scale: {
          required: false,
          serialized_name: 'properties.readScale',
          type: {
            name: 'Enum',
            module: 'ReadScale'
          }
        },
        sample_name: {
          required: false,
          serialized_name: 'properties.sampleName',
          type: {
            name: 'String'
          }
        }
      }
    }
  }
end