Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Managed Service for SQL Server™
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Information about existing clusters
    • Creating clusters
    • Connecting to databases
    • Stopping and starting clusters
    • Changing cluster and database settings
    • Managing SQL Server hosts
    • Managing databases
    • Managing users
    • Granting permissions and roles
    • Managing backups
    • Deleting clusters
  • Concepts
    • Relationship between service resources
    • Host classes
    • Networks in Managed Service for SQL Server
    • Quotas and limits
    • Storage types
    • Backups
  • Access management
  • Pricing policy
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • BackupService
      • ClusterService
      • DatabaseService
      • ResourcePresetService
      • UserService
      • OperationService
    • REST
      • Overview
      • Backup
        • Overview
        • get
        • list
      • Cluster
        • Overview
        • backup
        • create
        • delete
        • get
        • list
        • listBackups
        • listHosts
        • listLogs
        • listOperations
        • move
        • restore
        • start
        • stop
        • update
      • Database
        • Overview
        • create
        • delete
        • get
        • list
      • ResourcePreset
        • Overview
        • get
        • list
      • User
        • Overview
        • create
        • delete
        • get
        • grantPermission
        • list
        • revokePermission
        • update
      • Operation
        • Overview
        • get
  • Questions and answers
    • General questions
  1. API reference
  2. REST
  3. Cluster
  4. create

Method create

  • HTTP request
  • Body parameters
  • Response

Creates an SQL Server cluster in the specified folder.

HTTP request

POST https://mdb.api.cloud.yandex.net/mdb/sqlserver/v1alpha/clusters

Body parameters

{
  "folderId": "string",
  "name": "string",
  "description": "string",
  "labels": "object",
  "environment": "string",
  "configSpec": {
    "version": "string",
    "resources": {
      "resourcePresetId": "string",
      "diskSize": "string",
      "diskTypeId": "string"
    },
    "backupWindowStart": {
      "hours": "integer",
      "minutes": "integer",
      "seconds": "integer",
      "nanos": "integer"
    },
    "sqlserverConfig_2016Sp2": {
      "maxDegreeOfParallelism": "integer",
      "costThresholdForParallelism": "integer",
      "sqlcollation": "string",
      "auditLevel": "integer",
      "filestreamAccessLevel": "integer",
      "fillFactorPercent": "integer",
      "inDoubtXactResolution": "integer",
      "optimizeForAdHocWorkloads": true,
      "crossDbOwnershipChaining": true
    }
  },
  "databaseSpecs": [
    {
      "name": "string"
    }
  ],
  "userSpecs": [
    {
      "name": "string",
      "password": "string",
      "permissions": [
        {
          "databaseName": "string",
          "roles": [
            "string"
          ]
        }
      ]
    }
  ],
  "hostSpecs": [
    {
      "zoneId": "string",
      "subnetId": "string",
      "assignPublicIp": true
    }
  ],
  "networkId": "string"
}
Field Description
folderId string

Required. ID of the folder to create the SQL Server cluster in.

To get the folder ID, use a list request.

The maximum string length in characters is 50.

name string

Required. Name of the SQL Server cluster. The name must be unique within the folder.

The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]*.

description string

Description of the SQL Server cluster.

The maximum string length in characters is 256.

labels object

Custom labels for the SQL Server cluster as key:value pairs. For example, "project": "mvp" or "source": "dictionary".

No more than 64 per resource. The string length in characters for each key must be 1-63. Each key must match the regular expression [a-z][-_0-9a-z]*. The maximum string length in characters for each value is 63. Each value must match the regular expression [-_0-9a-z]*.

environment string

Deployment environment of the SQL Server cluster.

  • PRODUCTION: Stable environment with a conservative update policy: only hotfixes are applied during regular maintenance.
  • PRESTABLE: Environment with more aggressive update policy: new versions are rolled out irrespective of backward compatibility.
configSpec object

SQL Server and hosts configuration for the cluster.

configSpec.
version
string

Version of SQL Server used in the cluster.

Possible values:

  • 2016sp2
configSpec.
resources
object
Resources allocated to SQL Server hosts.
configSpec.
resources.
resourcePresetId
string

ID of the preset for computational resources available to a host (CPU, memory etc.). All available presets are listed in the documentation.

configSpec.
resources.
diskSize
string (int64)

Volume of the storage available to a host.

configSpec.
resources.
diskTypeId
string

