Skip to content

Commit

Permalink
src test and protos copied over
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljbruce committed Jul 29, 2022
1 parent e8a5ab8 commit 46ce5b8
Show file tree
Hide file tree
Showing 14 changed files with 15,143 additions and 13,722 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ message CreateInstanceRequest {
// cluster ID, e.g., just `mycluster` rather than
// `projects/myproject/instances/myinstance/clusters/mycluster`.
// Fields marked `OutputOnly` must be left blank.
// Currently, at most four clusters can be specified.
map<string, Cluster> clusters = 4 [(google.api.field_behavior) = REQUIRED];
}

Expand Down
258 changes: 201 additions & 57 deletions protos/google/bigtable/admin/v2/bigtable_table_admin.proto

Large diffs are not rendered by default.

78 changes: 47 additions & 31 deletions protos/google/bigtable/admin/v2/instance.proto
Original file line number Diff line number Diff line change
Expand Up @@ -82,30 +82,33 @@ message Instance {
// to avoid confusion.
string display_name = 2 [(google.api.field_behavior) = REQUIRED];

// (`OutputOnly`)
// The current state of the instance.
State state = 3;
// Output only. The current state of the instance.
State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

// The type of the instance. Defaults to `PRODUCTION`.
Type type = 4;
// Required. The type of the instance. Defaults to `PRODUCTION`.
Type type = 4 [(google.api.field_behavior) = REQUIRED];

// Labels are a flexible and lightweight mechanism for organizing cloud
// resources into groups that reflect a customer's organizational needs and
// deployment strategies. They can be used to filter resources and aggregate
// metrics.
// Required. Labels are a flexible and lightweight mechanism for organizing
// cloud resources into groups that reflect a customer's organizational needs
// and deployment strategies. They can be used to filter resources and
// aggregate metrics.
//
// * Label keys must be between 1 and 63 characters long and must conform to
// the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
// * Label values must be between 0 and 63 characters long and must conform to
// the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
// * No more than 64 labels can be associated with a given resource.
// * Keys and values must both be under 128 bytes.
map<string, string> labels = 5;
map<string, string> labels = 5 [(google.api.field_behavior) = REQUIRED];

// Output only. A server-assigned timestamp representing when this Instance
// was created. For instances created before this field was added (August
// 2021), this value is `seconds: 0, nanos: 1`.
google.protobuf.Timestamp create_time = 7
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. A server-assigned timestamp representing when this Instance was created.
// For instances created before this field was added (August 2021), this value
// is `seconds: 0, nanos: 1`.
google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Reserved for future use.
optional bool satisfies_pzs = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// The Autoscaling targets for a Cluster. These determine the recommended nodes.
Expand All @@ -115,6 +118,14 @@ message AutoscalingTargets {
// 100 (total utilization), and is limited between 10 and 80, otherwise it
// will return INVALID_ARGUMENT error.
int32 cpu_utilization_percent = 2;

// The storage utilization that the Autoscaler should be trying to achieve.
// This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD
// cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster,
// otherwise it will return INVALID_ARGUMENT error. If this value is set to 0,
// it will be treated as if it were set to the default value: 2560 for SSD,
// 8192 for HDD.
int32 storage_utilization_gib_per_node = 3;
}

// Limits for the number of nodes a Cluster can autoscale up/down to.
Expand Down Expand Up @@ -163,10 +174,12 @@ message Cluster {
// Autoscaling config for a cluster.
message ClusterAutoscalingConfig {
// Required. Autoscaling limits for this cluster.
AutoscalingLimits autoscaling_limits = 1 [(google.api.field_behavior) = REQUIRED];
AutoscalingLimits autoscaling_limits = 1
[(google.api.field_behavior) = REQUIRED];

// Required. Autoscaling targets for this cluster.
AutoscalingTargets autoscaling_targets = 2 [(google.api.field_behavior) = REQUIRED];
AutoscalingTargets autoscaling_targets = 2
[(google.api.field_behavior) = REQUIRED];
}

// Configuration for a cluster.
Expand All @@ -185,20 +198,19 @@ message Cluster {
// `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
// 2) Only regional keys can be used and the region of the CMEK key must
// match the region of the cluster.
// 3) All clusters within an instance must use the same CMEK key.
// Values are of the form
// `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
string kms_key_name = 1 [(google.api.resource_reference) = {
type: "cloudkms.googleapis.com/CryptoKey"
}];
type: "cloudkms.googleapis.com/CryptoKey"
}];
}

