Skip to content

Commit

Permalink
chore: remove unused proto imports (#643)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 468735472

Source-Link: googleapis/googleapis@cfa1b37

Source-Link: googleapis/googleapis-gen@09b7666
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDliNzY2NjY1NjUxMGY1YjAwYjg5M2YwMDNhMGJhNTc2NmY5ZTI1MCJ9

feat: Add client library support for AssetService v1 BatchGetEffectiveIamPolicies API
Committer: haochunzhang@

PiperOrigin-RevId: 468010360

Source-Link: googleapis/googleapis@4bda299

Source-Link: googleapis/googleapis-gen@8ed0406
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGVkMDQwNjE0ZDA0NzQzZjE2Y2Y0ZTQ4NDRiNzE2ZmVkOTk4Zjk0YyJ9

feat: Release of query system
Committer: lvv@

PiperOrigin-RevId: 466748663

Source-Link: googleapis/googleapis@80d630f

Source-Link: googleapis/googleapis-gen@252f5ad
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjUyZjVhZGUxOGEzMWE3MmYxMjgxMGJiZmQxZDgzZDU2YThlNzJlMSJ9

feat: Add client library support for AssetService v1 BatchGetEffectiveIamPolicies API
Committer: haochunzhang@

PiperOrigin-RevId: 466134014

Source-Link: googleapis/googleapis@63c73fb

Source-Link: googleapis/googleapis-gen@2350945
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjM1MDk0NWY3YTcwZWNhYWVjZjlhMWZkZDdkNmU3MGFjNTBlODYyZCJ9
  • Loading branch information
gcf-owl-bot[bot] authored Aug 19, 2022
1 parent 5ecf245 commit 1879d4b
Show file tree
Hide file tree
Showing 17 changed files with 4,659 additions and 449 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import "google/longrunning/operations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
import "google/type/expr.proto";
Expand Down Expand Up @@ -197,6 +198,27 @@ service AssetService {
};
}

// Issue a job that queries assets using a SQL statement compatible with
// [BigQuery Standard
// SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
//
// If the query execution finishes within timeout and there's no pagination,
// the full query results will be returned in the `QueryAssetsResponse`.
//
// Otherwise, full query results can be obtained by issuing extra requests
// with the `job_reference` from the a previous `QueryAssets` call.
//
// Note, the query result has approximately 10 GB limitation enforced by
// BigQuery
// https://cloud.google.com/bigquery/docs/best-practices-performance-output,
// queries return larger results will result in errors.
rpc QueryAssets(QueryAssetsRequest) returns (QueryAssetsResponse) {
option (google.api.http) = {
post: "/v1/{parent=*/*}:queryAssets"
body: "*"
};
}

