Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Log Analytics features of the Cloud Logging API #1335

Merged
merged 3 commits into from
May 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,297 changes: 1,106 additions & 191 deletions google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static com.google.cloud.logging.v2.ConfigClient.ListBucketsPagedResponse;
import static com.google.cloud.logging.v2.ConfigClient.ListExclusionsPagedResponse;
import static com.google.cloud.logging.v2.ConfigClient.ListLinksPagedResponse;
import static com.google.cloud.logging.v2.ConfigClient.ListSinksPagedResponse;
import static com.google.cloud.logging.v2.ConfigClient.ListViewsPagedResponse;

Expand All @@ -34,28 +35,36 @@
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.logging.v2.stub.ConfigServiceV2StubSettings;
import com.google.logging.v2.BucketMetadata;
import com.google.logging.v2.CmekSettings;
import com.google.logging.v2.CopyLogEntriesMetadata;
import com.google.logging.v2.CopyLogEntriesRequest;
import com.google.logging.v2.CopyLogEntriesResponse;
import com.google.logging.v2.CreateBucketRequest;
import com.google.logging.v2.CreateExclusionRequest;
import com.google.logging.v2.CreateLinkRequest;
import com.google.logging.v2.CreateSinkRequest;
import com.google.logging.v2.CreateViewRequest;
import com.google.logging.v2.DeleteBucketRequest;
import com.google.logging.v2.DeleteExclusionRequest;
import com.google.logging.v2.DeleteLinkRequest;
import com.google.logging.v2.DeleteSinkRequest;
import com.google.logging.v2.DeleteViewRequest;
import com.google.logging.v2.GetBucketRequest;
import com.google.logging.v2.GetCmekSettingsRequest;
import com.google.logging.v2.GetExclusionRequest;
import com.google.logging.v2.GetLinkRequest;
import com.google.logging.v2.GetSettingsRequest;
import com.google.logging.v2.GetSinkRequest;
import com.google.logging.v2.GetViewRequest;
import com.google.logging.v2.Link;
import com.google.logging.v2.LinkMetadata;
import com.google.logging.v2.ListBucketsRequest;
import com.google.logging.v2.ListBucketsResponse;
import com.google.logging.v2.ListExclusionsRequest;
import com.google.logging.v2.ListExclusionsResponse;
import com.google.logging.v2.ListLinksRequest;
import com.google.logging.v2.ListLinksResponse;
import com.google.logging.v2.ListSinksRequest;
import com.google.logging.v2.ListSinksResponse;
import com.google.logging.v2.ListViewsRequest;
Expand Down Expand Up @@ -128,6 +137,28 @@ public UnaryCallSettings<GetBucketRequest, LogBucket> getBucketSettings() {
return ((ConfigServiceV2StubSettings) getStubSettings()).getBucketSettings();
}

/** Returns the object with the settings used for calls to createBucketAsync. */
public UnaryCallSettings<CreateBucketRequest, Operation> createBucketAsyncSettings() {
return ((ConfigServiceV2StubSettings) getStubSettings()).createBucketAsyncSettings();
}

/** Returns the object with the settings used for calls to createBucketAsync. */
public OperationCallSettings<CreateBucketRequest, LogBucket, BucketMetadata>
createBucketAsyncOperationSettings() {
return ((ConfigServiceV2StubSettings) getStubSettings()).createBucketAsyncOperationSettings();
}

/** Returns the object with the settings used for calls to updateBucketAsync. */
public UnaryCallSettings<UpdateBucketRequest, Operation> updateBucketAsyncSettings() {
return ((ConfigServiceV2StubSettings) getStubSettings()).updateBucketAsyncSettings();
}

/** Returns the object with the settings used for calls to updateBucketAsync. */
public OperationCallSettings<UpdateBucketRequest, LogBucket, BucketMetadata>
updateBucketAsyncOperationSettings() {
return ((ConfigServiceV2StubSettings) getStubSettings()).updateBucketAsyncOperationSettings();
}

