Definitions for @turbot/gcp-storage

bucket

{
"type": "object",
"properties": {
"name": {
"$ref": "#/definitions/bucketName"
},
"labels": {
"$ref": "gcp#/definitions/labels"
},
"encryption": {
"$ref": "#/definitions/bucketEncryption"
},
"logging": {
"$ref": "#/definitions/bucketLogging"
},
"iamConfiguration": {
"$ref": "#/definitions/bucketIamConfiguration"
},
"iamPolicy": {
"$ref": "gcp-iam#/definitions/projectIamPolicy"
},
"kind": {
"$ref": "#/definitions/bucketKind"
},
"versioning": {
"$ref": "#/definitions/bucketVersioning"
},
"turbot": {
"type": "object",
"properties": {
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/bucketAka"
}
},
"tags": {
"$ref": "gcp#/definitions/labels"
},
"title": {
"$ref": "#/definitions/bucketName"
},
"custom": {
"type": "object",
"properties": {
"createTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
},
"gcp": {
"$ref": "gcp#/definitions/gcpMetadata"
}
}
}
}
}
},
"required": [
"name"
],
"additionalProperties": true,
"tests": [
{
"description": "Valid - All properties",
"input": {
"name": "fancy-bucket",
"labels": {
"foo": "bar",
"foo1": "bar1"
},
"turbot": {
"akas": [
"gcp://storage.googleapis.com/projects/foo-bar/buckets/fancy-bucket"
],
"tags": {
"foo": "bar",
"foo1": "bar1"
},
"title": "fancy-bucket",
"custom": {
"createTimestamp": "2019-02-13T16:06:19.156Z",
"gcp": {
"projectId": "foo-bar",
"regionName": "us-east1"
}
}
}
}
},
{
"description": "Invalid - Missing name",
"input": {
"labels": {
"foo": "bar",
"foo1": "bar1"
},
"turbot": {
"akas": [
"gcp://storage.googleapis.com/projects/foo-bar/buckets/fancy-bucket"
],
"tags": {
"foo": "bar",
"foo1": "bar1"
},
"title": "fancy-bucket",
"custom": {
"createTimestamp": "2019-02-13T16:06:19.156Z",
"gcp": {
"projectId": "foo-bar",
"regionName": "us-east1"
}
}
}
},
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/bucket",
"modUri": "tmod:@turbot/gcp-storage"
}
}

bucketAka

