Definitions for @turbot/gcp-sql

authorizedNetworksItems

{
"type": "object",
"properties": {
"kind": {
"type": "string"
},
"name": {
"type": "string"
},
"value": {
"type": "string"
},
"expirationTime": {
"$ref": "turbot#/definitions/isoTimestamp"
}
},
"tests": [
{
"description": "base case",
"input": {
"kind": "sql#aclEntry",
"name": "dummy",
"value": "182.76.37.66/32"
}
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/authorizedNetworksItems",
"modUri": "tmod:@turbot/gcp-sql"
}
}

backup

{
"type": "object",
"properties": {
"id": {
"$ref": "#/definitions/backupId"
},
"instance": {
"$ref": "#/definitions/instanceName"
},
"status": {
"$ref": "#/definitions/backupStatus"
},
"turbot": {
"type": "object",
"properties": {
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/backupAka"
}
},
"title": {
"$ref": "#/definitions/backupId"
},
"custom": {
"type": "object",
"properties": {
"gcp": {
"$ref": "gcp#/definitions/gcpMetadata"
},
"createTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
}
}
}
}
}
},
"required": [
"id",
"instance"
],
"additionalProperties": true,
"tests": [
{
"description": "all details provided",
"input": {
"id": 1550663088734,
"instance": "instance-1",
"turbot": {
"custom": {
"gcp": {
"projectId": "cse-legolas-2"
}
},
"title": 1550663088734
}
}
},
{
"description": "invalid - instance property is missing",
"input": {
"id": 1550663088734,
"turbot": {
"custom": {
"gcp": {
"projectId": "cse-legolas-2"
}
},
"title": 1550663088734
}
},
"expected": false
},
{
"description": "invalid - array in string for required property database name",
"input": {
"id": [
1550663088734
],
"instance": "instance-1",
"title": 1550663088734,
"gcp": {
"projectId": "foo-bar",
"regionName": "us-central1"
},
"createTimestamp": "2019-03-19T11:18:11.722Z"
},
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/backup",
"modUri": "tmod:@turbot/gcp-sql"
}
}

backupAka

{
"databaseAka": null,
"type": "string",
"pattern": "^gcp://cloudsql.googleapis.com/projects/[a-z0-9-]{5,29}[a-z0-9]{1}/instances/[a-z](?:[-a-z0-9]{0,86}[a-z0-9])?/backupRuns/[0-9]{13}$",
"tests": [
{
"descritpion": "base case",
"input": "gcp://cloudsql.googleapis.com/projects/cse-legolas-2/instances/instance-1/backupRuns/1552994291722"
},
{
"description": "invalid - invalid arn",
"input": "i.googleapis.com/project/cse-legolas-2/instances/motu",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/backupAka",
"modUri": "tmod:@turbot/gcp-sql"
}
}

backupConfiguration

{
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"binaryLogEnabled": {
"type": "boolean"
}
},
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/backupConfiguration",
"modUri": "tmod:@turbot/gcp-sql"
}
}

backupId

{
"type": "string",
"pattern": "^[0-9]{13}$",
"tests": [
{
"input": 1550663088734
},
{
"input": 1550663088739
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/backupId",
"modUri": "tmod:@turbot/gcp-sql"
}
}

backupServiceNow

{
"defaultColumns": {
"backup_location": {
"column": "enabled",
"label": "Backup Location",
"path": "data.location"
},
"description": {
"column": "enabled",
"label": "Description"
},
"disk_encryption_configuration": {
"column": "enabled",
"label": "Disk Encryption Configuration",
"type": "string",
"size": 1000,
"path": "data.diskEncryptionConfiguration"
},
"disk_encryption_status": {
"column": "enabled",
"label": "Disk Encryption Status",
"type": "string",
"size": 1000,
"path": "data.diskEncryptionStatus"
},
"end_time": {
"column": "enabled",
"label": "End Time"
},
"enqueued_time": {
"column": "enabled",
"label": "Enqueued Time"
},
"error": {
"column": "enabled",
"label": "Error",
"type": "string",
"size": 1000
},
"id": {
"column": "enabled",
"label": "ID",
"path": "data.id"
},
"instance_name": {
"column": "enabled",
"label": "Instance Name",
"path": "data.instance"
},
"kind": {
"column": "enabled",
"label": "Kind"
},
"project": {
"column": "enabled",
"label": "Project",
"path": "metadata.gcp.projectId"
},
"region_name": {
"column": "enabled",
"label": "Region Name",
"path": "metadata.gcp.regionName"
},
"self_link": {
"column": "enabled",
"label": "Self Link"
},
"start_time": {
"column": "enabled",
"label": "Start Time",
"path": "data.startTime"
},
"status": {
"column": "enabled",
"label": "Status"
},
"type": {
"column": "enabled",
"label": "Type"
},
"window_start_time": {
"column": "enabled",
"label": "Window Start Time",
"path": "data.windowStartTime"
}
},
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/backupServiceNow",
"modUri": "tmod:@turbot/gcp-sql"
}
}