// Creates a saved query in a parent project/folder/organization.
rpc CreateSavedQuery(CreateSavedQueryRequest) returns (SavedQuery) {
option (google.api.http) = {
Expand Down Expand Up @@ -856,6 +878,14 @@ message SearchAllResourcesRequest {
// * `labels.env:*` to find Cloud resources that have a label "env".
// * `kmsKey:key` to find Cloud resources encrypted with a customer-managed
// encryption key whose name contains the word "key".
// * `relationships:instance-group-1` to find Cloud resources that have
// relationships with "instance-group-1" in the related resource name.
// * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that
// have relationships of type "INSTANCE_TO_INSTANCEGROUP".
// * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find
// compute instances that have relationships with "instance-group-1" in the
// compute instance group resource name, for relationship type
// "INSTANCE_TO_INSTANCEGROUP".
// * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a
// word.
// * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain
Expand Down Expand Up @@ -999,8 +1029,8 @@ message SearchAllIamPoliciesRequest {
// compared against each Cloud IAM policy binding, including its principals,
// roles, and Cloud IAM conditions. The returned Cloud IAM policies will only
// contain the bindings that match your query. To learn more about the IAM
// policy structure, see [IAM policy
// doc](https://cloud.google.com/iam/docs/policies#structure).
// policy structure, see the [IAM policy
// documentation](https://cloud.google.com/iam/help/allow-policies/structure).
//
// Examples:
//
Expand Down Expand Up @@ -1730,28 +1760,203 @@ message MoveImpact {
string detail = 1;
}

// Asset content type.
enum ContentType {
// Unspecified content type.
CONTENT_TYPE_UNSPECIFIED = 0;
// Output configuration query assets.
message QueryAssetsOutputConfig {
// BigQuery destination.
message BigQueryDestination {
// Required. The BigQuery dataset where the query results will be saved. It
// has the format of "projects/{projectId}/datasets/{datasetId}".
string dataset = 1 [(google.api.field_behavior) = REQUIRED];

// Resource metadata.
RESOURCE = 1;
// Required. The BigQuery table where the query results will be saved. If
// this table does not exist, a new table with the given name will be
// created.
string table = 2 [(google.api.field_behavior) = REQUIRED];

// The actual IAM policy set on a resource.
IAM_POLICY = 2;
// Specifies the action that occurs if the destination table or partition
// already exists. The following values are supported:
//
// * WRITE_TRUNCATE: If the table or partition already exists, BigQuery
// overwrites the entire table or all the partitions data.
// * WRITE_APPEND: If the table or partition already exists, BigQuery
// appends the data to the table or the latest partition.
// * WRITE_EMPTY: If the table already exists and contains data, an error is
// returned.
string write_disposition = 3;
}

// The Cloud Organization Policy set on an asset.
ORG_POLICY = 4;
// BigQuery destination where the query results will be saved.
BigQueryDestination bigquery_destination = 1;
}

// The Cloud Access context manager Policy set on an asset.
ACCESS_POLICY = 5;
// QueryAssets request.
message QueryAssetsRequest {
// Required. The relative name of the root asset. This can only be an
// organization number (such as "organizations/123"), a project ID (such as
// "projects/my-project-id"), or a project number (such as "projects/12345"),
// or a folder number (such as "folders/123").
//
// Only assets belonging to the `parent` will be returned.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "cloudasset.googleapis.com/Asset"
}
];

// The runtime OS Inventory information.
OS_INVENTORY = 6;
oneof query {
// Optional. A SQL statement that's compatible with [BigQuery Standard
// SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
string statement = 2 [(google.api.field_behavior) = OPTIONAL];

// The related resources.
RELATIONSHIP = 7;
// Optional. Reference to the query job, which is from the
// `QueryAssetsResponse` of previous `QueryAssets` call.
string job_reference = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Optional. The maximum number of rows to return in the results. Responses
// are limited to 10 MB and 1000 rows.
//
// By default, the maximum row count is 1000. When the byte or row count limit
// is reached, the rest of the query results will be paginated.
//
// The field will be ignored when [output_config] is specified.
int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. A page token received from previous `QueryAssets`.
//
// The field will be ignored when [output_config] is specified.
string page_token = 5 [(google.api.field_behavior) = OPTIONAL];

// Optional. Specifies the maximum amount of time that the client is willing
// to wait for the query to complete. By default, this limit is 5 min for the
// first query, and 1 minute for the following queries. If the query is
// complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
// false.
//
// Like BigQuery [jobs.query
// API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
// The call is not guaranteed to wait for the specified timeout; it typically
// returns after around 200 seconds (200,000 milliseconds), even if the query
// is not complete.
//
// The field will be ignored when [output_config] is specified.
google.protobuf.Duration timeout = 6 [(google.api.field_behavior) = OPTIONAL];

// Specifies what time period or point in time to query asset metadata at.
// * unset - query asset metadata as it is right now
// * [read_time_window] - query asset metadata as it was at any point in time
// between [start_time] and [end_time].
// * [read_time] - query asset metadata as it was at that point in time.
// If data for the timestamp/date range selected does not exist,
// it will simply return a valid response with no rows.
oneof time {
// Optional. [start_time] is required. [start_time] must be less than
// [end_time] Defaults [end_time] to now if [start_time] is set and
// [end_time] isn't. Maximum permitted time range is 7 days.
TimeWindow read_time_window = 7 [(google.api.field_behavior) = OPTIONAL];

// Optional. Queries cloud assets as they appeared at the specified point in
// time.
google.protobuf.Timestamp read_time = 8
[(google.api.field_behavior) = OPTIONAL];
}

// Optional. Destination where the query results will be saved.
//
// When this field is specified, the query results won't be saved in the
// [QueryAssetsResponse.query_result]. Instead
// [QueryAssetsResponse.output_config] will be set.
//
// Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used
// to check the status of the query job when passed to a following
// [QueryAssets] API call.
QueryAssetsOutputConfig output_config = 9
[(google.api.field_behavior) = OPTIONAL];
}

// QueryAssets response.
message QueryAssetsResponse {
// Reference to a query job.
string job_reference = 1;

// The query response, which can be either an `error` or a valid `response`.
//
// If `done` == `false` and the query result is being saved in a output, the
// output_config field will be set.
// If `done` == `true`, exactly one of
// `error`, `query_result` or `output_config` will be set.
bool done = 2;

oneof response {
// Error status.
google.rpc.Status error = 3;

// Result of the query.
QueryResult query_result = 4;

// Output configuration which indicates instead of being returned in API
// response on the fly, the query result will be saved in a specific output.
QueryAssetsOutputConfig output_config = 5;
}
}

// Execution results of the query.
//
// The result is formatted as rows represented by BigQuery compatible [schema].
// When pagination is necessary, it will contains the page token to retrieve
// the results of following pages.
message QueryResult {
// Each row hold a query result in the format of `Struct`.
repeated google.protobuf.Struct rows = 1;

// Describes the format of the [rows].
TableSchema schema = 2;

// Token to retrieve the next page of the results.
string next_page_token = 3;

// Total rows of the whole query results.
int64 total_rows = 4;
}

// BigQuery Compatible table schema.
message TableSchema {
// Describes the fields in a table.
repeated TableFieldSchema fields = 1;
}

// A field in TableSchema.
message TableFieldSchema {
// The field name. The name must contain only letters (a-z, A-Z),
// numbers (0-9), or underscores (_), and must start with a letter or
// underscore. The maximum length is 128 characters.
string field = 1;

// The field data type. Possible values include
// * STRING
// * BYTES
// * INTEGER
// * FLOAT
// * BOOLEAN
// * TIMESTAMP
// * DATE
// * TIME
// * DATETIME
// * GEOGRAPHY,
// * NUMERIC,
// * BIGNUMERIC,
// * RECORD
// (where RECORD indicates that the field contains a nested schema).
string type = 2;

// The field mode. Possible values include NULLABLE, REQUIRED and
// REPEATED. The default value is NULLABLE.
string mode = 3;

// Describes the nested schema fields if the type property is set
// to RECORD.
repeated TableFieldSchema fields = 4;
}

// A request message for
Expand Down Expand Up @@ -1841,3 +2046,27 @@ message BatchGetEffectiveIamPoliciesResponse {
// [EffectiveIamPolicy.policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies].
repeated EffectiveIamPolicy policy_results = 2;
}

// Asset content type.
enum ContentType {
// Unspecified content type.
CONTENT_TYPE_UNSPECIFIED = 0;

// Resource metadata.
RESOURCE = 1;

// The actual IAM policy set on a resource.
IAM_POLICY = 2;

// The Cloud Organization Policy set on an asset.
ORG_POLICY = 4;

// The Cloud Access context manager Policy set on an asset.
ACCESS_POLICY = 5;

// The runtime OS Inventory information.
OS_INVENTORY = 6;

// The related resources.
RELATIONSHIP = 7;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ syntax = "proto3";

package google.cloud.asset.v1;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/orgpolicy/v1/orgpolicy.proto";
import "google/cloud/osconfig/v1/inventory.proto";
Expand Down Expand Up @@ -128,8 +127,8 @@ message Asset {
// effectively policy is the union of both the policy set on this resource
// and each policy set on all of the resource's ancestry resource levels in
// the hierarchy. See
// [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
// more information.
// [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance)
// for more information.
google.iam.v1.Policy iam_policy = 4;

// A representation of an [organization
Expand Down Expand Up @@ -307,6 +306,7 @@ message RelatedAsset {
}

// A result of Resource Search, containing information of a cloud resource.
// Next ID: 29
message ResourceSearchResult {
// The full resource name of this resource. Example:
// `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ syntax = "proto3";
package google.cloud.asset.v1p1beta1;

import "google/iam/v1/policy.proto";
import "google/api/annotations.proto";

option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Asset.V1P1Beta1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/asset/v1p2beta1/assets.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Cloud.Asset.V1p2Beta1";
option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ syntax = "proto3";

package google.cloud.asset.v1p2beta1;

import "google/api/annotations.proto";
import "google/iam/v1/policy.proto";
import "google/protobuf/any.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ syntax = "proto3";

package google.cloud.asset.v1p5beta1;

import "google/api/annotations.proto";
import "google/api/resource.proto";
import "google/cloud/orgpolicy/v1/orgpolicy.proto";
import "google/iam/v1/policy.proto";
import "google/identity/accesscontextmanager/v1/access_level.proto";
import "google/identity/accesscontextmanager/v1/access_policy.proto";
import "google/identity/accesscontextmanager/v1/service_perimeter.proto";
import "google/protobuf/any.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Asset.V1p5Beta1";
Expand Down
Loading

0 comments on commit 1879d4b

Please sign in to comment.