{
"type": "string",
"pattern": "^gcp://storage.googleapis.com/projects/[a-z][a-z0-9-]{4,28}[a-z0-9]/buckets/[a-z0-9-._]{3,63}$",
"tests": [
{
"descritpion": "base case",
"input": "gcp://storage.googleapis.com/projects/aar-a4b6d489/buckets/my-fancy-bucket"
},
{
"descritpion": "invalid - invalid bucket name",
"input": "gcp://storage.googleapis.com/projects/aar-a4b6d489/buckets/my",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/bucketAka",
"modUri": "tmod:@turbot/gcp-storage"
}
}

bucketEncryption

{
"type": "object",
"properties": {
"defaultKmsKeyName": {
"type": "string"
}
},
"tests": [
{
"description": "base case",
"input": {
"defaultKmsKeyName": "projects/cse-legolas/locations/global/keyRings/test/cryptoKeys/disk/cryptoKeyVersions/1"
}
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/bucketEncryption",
"modUri": "tmod:@turbot/gcp-storage"
}
}

bucketIamConfiguration

{
"type": "object",
"properties": {
"bucketPolicyOnly": {
"$ref": "#/definitions/bucketPolicyOnly"
}
},
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/bucketIamConfiguration",
"modUri": "tmod:@turbot/gcp-storage"
}
}

bucketKind

{
"type": "string",
"const": "storage#bucket",
"tests": [
{
"input": "storage#bucket"
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/bucketKind",
"modUri": "tmod:@turbot/gcp-storage"
}
}

bucketLogging

{
"type": "object",
"properties": {
"logBucket": {
"type": "string"
},
"logObjectPrefix": {
"type": "string"
}
},
"tests": [
{
"description": "base case",
"input": {
"logBucket": "cse-legolas-2-logging-bucket",
"logObjectPrefix": "turbot-bucket"
}
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/bucketLogging",
"modUri": "tmod:@turbot/gcp-storage"
}
}

bucketName

{
"type": "string",
"pattern": "^([a-z0-9-._]{3,63})$",
"tests": [
{
"input": "test"
},
{
"description": "invalid - must be lowercase",
"input": "BucketName",
"expected": false
},
{
"description": "invalid - cannot contain at symbol",
"input": "bucket@name",
"expected": false
},
{
"description": "invalid - too short",
"input": "aa",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/bucketName",
"modUri": "tmod:@turbot/gcp-storage"
}
}

bucketPolicyOnly

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

bucketServiceNow

{
"defaultColumns": {
"acl": {
"column": "enabled",
"label": "ACL",
"type": "string",
"size": 1000
},
"billing_requester_pays": {
"column": "enabled",
"type": "boolean",
"path": "data.billing.requesterPays"
},
"default_kms_key_name": {
"column": "enabled",
"label": "Default Kms Key Name",
"path": "data.encryption.defaultKmsKeyName"
},
"default_object_acl": {
"column": "enabled",
"label": "Default Object ACL",
"type": "string",
"size": 1000
},
"iam_configuration_bucket_policy_only_enabled": {
"column": "enabled",
"label": "IAM Configuration Bucket Policy Only Enabled",
"type": "boolean",
"path": "data.iamConfiguration.bucketPolicyOnly.enabled"
},
"iam_configuration_public_access_prevention": {
"column": "enabled",
"label": "IAM Configuration Public Access Prevention",
"path": "data.iamConfiguration.publicAccessPrevention"
},
"iam_configuration_uniform_bucket_level_access_enabled": {
"column": "enabled",
"label": "IAM Configuration Uniform Bucket Level Access Enabled",
"type": "boolean",
"path": "data.iamConfiguration.uniformBucketLevelAccess.enabled"
},
"iam_policy": {
"column": "enabled",
"label": "IAM Policy",
"type": "string",
"size": 1000
},
"id": {
"column": "enabled",
"label": "ID"
},
"labels": {
"column": "enabled",
"type": "string",
"size": 1000
},
"lifecycle_rules": {
"column": "enabled",
"type": "string",
"size": 1000,
"path": "data.lifecycle.rule"
},
"bucket_location": {
"column": "enabled",
"label": "Bucket Location",
"path": "data.location"
},
"location_type": {
"column": "enabled"
},
"log_bucket": {
"column": "enabled",
"path": "data.logging.logBucket"
},
"log_object_prefix": {
"column": "enabled",
"path": "data.logging.logObjectPrefix"
},
"metageneration": {
"column": "enabled",
"label": "Metageneration"
},
"bucket_name": {
"column": "enabled",
"label": "Bucket Name",
"path": "data.name"
},
"project": {
"column": "enabled",
"type": "string",
"path": "metadata.gcp.projectId"
},
"project_number": {
"column": "enabled"
},
"region": {
"column": "enabled",
"path": "metadata.gcp.regionName"
},
"retention_policy": {
"column": "enabled",
"type": "string",
"size": 1000
},
"self_link": {
"column": "enabled"
},
"storage_class": {
"column": "enabled"
},
"tags": {
"column": "enabled",
"type": "string",
"size": 1000,
"path": "data.labels"
},
"time_created": {
"column": "enabled"
},
"updated": {
"column": "enabled"
},
"versioning_enabled": {
"column": "enabled",
"type": "boolean",
"path": "data.versioning.enabled"
},
"website_main_page_suffix": {
"column": "enabled",
"path": "data.website.mainPageSuffix"
},
"website_not_found_page": {
"column": "enabled",
"path": "data.website.notFoundPage"
}
},
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/bucketServiceNow",
"modUri": "tmod:@turbot/gcp-storage"
}
}

bucketVersioning

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

object

{
"type": "object",
"properties": {
"name": {
"$ref": "#/definitions/objectName"
},
"bucket": {
"$ref": "#/definitions/bucketName"
},
"acl": {
"$ref": "#/definitions/objectAcl"
},
"turbot": {
"type": "object",
"properties": {
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/objectAka"
}
},
"title": {
"$ref": "#/definitions/objectName"
},
"custom": {
"type": "object",
"properties": {
"createTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
},
"gcp": {
"$ref": "gcp#/definitions/gcpMetadata"
}
}
}
}
}
},
"required": [
"name"
],
"additionalProperties": true,
"tests": [
{
"description": "Valid - All properties",
"input": {
"bucket": "test01",
"name": "file1",
"turbot": {
"akas": [
"gcp://storage.googleapis.com/projects/foo-bar/buckets/test01/objects/file1"
],
"tags": {
"foo": "bar",
"foo1": "bar1"
},
"title": "file1",
"custom": {
"createTimestamp": "2019-02-13T16:06:19.156Z",
"gcp": {
"projectId": "foo-bar",
"regionName": "us-east1"
}
}
}
}
},
{
"description": "Invalid - Missing name",
"input": {
"bucket": "test01",
"turbot": {
"akas": [
"gcp://storage.googleapis.com/projects/foo-bar/buckets/test01/objects/file1"
],
"tags": {
"foo": "bar",
"foo1": "bar1"
},
"title": "file1",
"custom": {
"createTimestamp": "2019-02-13T16:06:19.156Z",
"gcp": {
"projectId": "foo-bar",
"regionName": "us-east1"
}
}
}
},
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/object",
"modUri": "tmod:@turbot/gcp-storage"
}
}

Object

{
"description": "An object.",
"properties": {
"acl": {
"description": "Access controls on the object.",
"items": {
"$ref": "#/definitions/ObjectAccessControl"
},
"type": "array"
},
"bucket": {
"description": "The name of the bucket containing this object.",
"type": "string"
},
"cacheControl": {
"description": "Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.",
"type": "string"
},
"componentCount": {
"description": "Number of underlying components that make up this object. Components are accumulated by compose operations.",
"type": "integer"
},
"contentDisposition": {
"description": "Content-Disposition of the object data.",
"type": "string"
},
"contentEncoding": {
"description": "Content-Encoding of the object data.",
"type": "string"
},
"contentLanguage": {
"description": "Content-Language of the object data.",
"type": "string"
},
"contentType": {
"description": "Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.",
"type": "string"
},
"crc32c": {
"description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices.",
"type": "string"
},
"customTime": {
"description": "A timestamp in RFC 3339 format specified by the user for an object.",
"type": "string"
},
"customerEncryption": {
"description": "Metadata of customer-supplied encryption key, if the object is encrypted by such a key.",
"properties": {
"encryptionAlgorithm": {
"description": "The encryption algorithm.",
"type": "string"
},
"keySha256": {
"description": "SHA256 hash value of the encryption key.",
"type": "string"
}
},
"type": "object"
},
"etag": {
"description": "HTTP 1.1 Entity tag for the object.",
"type": "string"
},
"eventBasedHold": {
"description": "Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.",
"type": "boolean"
},
"generation": {
"description": "The content generation of this object. Used for object versioning.",
"type": "string"
},
"hardDeleteTime": {
"description": "This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.",
"type": "string"
},
"id": {
"description": "The ID of the object, including the bucket name, object name, and generation number.",
"type": "string"
},
"kind": {
"default": "storage#object",
"description": "The kind of item this is. For objects, this is always storage#object.",
"type": "string"
},
"kmsKeyName": {
"description": "Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.",
"type": "string"
},
"md5Hash": {
"description": "MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices.",
"type": "string"
},
"mediaLink": {
"description": "Media download link.",
"type": "string"
},
"metadata": {
"additionalProperties": {
"description": "An individual metadata entry.",
"type": "string"
},
"description": "User-provided metadata, in key/value pairs.",
"type": "object"
},
"metageneration": {
"description": "The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.",
"type": "string"
},
"name": {
"description": "The name of the object. Required if not specified by URL parameter.",
"type": "string"
},
"owner": {
"description": "The owner of the object. This will always be the uploader of the object.",
"properties": {
"entity": {
"description": "The entity, in the form user-userId.",
"type": "string"
},
"entityId": {
"description": "The ID for the entity.",
"type": "string"
}
},
"type": "object"
},
"retention": {
"description": "A collection of object level retention parameters.",
"properties": {
"mode": {
"description": "The bucket's object retention mode, can only be Unlocked or Locked.",
"type": "string"
},
"retainUntilTime": {
"description": "A time in RFC 3339 format until which object retention protects this object.",
"type": "string"
}
},
"type": "object"
},
"retentionExpirationTime": {
"description": "A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).",
"type": "string"
},
"selfLink": {
"description": "The link to this object.",
"type": "string"
},
"size": {
"description": "Content-Length of the data in bytes.",
"type": "string"
},
"softDeleteTime": {
"description": "The time at which the object became soft-deleted in RFC 3339 format.",
"type": "string"
},
"storageClass": {
"description": "Storage class of the object.",
"type": "string"
},
"temporaryHold": {
"description": "Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.",
"type": "boolean"
},
"timeCreated": {
"description": "The creation time of the object in RFC 3339 format.",
"type": "string"
},
"timeDeleted": {
"description": "The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.",
"type": "string"
},
"timeStorageClassUpdated": {
"description": "The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.",
"type": "string"
},
"updated": {
"description": "The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.",
"type": "string"
}
},
"type": "object",
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/Object",
"modUri": "tmod:@turbot/gcp-storage"
}
}