backupStatus

{
"type": "string",
"enum": [
"SUCCESSFUL",
"FAILED"
],
"tests": [
{
"input": "FAILED"
},
{
"description": "invalid - empty string",
"input": "",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/backupStatus",
"modUri": "tmod:@turbot/gcp-sql"
}
}

database

{
"type": "object",
"properties": {
"name": {
"$ref": "#/definitions/databaseName"
},
"instance": {
"$ref": "#/definitions/instanceName"
},
"hasData": {
"type": "boolean"
},
"turbot": {
"type": "object",
"properties": {
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/databaseAka"
}
},
"title": {
"$ref": "#/definitions/databaseName"
},
"custom": {
"type": "object",
"properties": {
"gcp": {
"$ref": "gcp#/definitions/gcpMetadata"
},
"createTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
}
}
}
}
}
},
"required": [
"name",
"instance"
],
"additionalProperties": true,
"tests": [
{
"description": "all details provided",
"input": {
"name": "database-1",
"instance": "instance-1",
"turbot": {
"custom": {
"gcp": {
"projectId": "cse-legolas-2"
}
},
"title": "database-1"
}
}
},
{
"description": "invalid - instance property is missing",
"input": {
"name": "database-1",
"turbot": {
"custom": {
"gcp": {
"projectId": "cse-legolas-2"
}
},
"title": "database-1"
}
},
"expected": false
},
{
"description": "invalid - array in string for required property database name",
"input": {
"name": [
"database-1"
],
"instance": "instance-1",
"turbot": {
"custom": {
"gcp": {
"projectId": "cse-legolas-2"
}
},
"title": "database-1"
}
},
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/database",
"modUri": "tmod:@turbot/gcp-sql"
}
}

databaseAka

