Skip to content

Commit

Permalink
feat: added RemoveIamPolicy API (#3791)
Browse files Browse the repository at this point in the history
* feat: added RemoveIamPolicy API
feat: added QueryMetadata API
feat: added MoveTableToDatabase API
feat: added AlterMetadataResourceLocation API

PiperOrigin-RevId: 496501326

Source-Link: googleapis/googleapis@eb1941a

Source-Link: googleapis/googleapis-gen@a66b195
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1ldGFzdG9yZS8uT3dsQm90LnlhbWwiLCJoIjoiYTY2YjE5NTZlYWUyMWU4Yzk0MDJhYTNiYWQ5NThjYTVjZTIyN2U0NiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: sofisl <[email protected]>
  • Loading branch information
3 people authored Dec 21, 2022
1 parent 84302c4 commit e16a9d2
Show file tree
Hide file tree
Showing 41 changed files with 22,713 additions and 12,493 deletions.
8 changes: 8 additions & 0 deletions packages/google-cloud-metastore/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,57 @@ service DataprocMetastore {
metadata_type: "google.cloud.metastore.v1alpha.OperationMetadata"
};
}

// Removes the attached IAM policies for a resource
rpc RemoveIamPolicy(RemoveIamPolicyRequest)
returns (RemoveIamPolicyResponse) {
option (google.api.http) = {
post: "/v1alpha/{resource=projects/*/locations/*/services/*/**}:removeIamPolicy"
body: "*"
};
}