// The unique name of the cluster. Values are of the form
// `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
string name = 1;

// Immutable. The location where this cluster's nodes and storage reside. For best
// performance, clients should be located as close as possible to this
// Immutable. The location where this cluster's nodes and storage reside. For
// best performance, clients should be located as close as possible to this
// cluster. Currently only zones are supported, so values should be of the
// form `projects/{project}/locations/{zone}`.
string location = 2 [
Expand All @@ -222,10 +234,12 @@ message Cluster {

// Immutable. The type of storage used by this cluster to serve its
// parent instance's tables, unless explicitly overridden.
StorageType default_storage_type = 5 [(google.api.field_behavior) = IMMUTABLE];
StorageType default_storage_type = 5
[(google.api.field_behavior) = IMMUTABLE];

// Immutable. The encryption configuration for CMEK-protected clusters.
EncryptionConfig encryption_config = 6 [(google.api.field_behavior) = IMMUTABLE];
EncryptionConfig encryption_config = 6
[(google.api.field_behavior) = IMMUTABLE];
}

// A configuration object describing how Cloud Bigtable should treat traffic
Expand Down Expand Up @@ -306,24 +320,26 @@ message HotTablet {
// Name of the table that contains the tablet. Values are of the form
// `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
string table_name = 2 [(google.api.resource_reference) = {
type: "bigtableadmin.googleapis.com/Table"
}];
type: "bigtableadmin.googleapis.com/Table"
}];

// Output only. The start time of the hot tablet.
google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
google.protobuf.Timestamp start_time = 3
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The end time of the hot tablet.
google.protobuf.Timestamp end_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
google.protobuf.Timestamp end_time = 4
[(google.api.field_behavior) = OUTPUT_ONLY];

// Tablet Start Key (inclusive).
string start_key = 5;

// Tablet End Key (inclusive).
string end_key = 6;

// Output only. The average CPU usage spent by a node on this tablet over the start_time to
// end_time time range. The percentage is the amount of CPU used by the node
// to serve the tablet, from 0% (tablet was not interacted with) to 100% (the
// node spent all cycles serving the hot tablet).
// Output only. The average CPU usage spent by a node on this tablet over the
// start_time to end_time time range. The percentage is the amount of CPU used
// by the node to serve the tablet, from 0% (tablet was not interacted with)
// to 100% (the node spent all cycles serving the hot tablet).
float node_cpu_usage_percent = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
}
84 changes: 49 additions & 35 deletions protos/google/bigtable/admin/v2/table.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ option (google.api.resource_definition) = {
pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}"
};


