This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
getDatabase.go
128 lines (123 loc) · 7.49 KB
/
getDatabase.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20200202preview
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func LookupDatabase(ctx *pulumi.Context, args *LookupDatabaseArgs, opts ...pulumi.InvokeOption) (*LookupDatabaseResult, error) {
var rv LookupDatabaseResult
err := ctx.Invoke("azure-nextgen:sql/v20200202preview:getDatabase", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupDatabaseArgs struct {
// The name of the database.
DatabaseName string `pulumi:"databaseName"`
// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The name of the server.
ServerName string `pulumi:"serverName"`
}
// A database resource.
type LookupDatabaseResult struct {
// Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
AutoPauseDelay *int `pulumi:"autoPauseDelay"`
// Collation of the metadata catalog.
CatalogCollation *string `pulumi:"catalogCollation"`
// The collation of the database.
Collation *string `pulumi:"collation"`
// Specifies the mode of database creation.
//
// 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.
//
// Secondary: creates a database as a 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, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.
CreateMode *string `pulumi:"createMode"`
// The creation date of the database (ISO8601 format).
CreationDate string `pulumi:"creationDate"`
// The current service level objective name of the database.
CurrentServiceObjectiveName string `pulumi:"currentServiceObjectiveName"`
// The name and tier of the SKU.
CurrentSku SkuResponse `pulumi:"currentSku"`
// The ID of the database.
DatabaseId string `pulumi:"databaseId"`
// The default secondary region for this database.
DefaultSecondaryLocation string `pulumi:"defaultSecondaryLocation"`
// This records the earliest start date and time that restore is available for this database (ISO8601 format).
EarliestRestoreDate string `pulumi:"earliestRestoreDate"`
// The resource identifier of the elastic pool containing this database.
ElasticPoolId *string `pulumi:"elasticPoolId"`
// Failover Group resource identifier that this database belongs to.
FailoverGroupId string `pulumi:"failoverGroupId"`
// Resource ID.
Id string `pulumi:"id"`
// Kind of database. This is metadata used for the Azure portal experience.
Kind string `pulumi:"kind"`
// The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit.
LicenseType *string `pulumi:"licenseType"`
// Resource location.
Location string `pulumi:"location"`
// The resource identifier of the long term retention backup associated with create operation of this database.
LongTermRetentionBackupResourceId *string `pulumi:"longTermRetentionBackupResourceId"`
// Resource that manages the database.
ManagedBy string `pulumi:"managedBy"`
// The max log size for this database.
MaxLogSizeBytes float64 `pulumi:"maxLogSizeBytes"`
// The max size of the database expressed in bytes.
MaxSizeBytes *float64 `pulumi:"maxSizeBytes"`
// Minimal capacity that database will always have allocated, if not paused
MinCapacity *float64 `pulumi:"minCapacity"`
// Resource name.
Name string `pulumi:"name"`
// The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.
PausedDate string `pulumi:"pausedDate"`
// The number of readonly secondary replicas associated with the database.
ReadReplicaCount *int `pulumi:"readReplicaCount"`
// The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region.
ReadScale *string `pulumi:"readScale"`
// The resource identifier of the recoverable database associated with create operation of this database.
RecoverableDatabaseId *string `pulumi:"recoverableDatabaseId"`
// The resource identifier of the recovery point associated with create operation of this database.
RecoveryServicesRecoveryPointId *string `pulumi:"recoveryServicesRecoveryPointId"`
// The requested service level objective name of the database.
RequestedServiceObjectiveName string `pulumi:"requestedServiceObjectiveName"`
// The resource identifier of the restorable dropped database associated with create operation of this database.
RestorableDroppedDatabaseId *string `pulumi:"restorableDroppedDatabaseId"`
// Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
RestorePointInTime *string `pulumi:"restorePointInTime"`
// The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.
ResumedDate string `pulumi:"resumedDate"`
// The name of the sample schema to apply when creating this database.
SampleName *string `pulumi:"sampleName"`
// The database SKU.
//
// The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands:
Sku *SkuResponse `pulumi:"sku"`
// Specifies the time that the database was deleted.
SourceDatabaseDeletionDate *string `pulumi:"sourceDatabaseDeletionDate"`
// The resource identifier of the source database associated with create operation of this database.
SourceDatabaseId *string `pulumi:"sourceDatabaseId"`
// The status of the database.
Status string `pulumi:"status"`
// The storage account type used to store backups for this database.
StorageAccountType *string `pulumi:"storageAccountType"`
// Resource tags.
Tags map[string]string `pulumi:"tags"`
// Resource type.
Type string `pulumi:"type"`
// Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
ZoneRedundant *bool `pulumi:"zoneRedundant"`
}