Type of the storage environment for the host.

Possible values:

  • network-hdd — network HDD drive,
  • network-ssd — network SSD drive,
  • local-ssd — local SSD storage.
configSpec.
backupWindowStart
object
Start time for the daily backup in UTC timezone

Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and google.protobuf.Timestamp.

configSpec.
backupWindowStart.
hours
integer (int32)

Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.

configSpec.
backupWindowStart.
minutes
integer (int32)

Minutes of hour of day. Must be from 0 to 59.

configSpec.
backupWindowStart.
seconds
integer (int32)

Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.

configSpec.
backupWindowStart.
nanos
integer (int32)

Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.

configSpec.
sqlserverConfig_2016Sp2
object
Configuration for an SQL Server 2016 SP2 cluster.

SQL Server 2016 SP2 supported configuration options are listed here.

Detailed description for each set of options is available in SQL Server documentation.

Any options that are not listed here are not supported.

configSpec.
sqlserverConfig_2016Sp2.
maxDegreeOfParallelism
integer (int64)

Limits the number of processors to use in parallel plan execution per task.

See in-depth description in SQL Server documentation.

Acceptable values are 1 to 99, inclusive.

configSpec.
sqlserverConfig_2016Sp2.
costThresholdForParallelism
integer (int64)

Specifies the threshold at which SQL Server creates and runs parallel plans for queries.

SQL Server creates and runs a parallel plan for a query only when the estimated cost to run a serial plan for the same query is higher than the value of the option.

See in-depth description in SQL Server documentation.

Acceptable values are 5 to 32767, inclusive.

configSpec.
sqlserverConfig_2016Sp2.
sqlcollation
string

Collation used for databases across the instance. Determines if instance is case sensitive, accent sensitive etc.

See in-depth description in SQL Server documentation.

configSpec.
sqlserverConfig_2016Sp2.
auditLevel
integer (int64)

Describes how to configure login auditing to monitor SQL Server Database Engine login activity. Possible values:

  • 0 — do not log login attempts,
  • 1 — log only failed login attempts,
  • 2 — log only successful login attempts (not recommended),
  • 3 — log all login attempts (not recommended).

See in-depth description in SQL Server documentation.

Acceptable values are 0 to 3, inclusive.

configSpec.
sqlserverConfig_2016Sp2.
filestreamAccessLevel
integer (int64)

Determines the FILESTREAM access level for the SQL Server instance. FILESTREAM technology enables SQL Server-based applications to store BLOB data, such as documents and images, on the file system outside of a database. Possible values:

  • 0 — disables FILESTREAM,
  • 1 — enables FILESTREAM for Transact-SQL access,
  • 2 — enables FILESTREAM for Transact-SQL and Win32 streaming access.

See in-depth description in SQL Server documentation.

Acceptable values are 0 to 2, inclusive.

configSpec.
sqlserverConfig_2016Sp2.
fillFactorPercent
integer (int64)

Manages the fill factor server configuration option. When an index is created or rebuilt the fill factor determines the percentage of space on each index leaf-level page to be filled with data, reserving the rest as free space for future growth.

Values 0 and 100 mean full page usage (no space reserved).

See in-depth description in SQL Server documentation.

Acceptable values are 0 to 100, inclusive.

configSpec.
sqlserverConfig_2016Sp2.
inDoubtXactResolution
integer (int64)

Determines the default outcome of distributed transactions that the Microsoft Distributed Transaction Coordinator (MS DTC) is unable to resolve (in-doubt distributed transactions). Possible values:

  • 0 — no automatic resolution, recovery fails if MS DTC cannot resolve any in-doubt transactions,
  • 1 — assume in-doubt transactions committed,
  • 2 — assume in-doubt transactions uncommitted and roll them back.

See in-depth description in SQL Server documentation.

Acceptable values are 0 to 2, inclusive.

configSpec.
sqlserverConfig_2016Sp2.
optimizeForAdHocWorkloads
boolean (boolean)

Determines whether plans should be cached only after second execution. Allows to avoid SQL cache bloat because of single-use plans.

See in-depth description in SQL Server documentation.

configSpec.
sqlserverConfig_2016Sp2.
crossDbOwnershipChaining
boolean (boolean)

Enables cross-database ownership chaining. Example: having explicit access to stored procedure in one database that refers to an object in another database that you don't have explicit access, you'll be able to execute the procedure without permission related error.

See in-depth description in SQL Server documentation.