ObjectAccessControl

{
"description": "An access-control entry.",
"properties": {
"bucket": {
"description": "The name of the bucket.",
"type": "string"
},
"domain": {
"description": "The domain associated with the entity, if any.",
"type": "string"
},
"email": {
"description": "The email address associated with the entity, if any.",
"type": "string"
},
"entity": {
"description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.",
"type": "string"
},
"entityId": {
"description": "The ID for the entity, if any.",
"type": "string"
},
"etag": {
"description": "HTTP 1.1 Entity tag for the access-control entry.",
"type": "string"
},
"generation": {
"description": "The content generation of the object, if applied to an object.",
"type": "string"
},
"id": {
"description": "The ID of the access-control entry.",
"type": "string"
},
"kind": {
"default": "storage#objectAccessControl",
"description": "The kind of item this is. For object access control entries, this is always storage#objectAccessControl.",
"type": "string"
},
"object": {
"description": "The name of the object, if applied to an object.",
"type": "string"
},
"projectTeam": {
"description": "The project team associated with the entity, if any.",
"properties": {
"projectNumber": {
"description": "The project number.",
"type": "string"
},
"team": {
"description": "The team.",
"type": "string"
}
},
"type": "object"
},
"role": {
"description": "The access permission for the entity.",
"type": "string"
},
"selfLink": {
"description": "The link to this access-control entry.",
"type": "string"
}
},
"type": "object",
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/ObjectAccessControl",
"modUri": "tmod:@turbot/gcp-storage"
}
}