{
"type": "string",
"pattern": "^gcp://cloudsql.googleapis.com/projects/[a-z0-9-]{5,29}[a-z0-9]{1}/instances/[a-z](?:[-a-z0-9]{0,86}[a-z0-9])?/databases/[a-zA-Z0-9-_]+$",
"tests": [
{
"descritpion": "base case",
"input": "gcp://cloudsql.googleapis.com/projects/cse-legolas-2/instances/instance-1/databases/database-1"
},
{
"description": "invalid - invalid arn",
"input": "i.googleapis.com/project/cse-legolas-2/instance/motu",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/databaseAka",
"modUri": "tmod:@turbot/gcp-sql"
}
}

databaseName

{
"type": "string",
"pattern": "^[a-zA-Z0-9-_]+$",
"tests": [
{
"input": "database-test-123"
},
{
"input": "database_001_"
},
{
"input": 123
},
{
"description": "invalid - can not contain special character",
"input": "test@123",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/databaseName",
"modUri": "tmod:@turbot/gcp-sql"
}
}

databaseServiceNow

{
"defaultColumns": {
"charset": {
"column": "enabled",
"label": "Charset"
},
"collation": {
"column": "enabled",
"label": "Collation"
},
"etag": {
"column": "enabled",
"label": "ETag"
},
"instance_name": {
"column": "enabled",
"label": "Instance Name",
"path": "data.instance"
},
"kind": {
"column": "enabled",
"label": "Kind"
},
"database_location": {
"column": "enabled",
"label": "Location",
"path": "metadata.gcp.regionName"
},
"database_name": {
"column": "enabled",
"label": "Database Name",
"path": "data.name"
},
"project": {
"column": "enabled",
"label": "Project",
"path": "metadata.gcp.projectId"
},
"self_link": {
"column": "enabled",
"label": "Self Link"
},
"sql_server_database_details": {
"column": "enabled",
"label": "SQL Server Database Details",
"path": "data.sqlserverDatabaseDetails",
"size": 2000
}
},
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/databaseServiceNow",
"modUri": "tmod:@turbot/gcp-sql"
}
}

databaseVersion

{
"type": "string",
"enum": [
"POSTGRES_9_6",
"MYSQL_5_6",
"MYSQL_5_5",
"MYSQL_5_7"
],
"tests": [
{
"input": "MYSQL_5_6"
},
{
"description": "invalid - not listed in options",
"input": "NOT RUNNABLE",
"expected": false
},
{
"description": "invalid - empty string",
"input": "",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/databaseVersion",
"modUri": "tmod:@turbot/gcp-sql"
}
}

instance

{
"type": "object",
"properties": {
"name": {
"$ref": "#/definitions/instanceName"
},
"labels": {
"$ref": "gcp#/definitions/labels"
},
"state": {
"$ref": "#/definitions/status"
},
"settings": {
"$ref": "#/definitions/instanceSettings"
},
"users": {
"$ref": "#/definitions/instanceUsers"
},
"databaseVersion": {
"$ref": "#/definitions/databaseVersion"
},
"turbot": {
"type": "object",
"properties": {
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/instanceAka"
}
},
"title": {
"$ref": "#/definitions/instanceName"
},
"tags": {
"$ref": "gcp#/definitions/labels"
},
"custom": {
"type": "object",
"properties": {
"gcp": {
"$ref": "gcp#/definitions/gcpMetadata"
},
"createTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
}
}
}
}
}
},
"required": [
"name"
],
"additionalProperties": true,
"tests": [
{
"description": "all details provided",
"input": {
"name": "instance-1",
"settings": {
"settingsVersion": 15,
"tier": "db-g1-small",
"ipConfiguration": {
"requireSsl": true,
"authorizedNetworks": [
{
"kind": "sql#aclEntry",
"name": "dummy",
"value": "182.76.37.66/32"
},
{
"kind": "sql#aclEntry",
"name": "internet",
"value": "0.0.0.0/0"
}
]
}
},
"users": [
{
"kind": "sql#user",
"name": "mysql.sys",
"etag": "89919d4a2a93eb1ab961a58ce573218d4623602288f64c39b003b9a6dfb6eadd",
"host": "localhost",
"project": "cse-legolas-2",
"instance": "test321"
},
{
"kind": "sql#user",
"name": "root",
"etag": "2c5eda38fa754ae794430ac9b90c5f0c181e45105575217f5fa93ca124b60c4c",
"host": "%",
"project": "cse-legolas-2",
"instance": "test321"
}
],
"databaseVersion": "MYSQL_5_7",
"state": "RUNNABLE",
"labels": {
"foo": "bar",
"foo1": "bar1"
},
"turbot": {
"tags": {
"foo": "bar",
"foo1": "bar1"
},
"custom": {
"gcp": {
"projectId": "cse-legolas-2",
"regionName": "asia-south1"
}
},
"title": "instance-1"
}
}
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/instance",
"modUri": "tmod:@turbot/gcp-sql"
}
}

instanceAka