// Query DPMS metadata.
rpc QueryMetadata(QueryMetadataRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1alpha/{service=projects/*/locations/*/services/*}:queryMetadata"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "QueryMetadataResponse"
metadata_type: "google.cloud.metastore.v1alpha.OperationMetadata"
};
}

// Move a table to another database.
rpc MoveTableToDatabase(MoveTableToDatabaseRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1alpha/{service=projects/*/locations/*/services/*}:moveTableToDatabase"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "MoveTableToDatabaseResponse"
metadata_type: "google.cloud.metastore.v1alpha.OperationMetadata"
};
}

// Alter metadata resource location. The metadata resource can be a database,
// table, or partition. This functionality only updates the parent directory
// for the respective metadata resource and does not transfer any existing
// data to the new location.
rpc AlterMetadataResourceLocation(AlterMetadataResourceLocationRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1alpha/{service=projects/*/locations/*/services/*}:alterLocation"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "AlterMetadataResourceLocationResponse"
metadata_type: "google.cloud.metastore.v1alpha.OperationMetadata"
};
}
}

// A managed metastore service that serves metadata queries.
Expand Down Expand Up @@ -572,7 +623,7 @@ message NetworkConfig {
// be at least one IP address available in the subnet's primary range. The
// subnet is specified in the following form:
//
// `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}
// `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}`
string subnetwork = 1 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.resource_reference) = {
Expand Down Expand Up @@ -1460,3 +1511,117 @@ message DatabaseDumpSpec {
AVRO = 2;
}
}

// Request message for
// [DataprocMetastore.RemoveIamPolicy][google.cloud.metastore.v1alpha.DataprocMetastore.RemoveIamPolicy].
message RemoveIamPolicyRequest {
// Required. The relative resource name of the dataplane resource to remove
// IAM policy, in the following form:
//
// `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}`
// or
// `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`.
string resource = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "*" }
];

// Optional. Removes IAM policy attached to database or table asynchronously
// when it is set. The default is false.
bool asynchronous = 2 [(google.api.field_behavior) = OPTIONAL];
}

// Response message for
// [DataprocMetastore.RemoveIamPolicy][google.cloud.metastore.v1alpha.DataprocMetastore.RemoveIamPolicy].
message RemoveIamPolicyResponse {
// True if the policy is successfully removed.
bool success = 1;
}

// Request message for
// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1alpha.DataprocMetastore.QueryMetadata].
message QueryMetadataRequest {
// Required. The relative resource name of the metastore service to query
// metadata, in the following format:
//
// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
string service = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "metastore.googleapis.com/Service"
}
];

// Required. A read-only SQL query to execute against the metadata database.
// The query cannot change or mutate the data.
string query = 2 [(google.api.field_behavior) = REQUIRED];
}

// Response message for
// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1alpha.DataprocMetastore.QueryMetadata].
message QueryMetadataResponse {
// The manifest URI is link to a JSON instance in Cloud Storage.
// This instance manifests immediately along with QueryMetadataResponse. The
// content of the URI is not retriable until the long-running operation query
// against the metadata finishes.
string result_manifest_uri = 1;
}

// Request message for
// [DataprocMetastore.MoveTableToDatabase][google.cloud.metastore.v1alpha.DataprocMetastore.MoveTableToDatabase].
message MoveTableToDatabaseRequest {
// Required. The relative resource name of the metastore service to mutate
// metadata, in the following format:
//
// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
string service = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "metastore.googleapis.com/Service"
}
];

// Required. The name of the table to be moved.
string table_name = 2 [(google.api.field_behavior) = REQUIRED];

// Required. The name of the database where the table resides.
string db_name = 3 [(google.api.field_behavior) = REQUIRED];

// Required. The name of the database where the table should be moved.
string destination_db_name = 4 [(google.api.field_behavior) = REQUIRED];
}

// Response message for
// [DataprocMetastore.MoveTableToDatabase][google.cloud.metastore.v1alpha.DataprocMetastore.MoveTableToDatabase].
message MoveTableToDatabaseResponse {}

// Request message for
// [DataprocMetastore.AlterMetadataResourceLocation][google.cloud.metastore.v1alpha.DataprocMetastore.AlterMetadataResourceLocation].
message AlterMetadataResourceLocationRequest {
// Required. The relative resource name of the metastore service to mutate
// metadata, in the following format:
//
// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
string service = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "metastore.googleapis.com/Service"
}
];

// Required. The relative metadata resource name in the following format.
//
// `databases/{database_id}`
// or
// `databases/{database_id}/tables/{table_id}`
// or
// `databases/{database_id}/tables/{table_id}/partitions/{partition_id}`
string resource_name = 2 [(google.api.field_behavior) = REQUIRED];

// Required. The new location URI for the metadata resource.
string location_uri = 3 [(google.api.field_behavior) = REQUIRED];
}

// Response message for
// [DataprocMetastore.AlterMetadataResourceLocation][google.cloud.metastore.v1alpha.DataprocMetastore.AlterMetadataResourceLocation].
message AlterMetadataResourceLocationResponse {}
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ option java_package = "com.google.cloud.metastore.v1alpha";
// `projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
service DataprocMetastoreFederation {
option (google.api.default_host) = "metastore.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";

// Lists federations in a project and location.
rpc ListFederations(ListFederationsRequest) returns (ListFederationsResponse) {
rpc ListFederations(ListFederationsRequest)
returns (ListFederationsResponse) {
option (google.api.http) = {
get: "/v1alpha/{parent=projects/*/locations/*}/federations"
};
Expand All @@ -63,7 +65,8 @@ service DataprocMetastoreFederation {
}

// Creates a metastore federation in a project and location.
rpc CreateFederation(CreateFederationRequest) returns (google.longrunning.Operation) {
rpc CreateFederation(CreateFederationRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1alpha/{parent=projects/*/locations/*}/federations"
body: "federation"
Expand All @@ -76,7 +79,8 @@ service DataprocMetastoreFederation {
}

// Updates the fields of a federation.
rpc UpdateFederation(UpdateFederationRequest) returns (google.longrunning.Operation) {
rpc UpdateFederation(UpdateFederationRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1alpha/{federation.name=projects/*/locations/*/federations/*}"
body: "federation"
Expand All @@ -89,7 +93,8 @@ service DataprocMetastoreFederation {
}

// Deletes a single federation.
rpc DeleteFederation(DeleteFederationRequest) returns (google.longrunning.Operation) {
rpc DeleteFederation(DeleteFederationRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1alpha/{name=projects/*/locations/*/federations/*}"
};
Expand Down Expand Up @@ -137,16 +142,18 @@ message Federation {
string name = 1 [(google.api.field_behavior) = IMMUTABLE];

// Output only. The time when the metastore federation was created.
google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
google.protobuf.Timestamp create_time = 2
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The time when the metastore federation was last updated.
google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
google.protobuf.Timestamp update_time = 3
[(google.api.field_behavior) = OUTPUT_ONLY];

// User-defined labels for the metastore federation.
map<string, string> labels = 4;

// Immutable. The Apache Hive metastore version of the federation. All backend metastore
// versions must be compatible with the federation version.
// Immutable. The Apache Hive metastore version of the federation. All backend
// metastore versions must be compatible with the federation version.
string version = 5 [(google.api.field_behavior) = IMMUTABLE];

// A map from `BackendMetastore` rank to `BackendMetastore`s from which the
Expand All @@ -163,11 +170,12 @@ message Federation {
// Output only. The current state of the federation.
State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Additional information about the current state of the metastore federation,
// if available.
// Output only. Additional information about the current state of the
// metastore federation, if available.
string state_message = 9 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The globally unique resource identifier of the metastore federation.
// Output only. The globally unique resource identifier of the metastore
// federation.
string uid = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
}

Expand Down Expand Up @@ -203,8 +211,8 @@ message BackendMetastore {

// Request message for ListFederations.
message ListFederationsRequest {
// Required. The relative resource name of the location of metastore federations
// to list, in the following form:
// Required. The relative resource name of the location of metastore
// federations to list, in the following form:
// `projects/{project_number}/locations/{location_id}`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
Expand All @@ -213,9 +221,10 @@ message ListFederationsRequest {
}
];

// Optional. The maximum number of federations to return. The response may contain less
// than the maximum number. If unspecified, no more than 500 services are
// returned. The maximum value is 1000; values above 1000 are changed to 1000.
// Optional. The maximum number of federations to return. The response may
// contain less than the maximum number. If unspecified, no more than 500
// services are returned. The maximum value is 1000; values above 1000 are
// changed to 1000.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. A page token, received from a previous ListFederationServices
Expand Down Expand Up @@ -252,8 +261,8 @@ message ListFederationsResponse {

// Request message for GetFederation.
message GetFederationRequest {
// Required. The relative resource name of the metastore federation to retrieve,
// in the following form:
// Required. The relative resource name of the metastore federation to
// retrieve, in the following form:
//
// `projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
string name = 1 [
Expand All @@ -266,8 +275,8 @@ message GetFederationRequest {

// Request message for CreateFederation.
message CreateFederationRequest {
// Required. The relative resource name of the location in which to create a federation
// service, in the following form:
// Required. The relative resource name of the location in which to create a
// federation service, in the following form:
//
// `projects/{project_number}/locations/{location_id}`.
string parent = 1 [
Expand All @@ -290,10 +299,10 @@ message CreateFederationRequest {
// provided in the request's `federation_id` field.
Federation federation = 3 [(google.api.field_behavior) = REQUIRED];

// Optional. A request ID. Specify a unique request ID to allow the server to ignore the
// request if it has completed. The server will ignore subsequent requests
// that provide a duplicate request ID for at least 60 minutes after the first
// request.
// Optional. A request ID. Specify a unique request ID to allow the server to
// ignore the request if it has completed. The server will ignore subsequent
// requests that provide a duplicate request ID for at least 60 minutes after
// the first request.
//
// For example, if an initial request times out, followed by another request
// with the same request ID, the server ignores the second request to prevent
Expand All @@ -311,7 +320,8 @@ message UpdateFederationRequest {
// metastore federation resource by the update.
// Fields specified in the `update_mask` are relative to the resource (not
// to the full request). A field is overwritten if it is in the mask.
google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED];
google.protobuf.FieldMask update_mask = 1
[(google.api.field_behavior) = REQUIRED];

// Required. The metastore federation to update. The server only merges fields
// in the service if they are specified in `update_mask`.
Expand All @@ -320,10 +330,10 @@ message UpdateFederationRequest {
// metastore service to be updated.
Federation federation = 2 [(google.api.field_behavior) = REQUIRED];

// Optional. A request ID. Specify a unique request ID to allow the server to ignore the
// request if it has completed. The server will ignore subsequent requests
// that provide a duplicate request ID for at least 60 minutes after the first
// request.
// Optional. A request ID. Specify a unique request ID to allow the server to
// ignore the request if it has completed. The server will ignore subsequent
// requests that provide a duplicate request ID for at least 60 minutes after
// the first request.
//
// For example, if an initial request times out, followed by another request
// with the same request ID, the server ignores the second request to prevent
Expand All @@ -348,10 +358,10 @@ message DeleteFederationRequest {
}
];

// Optional. A request ID. Specify a unique request ID to allow the server to ignore the
// request if it has completed. The server will ignore subsequent requests
// that provide a duplicate request ID for at least 60 minutes after the first
// request.
// Optional. A request ID. Specify a unique request ID to allow the server to
// ignore the request if it has completed. The server will ignore subsequent
// requests that provide a duplicate request ID for at least 60 minutes after
// the first request.
//
// For example, if an initial request times out, followed by another request
// with the same request ID, the server ignores the second request to prevent
Expand Down
Loading

0 comments on commit e16a9d2

Please sign in to comment.