objectAcl

{
"type": "array",
"items": {
"bucket": {
"type": "string"
},
"entity": {
"type": "string"
},
"email": {
"type": "string"
}
},
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/objectAcl",
"modUri": "tmod:@turbot/gcp-storage"
}
}

objectAka

{
"type": "string",
"pattern": "^gcp://storage.googleapis.com/projects/[a-z][a-z0-9-]{4,28}[a-z0-9]/buckets/[a-z0-9-._]{3,63}/objects/.*$",
"tests": [
{
"descritpion": "base case",
"input": "gcp://storage.googleapis.com/projects/foo-bar/buckets/test01/objects/file1"
},
{
"descritpion": "invalid - invalid bucket name",
"input": "gcp://storage.googleapis.com/projects/aar-a4b6d489/buckets/my/objects/file1",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/objectAka",
"modUri": "tmod:@turbot/gcp-storage"
}
}

objectName

{
"type": "string",
"tests": [
{
"input": "test"
},
{
"input": "object-test-123"
},
{
"description": "invalid - array passed instead of string",
"input": [
"Test"
],
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/objectName",
"modUri": "tmod:@turbot/gcp-storage"
}
}

objectServiceNow

{
"defaultColumns": {
"acl": {
"column": "enabled",
"label": "ACL",
"type": "string",
"size": 1000
},
"bucket": {
"column": "enabled"
},
"cache_control": {
"column": "enabled"
},
"component_count": {
"column": "enabled"
},
"content_disposition": {
"column": "enabled"
},
"content_encoding": {
"column": "enabled"
},
"content_language": {
"column": "enabled"
},
"content_type": {
"column": "enabled"
},
"crc32c": {
"column": "enabled",
"label": "CRC32C"
},
"custom_time": {
"column": "enabled"
},
"customer_encryption": {
"column": "enabled",
"type": "string",
"size": 1000
},
"event_based_hold": {
"column": "enabled",
"type": "boolean"
},
"generation": {
"column": "enabled"
},
"iam_policy": {
"column": "enabled",
"label": "IAM Policy",
"type": "string",
"size": 1000
},
"object_id": {
"column": "enabled",
"label": "ID",
"path": "data.id"
},
"kind": {
"column": "enabled"
},
"kms_key_name": {
"column": "enabled",
"label": "KMS Key Name"
},
"md5_hash": {
"column": "enabled",
"label": "MD5 Hash"
},
"media_link": {
"column": "enabled"
},
"object_name": {
"column": "enabled",
"label": "Name",
"path": "data.name"
},
"owner": {
"column": "enabled",
"type": "string",
"size": 1000
},
"project": {
"column": "enabled",
"label": "Project",
"path": "metadata.gcp.projectId"
},
"retention_expiration_time": {
"column": "enabled"
},
"self_link": {
"column": "enabled"
},
"size": {
"column": "enabled"
},
"storage_class": {
"column": "enabled"
},
"temporary_hold": {
"column": "enabled",
"type": "boolean"
},
"time_created": {
"column": "enabled"
},
"time_deleted": {
"column": "enabled"
},
"time_storage_class_updated": {
"column": "enabled"
},
"updated": {
"column": "enabled"
}
},
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/objectServiceNow",
"modUri": "tmod:@turbot/gcp-storage"
}
}

storage

{
"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/storageAka"
}
},
"title": {
"type": "string"
},
"custom": {
"type": "object",
"properties": {
"gcp": {
"$ref": "gcp#/definitions/gcpMetadata"
}
}
}
}
}
},
"required": [
"name"
],
"tests": [
{
"description": "Valid - base test",
"input": {
"name": "projects/932405488407/services/storage-component.googleapis.com",
"turbot": {
"akas": [
"gcp://serviceusage.googleapis.com/projects/932405488407/services/storage-component.googleapis.com"
],
"title": "Cloud Storage",
"custom": {
"gcp": {
"projectId": "cse-legolas-2"
}
}
}
}
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-storage#/definitions/storage",
"modUri": "tmod:@turbot/gcp-storage"
}
}

storageAka

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