// Information about a table restore.
message RestoreInfo {
// The type of the restore source.
Expand Down Expand Up @@ -88,14 +87,16 @@ message Table {
}

// Output only. The state of replication for the table in this cluster.
ReplicationState replication_state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
ReplicationState replication_state = 1
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The encryption information for the table in this cluster.
// If the encryption key protecting this resource is customer managed, then
// its version can be rotated in Cloud Key Management Service (Cloud KMS).
// The primary version of the key and its status will be reflected here when
// changes propagate from Cloud KMS.
repeated EncryptionInfo encryption_info = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
repeated EncryptionInfo encryption_info = 2
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// Possible timestamp granularities to use when keeping multiple versions
Expand Down Expand Up @@ -141,20 +142,22 @@ message Table {
// particular cluster (for example, if its zone is unavailable), then
// there will be an entry for the cluster with UNKNOWN `replication_status`.
// Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
map<string, ClusterState> cluster_states = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
map<string, ClusterState> cluster_states = 2
[(google.api.field_behavior) = OUTPUT_ONLY];

// The column families configured for this table, mapped by column family ID.
// Views: `SCHEMA_VIEW`, `FULL`
map<string, ColumnFamily> column_families = 3;

// Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored in this
// table. Timestamps not matching the granularity will be rejected.
// If unspecified at creation time, the value will be set to `MILLIS`.
// Views: `SCHEMA_VIEW`, `FULL`.
TimestampGranularity granularity = 4 [(google.api.field_behavior) = IMMUTABLE];
// Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored
// in this table. Timestamps not matching the granularity will be rejected. If
// unspecified at creation time, the value will be set to `MILLIS`. Views:
// `SCHEMA_VIEW`, `FULL`.
TimestampGranularity granularity = 4
[(google.api.field_behavior) = IMMUTABLE];

// Output only. If this table was restored from another data source (e.g. a backup), this
// field will be populated with information about the restore.
// Output only. If this table was restored from another data source (e.g. a
// backup), this field will be populated with information about the restore.
RestoreInfo restore_info = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
}

Expand Down Expand Up @@ -227,14 +230,17 @@ message EncryptionInfo {
}

// Output only. The type of encryption used to protect this resource.
EncryptionType encryption_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
EncryptionType encryption_type = 3
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The status of encrypt/decrypt calls on underlying data for this resource.
// Regardless of status, the existing data is always encrypted at rest.
google.rpc.Status encryption_status = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The status of encrypt/decrypt calls on underlying data for
// this resource. Regardless of status, the existing data is always encrypted
// at rest.
google.rpc.Status encryption_status = 4
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The version of the Cloud KMS key specified in the parent cluster that is
// in use for the data underlying this table.
// Output only. The version of the Cloud KMS key specified in the parent
// cluster that is in use for the data underlying this table.
string kms_key_version = 2 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.resource_reference) = {
Expand Down Expand Up @@ -270,32 +276,33 @@ message Snapshot {
CREATING = 2;
}

// Output only. The unique name of the snapshot.
// The unique name of the snapshot.
// Values are of the form
// `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
string name = 1;

// Output only. The source table at the time the snapshot was taken.
Table source_table = 2;
Table source_table = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The size of the data in the source table at the time the
// snapshot was taken. In some cases, this value may be computed
// asynchronously via a background process and a placeholder of 0 will be used
// in the meantime.
int64 data_size_bytes = 3;
int64 data_size_bytes = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The time when the snapshot is created.
google.protobuf.Timestamp create_time = 4;
google.protobuf.Timestamp create_time = 4
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The time when the snapshot will be deleted. The maximum amount
// of time a snapshot can stay active is 365 days. If 'ttl' is not specified,
// The time when the snapshot will be deleted. The maximum amount of time a
// snapshot can stay active is 365 days. If 'ttl' is not specified,
// the default maximum of 365 days will be used.
google.protobuf.Timestamp delete_time = 5;

// Output only. The current state of the snapshot.
State state = 6;
State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Description of the snapshot.
// Description of the snapshot.
string description = 7;
}

Expand Down Expand Up @@ -331,8 +338,8 @@ message Backup {
// `projects/{project}/instances/{instance}/clusters/{cluster}`.
string name = 1;

// Required. Immutable. Name of the table from which this backup was created. This needs
// to be in the same instance as the backup. Values are of the form
// Required. Immutable. Name of the table from which this backup was created.
// This needs to be in the same instance as the backup. Values are of the form
// `projects/{project}/instances/{instance}/tables/{source_table}`.
string source_table = 2 [
(google.api.field_behavior) = IMMUTABLE,
Expand All @@ -344,17 +351,21 @@ message Backup {
// from the time the request is received. Once the `expire_time`
// has passed, Cloud Bigtable will delete the backup and free the
// resources used by the backup.
google.protobuf.Timestamp expire_time = 3 [(google.api.field_behavior) = REQUIRED];
google.protobuf.Timestamp expire_time = 3
[(google.api.field_behavior) = REQUIRED];

// Output only. `start_time` is the time that the backup was started
// (i.e. approximately the time the
// [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup] request is received). The
// row data in this backup will be no older than this timestamp.
google.protobuf.Timestamp start_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
// request is received). The row data in this backup will be no older than
// this timestamp.
google.protobuf.Timestamp start_time = 4
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. `end_time` is the time that the backup was finished. The row
// data in the backup will be no newer than this timestamp.
google.protobuf.Timestamp end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
google.protobuf.Timestamp end_time = 5
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Size of the backup in bytes.
int64 size_bytes = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
Expand All @@ -363,7 +374,8 @@ message Backup {
State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The encryption information for the backup.
EncryptionInfo encryption_info = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
EncryptionInfo encryption_info = 9
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// Information about a backup.
Expand All @@ -373,11 +385,13 @@ message BackupInfo {

// Output only. The time that the backup was started. Row data in the backup
// will be no older than this timestamp.
google.protobuf.Timestamp start_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
google.protobuf.Timestamp start_time = 2
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. This time that the backup was finished. Row data in the
// backup will be no newer than this timestamp.
google.protobuf.Timestamp end_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
google.protobuf.Timestamp end_time = 3
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Name of the table the backup was created from.
string source_table = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
Expand Down
Loading

0 comments on commit 46ce5b8

Please sign in to comment.