{
"type": "string",
"pattern": "^gcp://cloudsql.googleapis.com/projects/[a-z0-9-]{5,29}[a-z0-9]{1}/regions/(asia-east1|asia-east2|asia-northeast1|asia-south1|asia-southeast1|australia-southeast1|europe-north1|europe-west1|europe-west2|europe-west3|europe-west4|northamerica-northeast1|southamerica-east1|us-central1|us-east1|us-east4|us-west1|us-west2)/instances/[a-z](?:[-a-z0-9]{0,86}[a-z0-9])?$",
"tests": [
{
"descritpion": "base case",
"input": "gcp://cloudsql.googleapis.com/projects/cse-legolas-2/regions/asia-south1/instances/instance-1"
},
{
"description": "invalid - invalid arn",
"input": "i.googleapis.com/project/cse-legolas-2/instance/motu",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/instanceAka",
"modUri": "tmod:@turbot/gcp-sql"
}
}

instanceName

{
"type": "string",
"pattern": "^[a-z](?:[-a-z0-9]{0,86}[a-z0-9])?$",
"tests": [
{
"input": "snap-test-123"
},
{
"description": "max length",
"input": "a123456789-a123456789-a123456789-a123456789-a123456789-a123456789-a123456789-a12345678"
},
{
"description": "invalid - should not contain uppercase",
"input": "Test",
"expected": false
},
{
"description": "invalid - can not contain special(at) character",
"input": "snaptest@123",
"expected": false
},
{
"description": "invalid - too long",
"input": "a123456789-a123456789-a123456789-a123456789-a123456789-a123456789-a123456789-a123456789-a123456789-a123456789",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/instanceName",
"modUri": "tmod:@turbot/gcp-sql"
}
}

instanceServiceNow

{
"defaultColumns": {
"availability_type": {
"column": "enabled"
},
"backup_enabled": {
"column": "enabled",
"type": "boolean",
"path": "data.settings.backupConfiguration.enabled"
},
"backup_start_time": {
"column": "enabled",
"path": "data.settings.backupConfiguration.startTime"
},
"current_disk_size": {
"column": "enabled"
},
"data_disk_size_gb": {
"column": "enabled",
"label": "Data Disk Size GB",
"path": "data.settings.dataDiskSizeGb"
},
"database_version": {
"column": "enabled"
},
"enable_point_in_time_recovery": {
"column": "enabled",
"type": "boolean",
"path": "data.settings.backupConfiguration.pointInTimeRecoveryEnabled"
},
"gce_zone": {
"column": "enabled"
},
"instance_type": {
"column": "enabled"
},
"ip_addresses": {
"column": "enabled",
"label": "IP Addresses",
"type": "string",
"size": 1000
},
"ip_configuration": {
"column": "enabled",
"label": "IP Configuration",
"type": "string",
"size": 1000,
"path": "data.settings.ipConfiguration"
},
"ipv6_address": {
"column": "enabled",
"label": "IPv6 Address"
},
"kms_key_name": {
"column": "enabled",
"label": "KMS Key Name",
"path": "data.diskEncryptionConfiguration.kmsKeyName"
},
"labels": {
"column": "enabled",
"type": "string",
"size": 1000,
"path": "data.settings.userLabels"
},
"machine_type": {
"column": "enabled",
"path": "data.settings.tier"
},
"maintenance_window": {
"column": "enabled",
"type": "string",
"size": 1000,
"path": "data.settings.maintenanceWindow"
},
"max_disk_size": {
"column": "enabled"
},
"instance_name": {
"column": "enabled",
"label": "Instance Name",
"path": "data.name"
},
"project": {
"column": "enabled",
"type": "string",
"path": "metadata.gcp.projectId"
},
"region": {
"column": "enabled",
"path": "metadata.gcp.regionName"
},
"service_account_email_address": {
"column": "enabled"
},
"ssl_configuration": {
"column": "enabled",
"label": "SSL Configuration",
"type": "string",
"size": 1000,
"path": "data.serverCaCert"
},
"state": {
"column": "enabled"
},
"storage_auto_resize": {
"column": "enabled",
"type": "boolean",
"path": "data.settings.storageAutoResize"
},
"tags": {
"column": "enabled",
"type": "string",
"size": 1000,
"path": "data.settings.userLabels"
}
},
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/instanceServiceNow",
"modUri": "tmod:@turbot/gcp-sql"
}
}

instanceSettings

{
"type": "object",
"properties": {
"backupConfiguration": {
"$ref": "#/definitions/backupConfiguration"
},
"settingsVersion": {
"$ref": "#/definitions/instanceSettingsVersion"
},
"tier": {
"$ref": "#/definitions/instanceTier"
},
"ipConfiguration": {
"$ref": "#/definitions/ipConfiguration"
}
},
"tests": [
{
"description": "base case",
"input": {
"settingsVersion": 15,
"tier": "db-g1-small",
"ipConfiguration": {
"requireSsl": true,
"authorizedNetworks": [
{
"kind": "sql#aclEntry",
"name": "dummy",
"value": "182.76.37.66/32"
},
{
"kind": "sql#aclEntry",
"name": "internet",
"value": "0.0.0.0/0"
}
]
}
}
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/instanceSettings",
"modUri": "tmod:@turbot/gcp-sql"
}
}

instanceSettingsVersion

{
"type": "string",
"tests": [
{
"input": 5
},
{
"input": 15
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/instanceSettingsVersion",
"modUri": "tmod:@turbot/gcp-sql"
}
}

instanceTier

{
"type": "string",
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/instanceTier",
"modUri": "tmod:@turbot/gcp-sql"
}
}

instanceUsers

{
"type": "array",
"items": {
"$ref": "#/definitions/instanceUsersDetails"
},
"tests": [
{
"description": "base case",
"input": [
{
"kind": "sql#user",
"name": "root",
"etag": "2c5eda38fa754ae794430ac9b90c5f0c181e45105575217f5fa93ca124b60c4c",
"host": "/0",
"project": "cse-legolas-2"
},
{
"kind": "sql#user",
"name": "root",
"etag": "2c5eda38fa754ae794430ac9b90c5f0c181e45105575217f5fa93ca124b60c4c",
"host": "%",
"project": "cse-legolas-2"
}
]
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/instanceUsers",
"modUri": "tmod:@turbot/gcp-sql"
}
}

instanceUsersDetails

{
"type": "object",
"properties": {
"etag": {
"type": "string"
},
"host": {
"type": "string"
},
"instance": {
"type": "string"
},
"kind": {
"type": "string"
},
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"project": {
"type": "string"
}
},
"tests": [
{
"description": "base case",
"input": {
"name": "root",
"host": "%"
}
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/instanceUsersDetails",
"modUri": "tmod:@turbot/gcp-sql"
}
}

ipConfigAuthorizedNetworks

{
"type": "array",
"minItems": 0,
"items": {
"$ref": "#/definitions/authorizedNetworksItems"
},
"tests": [
{
"description": "base case",
"input": [
{
"kind": "sql#aclEntry",
"name": "dummy",
"value": "182.76.37.66/32"
},
{
"kind": "sql#aclEntry",
"name": "dummy",
"value": "182.76.37.66/32"
}
]
},
{
"description": "valid - empty list",
"input": []
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/ipConfigAuthorizedNetworks",
"modUri": "tmod:@turbot/gcp-sql"
}
}

ipConfiguration

{
"type": "object",
"properties": {
"requireSsl": {
"type": "boolean"
},
"authorizedNetworks": {
"$ref": "#/definitions/ipConfigAuthorizedNetworks"
},
"expirationTime": {
"$ref": "turbot#/definitions/isoTimestamp"
},
"kind": {
"const": "sql#aclEntry"
},
"name": {
"type": "string"
},
"value": {
"type": "string"
},
"ipv4Enabled": {
"type": "boolean"
},
"privateNetwork": {
"type": "string"
}
},
"tests": [
{
"description": "base case",
"input": {
"requireSsl": true,
"authorizedNetworks": [
{
"kind": "sql#aclEntry",
"name": "dummy",
"value": "182.76.37.66/32"
},
{
"kind": "sql#aclEntry",
"name": "internet",
"value": "0.0.0.0/0"
}
]
}
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/ipConfiguration",
"modUri": "tmod:@turbot/gcp-sql"
}
}

sql

{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"state": {
"$ref": "gcp#/definitions/state"
},
"config": {
"type": "object"
},
"parent": {
"type": "string"
},
"turbot": {
"type": "object",
"properties": {
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/sqlAka"
}
},
"title": {
"type": "string"
},
"custom": {
"type": "object",
"properties": {
"gcp": {
"$ref": "gcp#/definitions/gcpMetadata"
}
}
}
}
}
},
"required": [
"name"
],
"tests": [
{
"description": "Valid - base test",
"input": {
"name": "projects/932405488407/services/sqladmin.googleapis.com",
"turbot": {
"akas": [
"gcp://serviceusage.googleapis.com/projects/932405488407/services/sqladmin.googleapis.com"
],
"title": "Cloud SQL Admin API",
"custom": {
"gcp": {
"projectId": "cse-legolas-2"
}
}
}
}
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/sql",
"modUri": "tmod:@turbot/gcp-sql"
}
}

sqlAka

{
"type": "string",
"pattern": "^gcp://serviceusage.googleapis.com/projects/[0-9]{12}/services/sqladmin.googleapis.com",
"tests": [
{
"description": "base",
"input": "gcp://serviceusage.googleapis.com/projects/932405488407/services/sqladmin.googleapis.com"
},
{
"description": "invalid aka",
"input": "gcp://serviceusage.googleapis.com/projects/cse-legolas-2/services/sqladmin.googleapis.com",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/sqlAka",
"modUri": "tmod:@turbot/gcp-sql"
}
}

status

{
"type": "string",
"enum": [
"RUNNABLE",
"SUSPENDED",
"PENDING_CREATE",
"MAINTENANCE",
"FAILED",
"UNKNOWN_STATE"
],
"tests": [
{
"input": "RUNNABLE"
},
{
"input": "FAILED"
},
{
"description": "invalid - not listed in options",
"input": "NOT RUNNABLE",
"expected": false
},
{
"description": "invalid - null value",
"input": null,
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-sql#/definitions/status",
"modUri": "tmod:@turbot/gcp-sql"
}
}