1 | <?php
|
---|
2 | /*
|
---|
3 | * Copyright 2014 Google Inc.
|
---|
4 | *
|
---|
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
7 | * the License at
|
---|
8 | *
|
---|
9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 | *
|
---|
11 | * Unless required by applicable law or agreed to in writing, software
|
---|
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
14 | * License for the specific language governing permissions and limitations under
|
---|
15 | * the License.
|
---|
16 | */
|
---|
17 |
|
---|
18 | namespace Google\Service\Logging\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Logging\ListLogsResponse;
|
---|
21 | use Google\Service\Logging\LoggingEmpty;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "logs" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $loggingService = new Google\Service\Logging(...);
|
---|
28 | * $logs = $loggingService->logs;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class Logs extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Deletes all the log entries in a log for the _Default Log Bucket. The log
|
---|
35 | * reappears if it receives new entries. Log entries written shortly before the
|
---|
36 | * delete operation might not be deleted. Entries received after the delete
|
---|
37 | * operation with a timestamp before the operation will be deleted.
|
---|
38 | * (logs.delete)
|
---|
39 | *
|
---|
40 | * @param string $logName Required. The resource name of the log to delete:
|
---|
41 | * projects/[PROJECT_ID]/logs/[LOG_ID]
|
---|
42 | * organizations/[ORGANIZATION_ID]/logs/[LOG_ID]
|
---|
43 | * billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]
|
---|
44 | * folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example,
|
---|
45 | * "projects/my-project-id/logs/syslog",
|
---|
46 | * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For more
|
---|
47 | * information about log names, see LogEntry.
|
---|
48 | * @param array $optParams Optional parameters.
|
---|
49 | * @return LoggingEmpty
|
---|
50 | * @throws \Google\Service\Exception
|
---|
51 | */
|
---|
52 | public function delete($logName, $optParams = [])
|
---|
53 | {
|
---|
54 | $params = ['logName' => $logName];
|
---|
55 | $params = array_merge($params, $optParams);
|
---|
56 | return $this->call('delete', [$params], LoggingEmpty::class);
|
---|
57 | }
|
---|
58 | /**
|
---|
59 | * Lists the logs in projects, organizations, folders, or billing accounts. Only
|
---|
60 | * logs that have entries are listed. (logs.listLogs)
|
---|
61 | *
|
---|
62 | * @param string $parent Required. The resource name to list logs for:
|
---|
63 | * projects/[PROJECT_ID] organizations/[ORGANIZATION_ID]
|
---|
64 | * billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]
|
---|
65 | * @param array $optParams Optional parameters.
|
---|
66 | *
|
---|
67 | * @opt_param int pageSize Optional. The maximum number of results to return
|
---|
68 | * from this request. Non-positive values are ignored. The presence of
|
---|
69 | * nextPageToken in the response indicates that more results might be available.
|
---|
70 | * @opt_param string pageToken Optional. If present, then retrieve the next
|
---|
71 | * batch of results from the preceding call to this method. pageToken must be
|
---|
72 | * the value of nextPageToken from the previous response. The values of other
|
---|
73 | * method parameters should be identical to those in the previous call.
|
---|
74 | * @opt_param string resourceNames Optional. List of resource names to list logs
|
---|
75 | * for: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/
|
---|
76 | * [VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
|
---|
77 | * CKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCA
|
---|
78 | * TION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[L
|
---|
79 | * OCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]To support legacy queries, it
|
---|
80 | * could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID]
|
---|
81 | * billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]The resource name in
|
---|
82 | * the parent field is added to this list.
|
---|
83 | * @return ListLogsResponse
|
---|
84 | * @throws \Google\Service\Exception
|
---|
85 | */
|
---|
86 | public function listLogs($parent, $optParams = [])
|
---|
87 | {
|
---|
88 | $params = ['parent' => $parent];
|
---|
89 | $params = array_merge($params, $optParams);
|
---|
90 | return $this->call('list', [$params], ListLogsResponse::class);
|
---|
91 | }
|
---|
92 | }
|
---|
93 |
|
---|
94 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
95 | class_alias(Logs::class, 'Google_Service_Logging_Resource_Logs');
|
---|