databaseSpecs[] object

One or more configurations of databases to be created in the SQL Server cluster.

databaseSpecs[].
name
string

Required. Name of the database.

The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_-]*.

userSpecs[] object

One or more configurations of database users to be created in the SQL Server cluster.

userSpecs[].
name
string

Required. Name of the SQL Server user.

The maximum string length in characters is 32. Value must match the regular expression [a-zA-Z0-9_]*.

userSpecs[].
password
string

Required. Password of the SQL Server user.

The string length in characters must be 8-128.

userSpecs[].
permissions[]
object

Set of permissions to grant to the user.

userSpecs[].
permissions[].
databaseName
string

Name of the database the permission grants access to.

userSpecs[].
permissions[].
roles[]
string
  • DB_OWNER: Members of this fixed database role can perform all configuration and maintenance activities on the database, and can also drop the database in SQL Server.
  • DB_SECURITYADMIN: Members of this fixed database role can modify role membership for custom roles only and manage permissions. They can potentially elevate their privileges and their actions should be monitored.
  • DB_ACCESSADMIN: Members of this fixed database role can add or remove access to the database for Windows logins, Windows groups, and SQL Server logins.
  • DB_BACKUPOPERATOR: Members of this fixed database role can back up the database.
  • DB_DDLADMIN: Members of this fixed database role can run any Data Definition Language (DDL) command in a database.
  • DB_DATAWRITER: Members of this fixed database role can add, delete, or change data in all user tables.
  • DB_DATAREADER: Members of this fixed database role can read all data from all user tables.
  • DB_DENYDATAWRITER: Members of this fixed database role cannot add, modify, or delete any data in the user tables within a database. Denial has a higher priority than a grant, so you can use this role to quickly restrict one's privileges without explicitly revoking permissions or roles.
  • DB_DENYDATAREADER: Members of this fixed database role cannot read any data in the user tables within a database. Denial has a higher priority than a grant, so you can use this role to quickly restrict one's privileges without explicitly revoking permissions or roles.
hostSpecs[] object

One or more configurations of hosts to be created in the SQL Server cluster.

hostSpecs[].
zoneId
string

ID of the availability zone where the host resides.

To get the list of available zones, use the list request.

The maximum string length in characters is 50.

hostSpecs[].
subnetId
string

ID of the subnet that the host should belong to. This subnet should be a part of the network that the cluster belongs to. The ID of the network is set in the field Cluster.networkId.

The maximum string length in characters is 50.

hostSpecs[].
assignPublicIp
boolean (boolean)

Whether the host should get a public IP address on creation.

After a host has been created, this setting cannot be changed. To remove an assigned public IP, or to assign a public IP to a host without one, recreate the host with assignPublicIp set as needed.

Possible values:

  • false — don't assign a public IP to the host.
  • true — the host should have a public IP address.
networkId string

ID of the network to create the SQL Server cluster in.

The maximum string length in characters is 50.

Response

HTTP Code: 200 - OK

{
  "id": "string",
  "description": "string",
  "createdAt": "string",
  "createdBy": "string",
  "modifiedAt": "string",
  "done": true,
  "metadata": "object",

  //  includes only one of the fields `error`, `response`
  "error": {
    "code": "integer",
    "message": "string",
    "details": [
      "object"
    ]
  },
  "response": "object",
  // end of the list of possible fields

}

An Operation resource. For more information, see Operation.

Field Description
id string

ID of the operation.

description string

Description of the operation. 0-256 characters long.

createdAt string (date-time)

Creation timestamp.

String in RFC3339 text format.

createdBy string

ID of the user or service account who initiated the operation.

modifiedAt string (date-time)

The time when the Operation resource was last modified.

String in RFC3339 text format.

done boolean (boolean)

If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.

metadata object

Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.

error object
The error result of the operation in case of failure or cancellation.
includes only one of the fields error, response

The error result of the operation in case of failure or cancellation.

error.
code
integer (int32)

Error code. An enum value of google.rpc.Code.

error.
message
string

An error message.

error.
details[]
object

A list of messages that carry the error details.

response object
includes only one of the fields error, response

The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is the standard Create/Update, the response should be the target resource of the operation. Any method that returns a long-running operation should document the response type, if any.

In this article:
  • HTTP request
  • Body parameters
  • Response
Language
Careers
Privacy policy
Terms of use
© 2021 Yandex.Cloud LLC