/** Returns the object with the settings used for calls to createBucket. */
public UnaryCallSettings<CreateBucketRequest, LogBucket> createBucketSettings() {
return ((ConfigServiceV2StubSettings) getStubSettings()).createBucketSettings();
Expand Down Expand Up @@ -200,6 +231,39 @@ public UnaryCallSettings<DeleteSinkRequest, Empty> deleteSinkSettings() {
return ((ConfigServiceV2StubSettings) getStubSettings()).deleteSinkSettings();
}

/** Returns the object with the settings used for calls to createLink. */
public UnaryCallSettings<CreateLinkRequest, Operation> createLinkSettings() {
return ((ConfigServiceV2StubSettings) getStubSettings()).createLinkSettings();
}

/** Returns the object with the settings used for calls to createLink. */
public OperationCallSettings<CreateLinkRequest, Link, LinkMetadata>
createLinkOperationSettings() {
return ((ConfigServiceV2StubSettings) getStubSettings()).createLinkOperationSettings();
}

/** Returns the object with the settings used for calls to deleteLink. */
public UnaryCallSettings<DeleteLinkRequest, Operation> deleteLinkSettings() {
return ((ConfigServiceV2StubSettings) getStubSettings()).deleteLinkSettings();
}

/** Returns the object with the settings used for calls to deleteLink. */
public OperationCallSettings<DeleteLinkRequest, Empty, LinkMetadata>
deleteLinkOperationSettings() {
return ((ConfigServiceV2StubSettings) getStubSettings()).deleteLinkOperationSettings();
}

/** Returns the object with the settings used for calls to listLinks. */
public PagedCallSettings<ListLinksRequest, ListLinksResponse, ListLinksPagedResponse>
listLinksSettings() {
return ((ConfigServiceV2StubSettings) getStubSettings()).listLinksSettings();
}

/** Returns the object with the settings used for calls to getLink. */
public UnaryCallSettings<GetLinkRequest, Link> getLinkSettings() {
return ((ConfigServiceV2StubSettings) getStubSettings()).getLinkSettings();
}

/** Returns the object with the settings used for calls to listExclusions. */
public PagedCallSettings<
ListExclusionsRequest, ListExclusionsResponse, ListExclusionsPagedResponse>
Expand Down Expand Up @@ -367,6 +431,28 @@ public UnaryCallSettings.Builder<GetBucketRequest, LogBucket> getBucketSettings(
return getStubSettingsBuilder().getBucketSettings();
}

/** Returns the builder for the settings used for calls to createBucketAsync. */
public UnaryCallSettings.Builder<CreateBucketRequest, Operation> createBucketAsyncSettings() {
return getStubSettingsBuilder().createBucketAsyncSettings();
}

/** Returns the builder for the settings used for calls to createBucketAsync. */
public OperationCallSettings.Builder<CreateBucketRequest, LogBucket, BucketMetadata>
createBucketAsyncOperationSettings() {
return getStubSettingsBuilder().createBucketAsyncOperationSettings();
}

/** Returns the builder for the settings used for calls to updateBucketAsync. */
public UnaryCallSettings.Builder<UpdateBucketRequest, Operation> updateBucketAsyncSettings() {
return getStubSettingsBuilder().updateBucketAsyncSettings();
}

/** Returns the builder for the settings used for calls to updateBucketAsync. */
public OperationCallSettings.Builder<UpdateBucketRequest, LogBucket, BucketMetadata>
updateBucketAsyncOperationSettings() {
return getStubSettingsBuilder().updateBucketAsyncOperationSettings();
}

/** Returns the builder for the settings used for calls to createBucket. */
public UnaryCallSettings.Builder<CreateBucketRequest, LogBucket> createBucketSettings() {
return getStubSettingsBuilder().createBucketSettings();
Expand Down Expand Up @@ -439,6 +525,39 @@ public UnaryCallSettings.Builder<DeleteSinkRequest, Empty> deleteSinkSettings()
return getStubSettingsBuilder().deleteSinkSettings();
}

/** Returns the builder for the settings used for calls to createLink. */
public UnaryCallSettings.Builder<CreateLinkRequest, Operation> createLinkSettings() {
return getStubSettingsBuilder().createLinkSettings();
}

/** Returns the builder for the settings used for calls to createLink. */
public OperationCallSettings.Builder<CreateLinkRequest, Link, LinkMetadata>
createLinkOperationSettings() {
return getStubSettingsBuilder().createLinkOperationSettings();
}

/** Returns the builder for the settings used for calls to deleteLink. */
public UnaryCallSettings.Builder<DeleteLinkRequest, Operation> deleteLinkSettings() {
return getStubSettingsBuilder().deleteLinkSettings();
}

/** Returns the builder for the settings used for calls to deleteLink. */
public OperationCallSettings.Builder<DeleteLinkRequest, Empty, LinkMetadata>
deleteLinkOperationSettings() {
return getStubSettingsBuilder().deleteLinkOperationSettings();
}

/** Returns the builder for the settings used for calls to listLinks. */
public PagedCallSettings.Builder<ListLinksRequest, ListLinksResponse, ListLinksPagedResponse>
listLinksSettings() {
return getStubSettingsBuilder().listLinksSettings();
}

/** Returns the builder for the settings used for calls to getLink. */
public UnaryCallSettings.Builder<GetLinkRequest, Link> getLinkSettings() {
return getStubSettingsBuilder().getLinkSettings();
}

/** Returns the builder for the settings used for calls to listExclusions. */
public PagedCallSettings.Builder<
ListExclusionsRequest, ListExclusionsResponse, ListExclusionsPagedResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,13 +597,12 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ
* &#42;
* `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
* &#42; `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
* <p>Projects listed in the `project_ids` field are added to this list.
* @param filter Optional. A filter that chooses which log entries to return. See [Advanced Logs
* Queries](https://cloud.google.com/logging/docs/view/advanced-queries). Only log entries
* that match the filter are returned. An empty filter matches all log entries in the
* resources listed in `resource_names`. Referencing a parent resource that is not listed in
* `resource_names` will cause the filter to return no results. The maximum length of the
* filter is 20000 characters.
* <p>Projects listed in the `project_ids` field are added to this list. A maximum of 100
* resources may be specified in a single request.
* @param filter Optional. Only log entries that match the filter are returned. An empty filter
* matches all log entries in the resources listed in `resource_names`. Referencing a parent
* resource that is not listed in `resource_names` will cause the filter to return no results.
* The maximum length of a filter is 20,000 characters.
* @param orderBy Optional. How the results should be sorted. Presently, the only permitted values
* are `"timestamp asc"` (default) and `"timestamp desc"`. The first option returns entries in
* order of increasing values of `LogEntry.timestamp` (oldest first), and the second option
Expand Down Expand Up @@ -864,7 +863,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
* }
* }</pre>
*
* @param parent Required. The resource name that owns the logs:
* @param parent Required. The resource name to list logs for:
* <ul>
* <li>`projects/[PROJECT_ID]`
* <li>`organizations/[ORGANIZATION_ID]`
Expand Down Expand Up @@ -901,7 +900,7 @@ public final ListLogsPagedResponse listLogs(BillingAccountName parent) {
* }
* }</pre>
*
* @param parent Required. The resource name that owns the logs:
* @param parent Required. The resource name to list logs for:
* <ul>
* <li>`projects/[PROJECT_ID]`
* <li>`organizations/[ORGANIZATION_ID]`
Expand Down Expand Up @@ -938,7 +937,7 @@ public final ListLogsPagedResponse listLogs(FolderName parent) {
* }
* }</pre>
*
* @param parent Required. The resource name that owns the logs:
* @param parent Required. The resource name to list logs for:
* <ul>
* <li>`projects/[PROJECT_ID]`
* <li>`organizations/[ORGANIZATION_ID]`
Expand Down Expand Up @@ -975,7 +974,7 @@ public final ListLogsPagedResponse listLogs(OrganizationName parent) {
* }
* }</pre>
*
* @param parent Required. The resource name that owns the logs:
* @param parent Required. The resource name to list logs for:
* <ul>
* <li>`projects/[PROJECT_ID]`
* <li>`organizations/[ORGANIZATION_ID]`
Expand Down Expand Up @@ -1012,7 +1011,7 @@ public final ListLogsPagedResponse listLogs(ProjectName parent) {
* }
* }</pre>
*
* @param parent Required. The resource name that owns the logs:
* @param parent Required. The resource name to list logs for:
* <ul>
* <li>`projects/[PROJECT_ID]`
* <li>`organizations/[ORGANIZATION_ID]`
Expand Down Expand Up @@ -1044,9 +1043,9 @@ public final ListLogsPagedResponse listLogs(String parent) {
* ListLogsRequest request =
* ListLogsRequest.newBuilder()
* .setParent(ProjectName.of("[PROJECT]").toString())
* .addAllResourceNames(new ArrayList<String>())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .addAllResourceNames(new ArrayList<String>())
* .build();
* for (String element : loggingClient.listLogs(request).iterateAll()) {
* // doThingsWith(element);
Expand Down Expand Up @@ -1078,9 +1077,9 @@ public final ListLogsPagedResponse listLogs(ListLogsRequest request) {
* ListLogsRequest request =
* ListLogsRequest.newBuilder()
* .setParent(ProjectName.of("[PROJECT]").toString())
* .addAllResourceNames(new ArrayList<String>())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .addAllResourceNames(new ArrayList<String>())
* .build();
* ApiFuture<String> future = loggingClient.listLogsPagedCallable().futureCall(request);
* // Do something.
Expand Down Expand Up @@ -1111,9 +1110,9 @@ public final UnaryCallable<ListLogsRequest, ListLogsPagedResponse> listLogsPaged
* ListLogsRequest request =
* ListLogsRequest.newBuilder()
* .setParent(ProjectName.of("[PROJECT]").toString())
* .addAllResourceNames(new ArrayList<String>())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .addAllResourceNames(new ArrayList<String>())
* .build();
* while (true) {
* ListLogsResponse response = loggingClient.listLogsCallable().call(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,15 @@
"CreateBucket": {
"methods": ["createBucket", "createBucketCallable"]
},
"CreateBucketAsync": {
"methods": ["createBucketAsyncAsync", "createBucketAsyncOperationCallable", "createBucketAsyncCallable"]
},
"CreateExclusion": {
"methods": ["createExclusion", "createExclusion", "createExclusion", "createExclusion", "createExclusion", "createExclusion", "createExclusionCallable"]
},
"CreateLink": {
"methods": ["createLinkAsync", "createLinkAsync", "createLinkAsync", "createLinkOperationCallable", "createLinkCallable"]
},
"CreateSink": {
"methods": ["createSink", "createSink", "createSink", "createSink", "createSink", "createSink", "createSinkCallable"]
},
Expand All @@ -58,6 +64,9 @@
"DeleteExclusion": {
"methods": ["deleteExclusion", "deleteExclusion", "deleteExclusion", "deleteExclusionCallable"]
},
"DeleteLink": {
"methods": ["deleteLinkAsync", "deleteLinkAsync", "deleteLinkAsync", "deleteLinkOperationCallable", "deleteLinkCallable"]
},
"DeleteSink": {
"methods": ["deleteSink", "deleteSink", "deleteSink", "deleteSinkCallable"]
},
Expand All @@ -73,6 +82,9 @@
"GetExclusion": {
"methods": ["getExclusion", "getExclusion", "getExclusion", "getExclusionCallable"]
},
"GetLink": {
"methods": ["getLink", "getLink", "getLink", "getLinkCallable"]
},
"GetSettings": {
"methods": ["getSettings", "getSettings", "getSettings", "getSettingsCallable"]
},
Expand All @@ -88,6 +100,9 @@
"ListExclusions": {
"methods": ["listExclusions", "listExclusions", "listExclusions", "listExclusions", "listExclusions", "listExclusions", "listExclusionsPagedCallable", "listExclusionsCallable"]
},
"ListLinks": {
"methods": ["listLinks", "listLinks", "listLinks", "listLinksPagedCallable", "listLinksCallable"]
},
"ListSinks": {
"methods": ["listSinks", "listSinks", "listSinks", "listSinks", "listSinks", "listSinks", "listSinksPagedCallable", "listSinksCallable"]
},
Expand All @@ -100,6 +115,9 @@
"UpdateBucket": {
"methods": ["updateBucket", "updateBucketCallable"]
},
"UpdateBucketAsync": {
"methods": ["updateBucketAsyncAsync", "updateBucketAsyncOperationCallable", "updateBucketAsyncCallable"]
},
"UpdateCmekSettings": {
"methods": ["updateCmekSettings", "updateCmekSettingsCallable"]
},
Expand Down
Loading