const ( DatabaseServerVersion11 = "2.0" DatabaseServerVersion12 = "12.0" )
Definitions of numerous constants representing API endpoints.
const (
DatabaseStateCreating = "Creating"
)
DatabaseCreateParams represents the set of possible parameters when issuing a database creation to Azure, and reading a list response from Azure.
https://msdn.microsoft.com/en-us/library/azure/dn505701.aspx
type DatabaseCreateParams struct { XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ServiceResource"` Name string Edition string `xml:",omitempty"` CollationName string `xml:",omitempty"` MaxSizeBytes int64 `xml:",omitempty"` ServiceObjectiveID string `xml:"ServiceObjectiveId,omitempty"` }
DatabaseServer represents the set of data received from a database server list operation.
https://msdn.microsoft.com/en-us/library/azure/dn505702.aspx
type DatabaseServer struct { Name string AdministratorLogin string Location string FullyQualifiedDomainName string Version string State string }
DatabaseServerCreateParams represents the set of possible parameters when issuing a database server creation request to Azure.
https://msdn.microsoft.com/en-us/library/azure/dn505699.aspx
type DatabaseServerCreateParams struct { XMLName xml.Name `xml:"http://schemas.microsoft.com/sqlazure/2010/12/ Server"` AdministratorLogin string AdministratorLoginPassword string Location string Version string }
DatabaseServerCreateResponse represents the response following the creation of a database server on Azure.
type DatabaseServerCreateResponse struct { ServerName string }
FirewallRuleCreateParams represents the set of possible parameters when creating a firewall rule on an Azure database server.
https://msdn.microsoft.com/en-us/library/azure/dn505712.aspx
type FirewallRuleCreateParams struct { XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ServiceResource"` Name string StartIPAddress string EndIPAddress string }
FirewallRuleResponse represents the set of data received from an Azure database server firewall rule get response.
https://msdn.microsoft.com/en-us/library/azure/dn505698.aspx
type FirewallRuleResponse struct { Name string StartIPAddress string EndIPAddress string }
FirewallRuleUpdateParams represents the set of possible parameters when issuing an update of a database server firewall rule.
https://msdn.microsoft.com/en-us/library/azure/dn505707.aspx
type FirewallRuleUpdateParams struct { XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ServiceResource"` Name string StartIPAddress string EndIPAddress string }
type ListDatabasesResponse struct { ServiceResources []ServiceResource `xml:"ServiceResource"` }
type ListFirewallRulesResponse struct { FirewallRules []FirewallRuleResponse `xml:"ServiceResource"` }
type ListServersResponse struct { DatabaseServers []DatabaseServer `xml:"Server"` }
SQLDatabaseClient defines various database CRUD operations. It contains a management.Client for making the actual http calls.
type SQLDatabaseClient struct {
// contains filtered or unexported fields
}
func NewClient(mgmtClient management.Client) SQLDatabaseClient
NewClient returns a new SQLDatabaseClient struct with the provided management.Client as the underlying client.
func (c SQLDatabaseClient) CreateDatabase(server string, params DatabaseCreateParams) error
CreateDatabase creates a new Microsoft Azure SQL Database on the given database server.
https://msdn.microsoft.com/en-us/library/azure/dn505701.aspx
func (c SQLDatabaseClient) CreateFirewallRule(server string, params FirewallRuleCreateParams) error
CreateFirewallRule creates an Azure SQL Database server firewall rule.
https://msdn.microsoft.com/en-us/library/azure/dn505712.aspx
func (c SQLDatabaseClient) CreateServer(params DatabaseServerCreateParams) (string, error)
CreateServer creates a new Azure SQL Database server and return its name.
https://msdn.microsoft.com/en-us/library/azure/dn505699.aspx
func (c SQLDatabaseClient) DeleteDatabase(server, database string) error
DeleteDatabase deletes the Azure SQL Database off the given server.
https://msdn.microsoft.com/en-us/library/azure/dn505705.aspx
func (c SQLDatabaseClient) DeleteFirewallRule(server, ruleName string) error
DeleteFirewallRule deletes an Azure SQL Database server firewall rule.
https://msdn.microsoft.com/en-us/library/azure/dn505706.aspx
func (c SQLDatabaseClient) DeleteServer(name string) error
DeleteServer deletes an Azure SQL Database server (including all its databases).
https://msdn.microsoft.com/en-us/library/azure/dn505695.aspx
func (c SQLDatabaseClient) GetDatabase(server, database string) (ServiceResource, error)
GetDatabase gets the details for an Azure SQL Database.
https://msdn.microsoft.com/en-us/library/azure/dn505708.aspx
func (c SQLDatabaseClient) GetFirewallRule(server, ruleName string) (FirewallRuleResponse, error)
GetFirewallRule gets the details of an Azure SQL Database Server firewall rule.
https://msdn.microsoft.com/en-us/library/azure/dn505698.aspx
func (c SQLDatabaseClient) ListDatabases(server string) (ListDatabasesResponse, error)
ListDatabases returns a list of Azure SQL Databases on the given server.
https://msdn.microsoft.com/en-us/library/azure/dn505711.aspx
func (c SQLDatabaseClient) ListFirewallRules(server string) (ListFirewallRulesResponse, error)
ListFirewallRules retrieves the set of firewall rules for an Azure SQL Database Server.
https://msdn.microsoft.com/en-us/library/azure/dn505715.aspx
func (c SQLDatabaseClient) ListServers() (ListServersResponse, error)
ListServers retrieves the Azure SQL Database servers for this subscription.
https://msdn.microsoft.com/en-us/library/azure/dn505702.aspx
func (c SQLDatabaseClient) UpdateDatabase( server, database string, params ServiceResourceUpdateParams) (management.OperationID, error)
UpdateDatabase updates the details of the given Database off the given server.
https://msdn.microsoft.com/en-us/library/azure/dn505718.aspx
func (c SQLDatabaseClient) UpdateFirewallRule(server, ruleName string, params FirewallRuleUpdateParams) error
UpdateFirewallRule update a firewall rule for an Azure SQL Database server.
https://msdn.microsoft.com/en-us/library/azure/dn505707.aspx
func (c SQLDatabaseClient) WaitForDatabaseCreation( server, database string, cancel chan struct{}) error
WaitForDatabaseCreation is a helper method which waits for the creation of the database on the given server.
ServiceResource represents the set of parameters obtained from a database get or list call.
https://msdn.microsoft.com/en-us/library/azure/dn505708.aspx
type ServiceResource struct { Name string State string SelfLink string Edition string CollationName string MaxSizeBytes int64 ServiceObjectiveID string `xml:"ServiceObjectiveId,omitempty"` }
ServiceResourceUpdateParams represents the set of parameters available for a database service update operation.
https://msdn.microsoft.com/en-us/library/azure/dn505718.aspx
type ServiceResourceUpdateParams struct { XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ServiceResource"` Name string Edition string `xml:",omitempty"` MaxSizeBytes int64 `xml:",omitempty"` ServiceObjectiveID string `xml:"ServiceObjectiveId,omitempty"` }