@googleapis/securityposture 1.0.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +76 -0
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -0
- package/build/v1.d.ts +1317 -4
- package/build/v1.js +20 -1
- package/build/v1.js.map +1 -1
- package/package.json +4 -4
- package/v1.ts +1317 -3
package/build/v1.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
|
|
3
2
|
import { Readable } from 'stream';
|
|
4
3
|
export declare namespace securityposture_v1 {
|
|
@@ -268,7 +267,7 @@ export declare namespace securityposture_v1 {
|
|
|
268
267
|
*/
|
|
269
268
|
enforce?: boolean | null;
|
|
270
269
|
/**
|
|
271
|
-
* Optional. Required for managed constraints if parameters are defined. Passes parameter values when policy enforcement is enabled. Ensure that parameter value types match those defined in the constraint definition. For example: { "allowedLocations"
|
|
270
|
+
* Optional. Required for managed constraints if parameters are defined. Passes parameter values when policy enforcement is enabled. Ensure that parameter value types match those defined in the constraint definition. For example: ``` { "allowedLocations": ["us-east1", "us-west1"], "allowAll": true \} ```
|
|
272
271
|
*/
|
|
273
272
|
parameters?: {
|
|
274
273
|
[key: string]: any;
|
|
@@ -816,11 +815,11 @@ export declare namespace securityposture_v1 {
|
|
|
816
815
|
resourceTypes?: string[] | null;
|
|
817
816
|
}
|
|
818
817
|
/**
|
|
819
|
-
* Set multiple resource types for one policy, for example: resourceTypes: included: - compute.googleapis.com/Instance - compute.googleapis.com/Disk Constraint definition contains an empty resource type in order to support multiple resource types in the policy. Only supports managed constraints. Method type is `GOVERN_TAGS`.
|
|
818
|
+
* Set multiple resource types for one policy, for example: ``` resourceTypes: included: - compute.googleapis.com/Instance - compute.googleapis.com/Disk ``` Constraint definition contains an empty resource type in order to support multiple resource types in the policy. Only supports managed constraints. Method type is `GOVERN_TAGS`.
|
|
820
819
|
*/
|
|
821
820
|
export interface Schema$ResourceTypes {
|
|
822
821
|
/**
|
|
823
|
-
* Optional. The resource types we currently support.
|
|
822
|
+
* Optional. The resource types we currently support.
|
|
824
823
|
*/
|
|
825
824
|
included?: string[] | null;
|
|
826
825
|
}
|
|
@@ -929,6 +928,56 @@ export declare namespace securityposture_v1 {
|
|
|
929
928
|
constructor(context: APIRequestContext);
|
|
930
929
|
/**
|
|
931
930
|
* Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.
|
|
931
|
+
* @example
|
|
932
|
+
* ```js
|
|
933
|
+
* // Before running the sample:
|
|
934
|
+
* // - Enable the API at:
|
|
935
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
936
|
+
* // - Login into gcloud by running:
|
|
937
|
+
* // ```sh
|
|
938
|
+
* // $ gcloud auth application-default login
|
|
939
|
+
* // ```
|
|
940
|
+
* // - Install the npm module by running:
|
|
941
|
+
* // ```sh
|
|
942
|
+
* // $ npm install googleapis
|
|
943
|
+
* // ```
|
|
944
|
+
*
|
|
945
|
+
* const {google} = require('googleapis');
|
|
946
|
+
* const securityposture = google.securityposture('v1');
|
|
947
|
+
*
|
|
948
|
+
* async function main() {
|
|
949
|
+
* const auth = new google.auth.GoogleAuth({
|
|
950
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
951
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
952
|
+
* });
|
|
953
|
+
*
|
|
954
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
955
|
+
* const authClient = await auth.getClient();
|
|
956
|
+
* google.options({auth: authClient});
|
|
957
|
+
*
|
|
958
|
+
* // Do the magic
|
|
959
|
+
* const res = await securityposture.organizations.locations.operations.cancel({
|
|
960
|
+
* // The name of the operation resource to be cancelled.
|
|
961
|
+
* name: 'organizations/my-organization/locations/my-location/operations/my-operation',
|
|
962
|
+
*
|
|
963
|
+
* // Request body metadata
|
|
964
|
+
* requestBody: {
|
|
965
|
+
* // request body parameters
|
|
966
|
+
* // {}
|
|
967
|
+
* },
|
|
968
|
+
* });
|
|
969
|
+
* console.log(res.data);
|
|
970
|
+
*
|
|
971
|
+
* // Example response
|
|
972
|
+
* // {}
|
|
973
|
+
* }
|
|
974
|
+
*
|
|
975
|
+
* main().catch(e => {
|
|
976
|
+
* console.error(e);
|
|
977
|
+
* throw e;
|
|
978
|
+
* });
|
|
979
|
+
*
|
|
980
|
+
* ```
|
|
932
981
|
*
|
|
933
982
|
* @param params - Parameters for request
|
|
934
983
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -943,6 +992,50 @@ export declare namespace securityposture_v1 {
|
|
|
943
992
|
cancel(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
944
993
|
/**
|
|
945
994
|
* Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
|
|
995
|
+
* @example
|
|
996
|
+
* ```js
|
|
997
|
+
* // Before running the sample:
|
|
998
|
+
* // - Enable the API at:
|
|
999
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1000
|
+
* // - Login into gcloud by running:
|
|
1001
|
+
* // ```sh
|
|
1002
|
+
* // $ gcloud auth application-default login
|
|
1003
|
+
* // ```
|
|
1004
|
+
* // - Install the npm module by running:
|
|
1005
|
+
* // ```sh
|
|
1006
|
+
* // $ npm install googleapis
|
|
1007
|
+
* // ```
|
|
1008
|
+
*
|
|
1009
|
+
* const {google} = require('googleapis');
|
|
1010
|
+
* const securityposture = google.securityposture('v1');
|
|
1011
|
+
*
|
|
1012
|
+
* async function main() {
|
|
1013
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1014
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1015
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1016
|
+
* });
|
|
1017
|
+
*
|
|
1018
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1019
|
+
* const authClient = await auth.getClient();
|
|
1020
|
+
* google.options({auth: authClient});
|
|
1021
|
+
*
|
|
1022
|
+
* // Do the magic
|
|
1023
|
+
* const res = await securityposture.organizations.locations.operations.delete({
|
|
1024
|
+
* // The name of the operation resource to be deleted.
|
|
1025
|
+
* name: 'organizations/my-organization/locations/my-location/operations/my-operation',
|
|
1026
|
+
* });
|
|
1027
|
+
* console.log(res.data);
|
|
1028
|
+
*
|
|
1029
|
+
* // Example response
|
|
1030
|
+
* // {}
|
|
1031
|
+
* }
|
|
1032
|
+
*
|
|
1033
|
+
* main().catch(e => {
|
|
1034
|
+
* console.error(e);
|
|
1035
|
+
* throw e;
|
|
1036
|
+
* });
|
|
1037
|
+
*
|
|
1038
|
+
* ```
|
|
946
1039
|
*
|
|
947
1040
|
* @param params - Parameters for request
|
|
948
1041
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -957,6 +1050,56 @@ export declare namespace securityposture_v1 {
|
|
|
957
1050
|
delete(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
958
1051
|
/**
|
|
959
1052
|
* Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
|
|
1053
|
+
* @example
|
|
1054
|
+
* ```js
|
|
1055
|
+
* // Before running the sample:
|
|
1056
|
+
* // - Enable the API at:
|
|
1057
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1058
|
+
* // - Login into gcloud by running:
|
|
1059
|
+
* // ```sh
|
|
1060
|
+
* // $ gcloud auth application-default login
|
|
1061
|
+
* // ```
|
|
1062
|
+
* // - Install the npm module by running:
|
|
1063
|
+
* // ```sh
|
|
1064
|
+
* // $ npm install googleapis
|
|
1065
|
+
* // ```
|
|
1066
|
+
*
|
|
1067
|
+
* const {google} = require('googleapis');
|
|
1068
|
+
* const securityposture = google.securityposture('v1');
|
|
1069
|
+
*
|
|
1070
|
+
* async function main() {
|
|
1071
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1072
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1073
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1074
|
+
* });
|
|
1075
|
+
*
|
|
1076
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1077
|
+
* const authClient = await auth.getClient();
|
|
1078
|
+
* google.options({auth: authClient});
|
|
1079
|
+
*
|
|
1080
|
+
* // Do the magic
|
|
1081
|
+
* const res = await securityposture.organizations.locations.operations.get({
|
|
1082
|
+
* // The name of the operation resource.
|
|
1083
|
+
* name: 'organizations/my-organization/locations/my-location/operations/my-operation',
|
|
1084
|
+
* });
|
|
1085
|
+
* console.log(res.data);
|
|
1086
|
+
*
|
|
1087
|
+
* // Example response
|
|
1088
|
+
* // {
|
|
1089
|
+
* // "done": false,
|
|
1090
|
+
* // "error": {},
|
|
1091
|
+
* // "metadata": {},
|
|
1092
|
+
* // "name": "my_name",
|
|
1093
|
+
* // "response": {}
|
|
1094
|
+
* // }
|
|
1095
|
+
* }
|
|
1096
|
+
*
|
|
1097
|
+
* main().catch(e => {
|
|
1098
|
+
* console.error(e);
|
|
1099
|
+
* throw e;
|
|
1100
|
+
* });
|
|
1101
|
+
*
|
|
1102
|
+
* ```
|
|
960
1103
|
*
|
|
961
1104
|
* @param params - Parameters for request
|
|
962
1105
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -971,6 +1114,59 @@ export declare namespace securityposture_v1 {
|
|
|
971
1114
|
get(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
972
1115
|
/**
|
|
973
1116
|
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
|
|
1117
|
+
* @example
|
|
1118
|
+
* ```js
|
|
1119
|
+
* // Before running the sample:
|
|
1120
|
+
* // - Enable the API at:
|
|
1121
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1122
|
+
* // - Login into gcloud by running:
|
|
1123
|
+
* // ```sh
|
|
1124
|
+
* // $ gcloud auth application-default login
|
|
1125
|
+
* // ```
|
|
1126
|
+
* // - Install the npm module by running:
|
|
1127
|
+
* // ```sh
|
|
1128
|
+
* // $ npm install googleapis
|
|
1129
|
+
* // ```
|
|
1130
|
+
*
|
|
1131
|
+
* const {google} = require('googleapis');
|
|
1132
|
+
* const securityposture = google.securityposture('v1');
|
|
1133
|
+
*
|
|
1134
|
+
* async function main() {
|
|
1135
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1136
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1137
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1138
|
+
* });
|
|
1139
|
+
*
|
|
1140
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1141
|
+
* const authClient = await auth.getClient();
|
|
1142
|
+
* google.options({auth: authClient});
|
|
1143
|
+
*
|
|
1144
|
+
* // Do the magic
|
|
1145
|
+
* const res = await securityposture.organizations.locations.operations.list({
|
|
1146
|
+
* // The standard list filter.
|
|
1147
|
+
* filter: 'placeholder-value',
|
|
1148
|
+
* // The name of the operation's parent resource.
|
|
1149
|
+
* name: 'organizations/my-organization/locations/my-location',
|
|
1150
|
+
* // The standard list page size.
|
|
1151
|
+
* pageSize: 'placeholder-value',
|
|
1152
|
+
* // The standard list page token.
|
|
1153
|
+
* pageToken: 'placeholder-value',
|
|
1154
|
+
* });
|
|
1155
|
+
* console.log(res.data);
|
|
1156
|
+
*
|
|
1157
|
+
* // Example response
|
|
1158
|
+
* // {
|
|
1159
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
1160
|
+
* // "operations": []
|
|
1161
|
+
* // }
|
|
1162
|
+
* }
|
|
1163
|
+
*
|
|
1164
|
+
* main().catch(e => {
|
|
1165
|
+
* console.error(e);
|
|
1166
|
+
* throw e;
|
|
1167
|
+
* });
|
|
1168
|
+
*
|
|
1169
|
+
* ```
|
|
974
1170
|
*
|
|
975
1171
|
* @param params - Parameters for request
|
|
976
1172
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1029,6 +1225,81 @@ export declare namespace securityposture_v1 {
|
|
|
1029
1225
|
constructor(context: APIRequestContext);
|
|
1030
1226
|
/**
|
|
1031
1227
|
* Creates a new PostureDeployment in a given project and location.
|
|
1228
|
+
* @example
|
|
1229
|
+
* ```js
|
|
1230
|
+
* // Before running the sample:
|
|
1231
|
+
* // - Enable the API at:
|
|
1232
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1233
|
+
* // - Login into gcloud by running:
|
|
1234
|
+
* // ```sh
|
|
1235
|
+
* // $ gcloud auth application-default login
|
|
1236
|
+
* // ```
|
|
1237
|
+
* // - Install the npm module by running:
|
|
1238
|
+
* // ```sh
|
|
1239
|
+
* // $ npm install googleapis
|
|
1240
|
+
* // ```
|
|
1241
|
+
*
|
|
1242
|
+
* const {google} = require('googleapis');
|
|
1243
|
+
* const securityposture = google.securityposture('v1');
|
|
1244
|
+
*
|
|
1245
|
+
* async function main() {
|
|
1246
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1247
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1248
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1249
|
+
* });
|
|
1250
|
+
*
|
|
1251
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1252
|
+
* const authClient = await auth.getClient();
|
|
1253
|
+
* google.options({auth: authClient});
|
|
1254
|
+
*
|
|
1255
|
+
* // Do the magic
|
|
1256
|
+
* const res =
|
|
1257
|
+
* await securityposture.organizations.locations.postureDeployments.create({
|
|
1258
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
1259
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
1260
|
+
* // Required. An identifier for the posture deployment.
|
|
1261
|
+
* postureDeploymentId: 'placeholder-value',
|
|
1262
|
+
*
|
|
1263
|
+
* // Request body metadata
|
|
1264
|
+
* requestBody: {
|
|
1265
|
+
* // request body parameters
|
|
1266
|
+
* // {
|
|
1267
|
+
* // "annotations": {},
|
|
1268
|
+
* // "categories": [],
|
|
1269
|
+
* // "createTime": "my_createTime",
|
|
1270
|
+
* // "description": "my_description",
|
|
1271
|
+
* // "desiredPostureId": "my_desiredPostureId",
|
|
1272
|
+
* // "desiredPostureRevisionId": "my_desiredPostureRevisionId",
|
|
1273
|
+
* // "etag": "my_etag",
|
|
1274
|
+
* // "failureMessage": "my_failureMessage",
|
|
1275
|
+
* // "name": "my_name",
|
|
1276
|
+
* // "postureId": "my_postureId",
|
|
1277
|
+
* // "postureRevisionId": "my_postureRevisionId",
|
|
1278
|
+
* // "reconciling": false,
|
|
1279
|
+
* // "state": "my_state",
|
|
1280
|
+
* // "targetResource": "my_targetResource",
|
|
1281
|
+
* // "updateTime": "my_updateTime"
|
|
1282
|
+
* // }
|
|
1283
|
+
* },
|
|
1284
|
+
* });
|
|
1285
|
+
* console.log(res.data);
|
|
1286
|
+
*
|
|
1287
|
+
* // Example response
|
|
1288
|
+
* // {
|
|
1289
|
+
* // "done": false,
|
|
1290
|
+
* // "error": {},
|
|
1291
|
+
* // "metadata": {},
|
|
1292
|
+
* // "name": "my_name",
|
|
1293
|
+
* // "response": {}
|
|
1294
|
+
* // }
|
|
1295
|
+
* }
|
|
1296
|
+
*
|
|
1297
|
+
* main().catch(e => {
|
|
1298
|
+
* console.error(e);
|
|
1299
|
+
* throw e;
|
|
1300
|
+
* });
|
|
1301
|
+
*
|
|
1302
|
+
* ```
|
|
1032
1303
|
*
|
|
1033
1304
|
* @param params - Parameters for request
|
|
1034
1305
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1043,6 +1314,59 @@ export declare namespace securityposture_v1 {
|
|
|
1043
1314
|
create(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1044
1315
|
/**
|
|
1045
1316
|
* Deletes a PostureDeployment.
|
|
1317
|
+
* @example
|
|
1318
|
+
* ```js
|
|
1319
|
+
* // Before running the sample:
|
|
1320
|
+
* // - Enable the API at:
|
|
1321
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1322
|
+
* // - Login into gcloud by running:
|
|
1323
|
+
* // ```sh
|
|
1324
|
+
* // $ gcloud auth application-default login
|
|
1325
|
+
* // ```
|
|
1326
|
+
* // - Install the npm module by running:
|
|
1327
|
+
* // ```sh
|
|
1328
|
+
* // $ npm install googleapis
|
|
1329
|
+
* // ```
|
|
1330
|
+
*
|
|
1331
|
+
* const {google} = require('googleapis');
|
|
1332
|
+
* const securityposture = google.securityposture('v1');
|
|
1333
|
+
*
|
|
1334
|
+
* async function main() {
|
|
1335
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1336
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1337
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1338
|
+
* });
|
|
1339
|
+
*
|
|
1340
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1341
|
+
* const authClient = await auth.getClient();
|
|
1342
|
+
* google.options({auth: authClient});
|
|
1343
|
+
*
|
|
1344
|
+
* // Do the magic
|
|
1345
|
+
* const res =
|
|
1346
|
+
* await securityposture.organizations.locations.postureDeployments.delete({
|
|
1347
|
+
* // Optional. An opaque identifier for the current version of the posture deployment. If you provide this value, then it must match the existing value. If the values don't match, then the request fails with an ABORTED error. If you omit this value, then the posture deployment is deleted regardless of its current `etag` value.
|
|
1348
|
+
* etag: 'placeholder-value',
|
|
1349
|
+
* // Required. The name of the posture deployment, in the format `organizations/{organization\}/locations/global/postureDeployments/{posture_id\}`.
|
|
1350
|
+
* name: 'organizations/my-organization/locations/my-location/postureDeployments/my-postureDeployment',
|
|
1351
|
+
* });
|
|
1352
|
+
* console.log(res.data);
|
|
1353
|
+
*
|
|
1354
|
+
* // Example response
|
|
1355
|
+
* // {
|
|
1356
|
+
* // "done": false,
|
|
1357
|
+
* // "error": {},
|
|
1358
|
+
* // "metadata": {},
|
|
1359
|
+
* // "name": "my_name",
|
|
1360
|
+
* // "response": {}
|
|
1361
|
+
* // }
|
|
1362
|
+
* }
|
|
1363
|
+
*
|
|
1364
|
+
* main().catch(e => {
|
|
1365
|
+
* console.error(e);
|
|
1366
|
+
* throw e;
|
|
1367
|
+
* });
|
|
1368
|
+
*
|
|
1369
|
+
* ```
|
|
1046
1370
|
*
|
|
1047
1371
|
* @param params - Parameters for request
|
|
1048
1372
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1057,6 +1381,67 @@ export declare namespace securityposture_v1 {
|
|
|
1057
1381
|
delete(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1058
1382
|
/**
|
|
1059
1383
|
* Gets details for a PostureDeployment.
|
|
1384
|
+
* @example
|
|
1385
|
+
* ```js
|
|
1386
|
+
* // Before running the sample:
|
|
1387
|
+
* // - Enable the API at:
|
|
1388
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1389
|
+
* // - Login into gcloud by running:
|
|
1390
|
+
* // ```sh
|
|
1391
|
+
* // $ gcloud auth application-default login
|
|
1392
|
+
* // ```
|
|
1393
|
+
* // - Install the npm module by running:
|
|
1394
|
+
* // ```sh
|
|
1395
|
+
* // $ npm install googleapis
|
|
1396
|
+
* // ```
|
|
1397
|
+
*
|
|
1398
|
+
* const {google} = require('googleapis');
|
|
1399
|
+
* const securityposture = google.securityposture('v1');
|
|
1400
|
+
*
|
|
1401
|
+
* async function main() {
|
|
1402
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1403
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1404
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1405
|
+
* });
|
|
1406
|
+
*
|
|
1407
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1408
|
+
* const authClient = await auth.getClient();
|
|
1409
|
+
* google.options({auth: authClient});
|
|
1410
|
+
*
|
|
1411
|
+
* // Do the magic
|
|
1412
|
+
* const res =
|
|
1413
|
+
* await securityposture.organizations.locations.postureDeployments.get({
|
|
1414
|
+
* // Required. The name of the PostureDeployment, in the format `organizations/{organization\}/locations/global/postureDeployments/{posture_deployment_id\}`.
|
|
1415
|
+
* name: 'organizations/my-organization/locations/my-location/postureDeployments/my-postureDeployment',
|
|
1416
|
+
* });
|
|
1417
|
+
* console.log(res.data);
|
|
1418
|
+
*
|
|
1419
|
+
* // Example response
|
|
1420
|
+
* // {
|
|
1421
|
+
* // "annotations": {},
|
|
1422
|
+
* // "categories": [],
|
|
1423
|
+
* // "createTime": "my_createTime",
|
|
1424
|
+
* // "description": "my_description",
|
|
1425
|
+
* // "desiredPostureId": "my_desiredPostureId",
|
|
1426
|
+
* // "desiredPostureRevisionId": "my_desiredPostureRevisionId",
|
|
1427
|
+
* // "etag": "my_etag",
|
|
1428
|
+
* // "failureMessage": "my_failureMessage",
|
|
1429
|
+
* // "name": "my_name",
|
|
1430
|
+
* // "postureId": "my_postureId",
|
|
1431
|
+
* // "postureRevisionId": "my_postureRevisionId",
|
|
1432
|
+
* // "reconciling": false,
|
|
1433
|
+
* // "state": "my_state",
|
|
1434
|
+
* // "targetResource": "my_targetResource",
|
|
1435
|
+
* // "updateTime": "my_updateTime"
|
|
1436
|
+
* // }
|
|
1437
|
+
* }
|
|
1438
|
+
*
|
|
1439
|
+
* main().catch(e => {
|
|
1440
|
+
* console.error(e);
|
|
1441
|
+
* throw e;
|
|
1442
|
+
* });
|
|
1443
|
+
*
|
|
1444
|
+
* ```
|
|
1060
1445
|
*
|
|
1061
1446
|
* @param params - Parameters for request
|
|
1062
1447
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1071,6 +1456,61 @@ export declare namespace securityposture_v1 {
|
|
|
1071
1456
|
get(callback: BodyResponseCallback<Schema$PostureDeployment>): void;
|
|
1072
1457
|
/**
|
|
1073
1458
|
* Lists every PostureDeployment in a project and location.
|
|
1459
|
+
* @example
|
|
1460
|
+
* ```js
|
|
1461
|
+
* // Before running the sample:
|
|
1462
|
+
* // - Enable the API at:
|
|
1463
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1464
|
+
* // - Login into gcloud by running:
|
|
1465
|
+
* // ```sh
|
|
1466
|
+
* // $ gcloud auth application-default login
|
|
1467
|
+
* // ```
|
|
1468
|
+
* // - Install the npm module by running:
|
|
1469
|
+
* // ```sh
|
|
1470
|
+
* // $ npm install googleapis
|
|
1471
|
+
* // ```
|
|
1472
|
+
*
|
|
1473
|
+
* const {google} = require('googleapis');
|
|
1474
|
+
* const securityposture = google.securityposture('v1');
|
|
1475
|
+
*
|
|
1476
|
+
* async function main() {
|
|
1477
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1478
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1479
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1480
|
+
* });
|
|
1481
|
+
*
|
|
1482
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1483
|
+
* const authClient = await auth.getClient();
|
|
1484
|
+
* google.options({auth: authClient});
|
|
1485
|
+
*
|
|
1486
|
+
* // Do the magic
|
|
1487
|
+
* const res =
|
|
1488
|
+
* await securityposture.organizations.locations.postureDeployments.list({
|
|
1489
|
+
* // Optional. A filter to apply to the list of postures, in the format defined in [AIP-160: Filtering](https://google.aip.dev/160).
|
|
1490
|
+
* filter: 'placeholder-value',
|
|
1491
|
+
* // Optional. The maximum number of posture deployments to return. The default value is `500`. If you exceed the maximum value of `1000`, then the service uses the maximum value.
|
|
1492
|
+
* pageSize: 'placeholder-value',
|
|
1493
|
+
* // Optional. A pagination token returned from a previous request to list posture deployments. Provide this token to retrieve the next page of results.
|
|
1494
|
+
* pageToken: 'placeholder-value',
|
|
1495
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
1496
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
1497
|
+
* });
|
|
1498
|
+
* console.log(res.data);
|
|
1499
|
+
*
|
|
1500
|
+
* // Example response
|
|
1501
|
+
* // {
|
|
1502
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
1503
|
+
* // "postureDeployments": [],
|
|
1504
|
+
* // "unreachable": []
|
|
1505
|
+
* // }
|
|
1506
|
+
* }
|
|
1507
|
+
*
|
|
1508
|
+
* main().catch(e => {
|
|
1509
|
+
* console.error(e);
|
|
1510
|
+
* throw e;
|
|
1511
|
+
* });
|
|
1512
|
+
*
|
|
1513
|
+
* ```
|
|
1074
1514
|
*
|
|
1075
1515
|
* @param params - Parameters for request
|
|
1076
1516
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1085,6 +1525,81 @@ export declare namespace securityposture_v1 {
|
|
|
1085
1525
|
list(callback: BodyResponseCallback<Schema$ListPostureDeploymentsResponse>): void;
|
|
1086
1526
|
/**
|
|
1087
1527
|
* Updates an existing PostureDeployment. To prevent concurrent updates from overwriting each other, always follow the read-modify-write pattern when you update a posture deployment: 1. Call GetPostureDeployment to get the current version of the deployment. 2. Update the fields in the deployment as needed. 3. Call UpdatePostureDeployment to update the deployment. Ensure that your request includes the `etag` value from the GetPostureDeployment response. **Important:** If you omit the `etag` when you call UpdatePostureDeployment, then the updated deployment unconditionally overwrites the existing deployment.
|
|
1528
|
+
* @example
|
|
1529
|
+
* ```js
|
|
1530
|
+
* // Before running the sample:
|
|
1531
|
+
* // - Enable the API at:
|
|
1532
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1533
|
+
* // - Login into gcloud by running:
|
|
1534
|
+
* // ```sh
|
|
1535
|
+
* // $ gcloud auth application-default login
|
|
1536
|
+
* // ```
|
|
1537
|
+
* // - Install the npm module by running:
|
|
1538
|
+
* // ```sh
|
|
1539
|
+
* // $ npm install googleapis
|
|
1540
|
+
* // ```
|
|
1541
|
+
*
|
|
1542
|
+
* const {google} = require('googleapis');
|
|
1543
|
+
* const securityposture = google.securityposture('v1');
|
|
1544
|
+
*
|
|
1545
|
+
* async function main() {
|
|
1546
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1547
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1548
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1549
|
+
* });
|
|
1550
|
+
*
|
|
1551
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1552
|
+
* const authClient = await auth.getClient();
|
|
1553
|
+
* google.options({auth: authClient});
|
|
1554
|
+
*
|
|
1555
|
+
* // Do the magic
|
|
1556
|
+
* const res =
|
|
1557
|
+
* await securityposture.organizations.locations.postureDeployments.patch({
|
|
1558
|
+
* // Required. Identifier. The name of the posture deployment, in the format `organizations/{organization\}/locations/global/postureDeployments/{deployment_id\}`.
|
|
1559
|
+
* name: 'organizations/my-organization/locations/my-location/postureDeployments/my-postureDeployment',
|
|
1560
|
+
* // Required. The fields in the PostureDeployment to update. You can update only the following fields: * PostureDeployment.posture_id * PostureDeployment.posture_revision_id
|
|
1561
|
+
* updateMask: 'placeholder-value',
|
|
1562
|
+
*
|
|
1563
|
+
* // Request body metadata
|
|
1564
|
+
* requestBody: {
|
|
1565
|
+
* // request body parameters
|
|
1566
|
+
* // {
|
|
1567
|
+
* // "annotations": {},
|
|
1568
|
+
* // "categories": [],
|
|
1569
|
+
* // "createTime": "my_createTime",
|
|
1570
|
+
* // "description": "my_description",
|
|
1571
|
+
* // "desiredPostureId": "my_desiredPostureId",
|
|
1572
|
+
* // "desiredPostureRevisionId": "my_desiredPostureRevisionId",
|
|
1573
|
+
* // "etag": "my_etag",
|
|
1574
|
+
* // "failureMessage": "my_failureMessage",
|
|
1575
|
+
* // "name": "my_name",
|
|
1576
|
+
* // "postureId": "my_postureId",
|
|
1577
|
+
* // "postureRevisionId": "my_postureRevisionId",
|
|
1578
|
+
* // "reconciling": false,
|
|
1579
|
+
* // "state": "my_state",
|
|
1580
|
+
* // "targetResource": "my_targetResource",
|
|
1581
|
+
* // "updateTime": "my_updateTime"
|
|
1582
|
+
* // }
|
|
1583
|
+
* },
|
|
1584
|
+
* });
|
|
1585
|
+
* console.log(res.data);
|
|
1586
|
+
*
|
|
1587
|
+
* // Example response
|
|
1588
|
+
* // {
|
|
1589
|
+
* // "done": false,
|
|
1590
|
+
* // "error": {},
|
|
1591
|
+
* // "metadata": {},
|
|
1592
|
+
* // "name": "my_name",
|
|
1593
|
+
* // "response": {}
|
|
1594
|
+
* // }
|
|
1595
|
+
* }
|
|
1596
|
+
*
|
|
1597
|
+
* main().catch(e => {
|
|
1598
|
+
* console.error(e);
|
|
1599
|
+
* throw e;
|
|
1600
|
+
* });
|
|
1601
|
+
*
|
|
1602
|
+
* ```
|
|
1088
1603
|
*
|
|
1089
1604
|
* @param params - Parameters for request
|
|
1090
1605
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1165,6 +1680,76 @@ export declare namespace securityposture_v1 {
|
|
|
1165
1680
|
constructor(context: APIRequestContext);
|
|
1166
1681
|
/**
|
|
1167
1682
|
* Creates a new Posture.
|
|
1683
|
+
* @example
|
|
1684
|
+
* ```js
|
|
1685
|
+
* // Before running the sample:
|
|
1686
|
+
* // - Enable the API at:
|
|
1687
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1688
|
+
* // - Login into gcloud by running:
|
|
1689
|
+
* // ```sh
|
|
1690
|
+
* // $ gcloud auth application-default login
|
|
1691
|
+
* // ```
|
|
1692
|
+
* // - Install the npm module by running:
|
|
1693
|
+
* // ```sh
|
|
1694
|
+
* // $ npm install googleapis
|
|
1695
|
+
* // ```
|
|
1696
|
+
*
|
|
1697
|
+
* const {google} = require('googleapis');
|
|
1698
|
+
* const securityposture = google.securityposture('v1');
|
|
1699
|
+
*
|
|
1700
|
+
* async function main() {
|
|
1701
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1702
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1703
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1704
|
+
* });
|
|
1705
|
+
*
|
|
1706
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1707
|
+
* const authClient = await auth.getClient();
|
|
1708
|
+
* google.options({auth: authClient});
|
|
1709
|
+
*
|
|
1710
|
+
* // Do the magic
|
|
1711
|
+
* const res = await securityposture.organizations.locations.postures.create({
|
|
1712
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
1713
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
1714
|
+
* // Required. An identifier for the posture.
|
|
1715
|
+
* postureId: 'placeholder-value',
|
|
1716
|
+
*
|
|
1717
|
+
* // Request body metadata
|
|
1718
|
+
* requestBody: {
|
|
1719
|
+
* // request body parameters
|
|
1720
|
+
* // {
|
|
1721
|
+
* // "annotations": {},
|
|
1722
|
+
* // "categories": [],
|
|
1723
|
+
* // "createTime": "my_createTime",
|
|
1724
|
+
* // "description": "my_description",
|
|
1725
|
+
* // "etag": "my_etag",
|
|
1726
|
+
* // "name": "my_name",
|
|
1727
|
+
* // "policySets": [],
|
|
1728
|
+
* // "reconciling": false,
|
|
1729
|
+
* // "revisionId": "my_revisionId",
|
|
1730
|
+
* // "state": "my_state",
|
|
1731
|
+
* // "updateTime": "my_updateTime"
|
|
1732
|
+
* // }
|
|
1733
|
+
* },
|
|
1734
|
+
* });
|
|
1735
|
+
* console.log(res.data);
|
|
1736
|
+
*
|
|
1737
|
+
* // Example response
|
|
1738
|
+
* // {
|
|
1739
|
+
* // "done": false,
|
|
1740
|
+
* // "error": {},
|
|
1741
|
+
* // "metadata": {},
|
|
1742
|
+
* // "name": "my_name",
|
|
1743
|
+
* // "response": {}
|
|
1744
|
+
* // }
|
|
1745
|
+
* }
|
|
1746
|
+
*
|
|
1747
|
+
* main().catch(e => {
|
|
1748
|
+
* console.error(e);
|
|
1749
|
+
* throw e;
|
|
1750
|
+
* });
|
|
1751
|
+
*
|
|
1752
|
+
* ```
|
|
1168
1753
|
*
|
|
1169
1754
|
* @param params - Parameters for request
|
|
1170
1755
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1179,6 +1764,58 @@ export declare namespace securityposture_v1 {
|
|
|
1179
1764
|
create(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1180
1765
|
/**
|
|
1181
1766
|
* Deletes all revisions of a Posture. You can only delete a posture if none of its revisions are deployed.
|
|
1767
|
+
* @example
|
|
1768
|
+
* ```js
|
|
1769
|
+
* // Before running the sample:
|
|
1770
|
+
* // - Enable the API at:
|
|
1771
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1772
|
+
* // - Login into gcloud by running:
|
|
1773
|
+
* // ```sh
|
|
1774
|
+
* // $ gcloud auth application-default login
|
|
1775
|
+
* // ```
|
|
1776
|
+
* // - Install the npm module by running:
|
|
1777
|
+
* // ```sh
|
|
1778
|
+
* // $ npm install googleapis
|
|
1779
|
+
* // ```
|
|
1780
|
+
*
|
|
1781
|
+
* const {google} = require('googleapis');
|
|
1782
|
+
* const securityposture = google.securityposture('v1');
|
|
1783
|
+
*
|
|
1784
|
+
* async function main() {
|
|
1785
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1786
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1787
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1788
|
+
* });
|
|
1789
|
+
*
|
|
1790
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1791
|
+
* const authClient = await auth.getClient();
|
|
1792
|
+
* google.options({auth: authClient});
|
|
1793
|
+
*
|
|
1794
|
+
* // Do the magic
|
|
1795
|
+
* const res = await securityposture.organizations.locations.postures.delete({
|
|
1796
|
+
* // Optional. An opaque identifier for the current version of the posture. If you provide this value, then it must match the existing value. If the values don't match, then the request fails with an ABORTED error. If you omit this value, then the posture is deleted regardless of its current `etag` value.
|
|
1797
|
+
* etag: 'placeholder-value',
|
|
1798
|
+
* // Required. The name of the Posture, in the format `organizations/{organization\}/locations/global/postures/{posture_id\}`.
|
|
1799
|
+
* name: 'organizations/my-organization/locations/my-location/postures/my-posture',
|
|
1800
|
+
* });
|
|
1801
|
+
* console.log(res.data);
|
|
1802
|
+
*
|
|
1803
|
+
* // Example response
|
|
1804
|
+
* // {
|
|
1805
|
+
* // "done": false,
|
|
1806
|
+
* // "error": {},
|
|
1807
|
+
* // "metadata": {},
|
|
1808
|
+
* // "name": "my_name",
|
|
1809
|
+
* // "response": {}
|
|
1810
|
+
* // }
|
|
1811
|
+
* }
|
|
1812
|
+
*
|
|
1813
|
+
* main().catch(e => {
|
|
1814
|
+
* console.error(e);
|
|
1815
|
+
* throw e;
|
|
1816
|
+
* });
|
|
1817
|
+
*
|
|
1818
|
+
* ```
|
|
1182
1819
|
*
|
|
1183
1820
|
* @param params - Parameters for request
|
|
1184
1821
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1193,6 +1830,65 @@ export declare namespace securityposture_v1 {
|
|
|
1193
1830
|
delete(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1194
1831
|
/**
|
|
1195
1832
|
* Extracts existing policies from an organization, folder, or project, and applies them to another organization, folder, or project as a Posture. If the other organization, folder, or project already has a posture, then the result of the long-running operation is an ALREADY_EXISTS error.
|
|
1833
|
+
* @example
|
|
1834
|
+
* ```js
|
|
1835
|
+
* // Before running the sample:
|
|
1836
|
+
* // - Enable the API at:
|
|
1837
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1838
|
+
* // - Login into gcloud by running:
|
|
1839
|
+
* // ```sh
|
|
1840
|
+
* // $ gcloud auth application-default login
|
|
1841
|
+
* // ```
|
|
1842
|
+
* // - Install the npm module by running:
|
|
1843
|
+
* // ```sh
|
|
1844
|
+
* // $ npm install googleapis
|
|
1845
|
+
* // ```
|
|
1846
|
+
*
|
|
1847
|
+
* const {google} = require('googleapis');
|
|
1848
|
+
* const securityposture = google.securityposture('v1');
|
|
1849
|
+
*
|
|
1850
|
+
* async function main() {
|
|
1851
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1852
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1853
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1854
|
+
* });
|
|
1855
|
+
*
|
|
1856
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1857
|
+
* const authClient = await auth.getClient();
|
|
1858
|
+
* google.options({auth: authClient});
|
|
1859
|
+
*
|
|
1860
|
+
* // Do the magic
|
|
1861
|
+
* const res = await securityposture.organizations.locations.postures.extract({
|
|
1862
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
1863
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
1864
|
+
*
|
|
1865
|
+
* // Request body metadata
|
|
1866
|
+
* requestBody: {
|
|
1867
|
+
* // request body parameters
|
|
1868
|
+
* // {
|
|
1869
|
+
* // "postureId": "my_postureId",
|
|
1870
|
+
* // "workload": "my_workload"
|
|
1871
|
+
* // }
|
|
1872
|
+
* },
|
|
1873
|
+
* });
|
|
1874
|
+
* console.log(res.data);
|
|
1875
|
+
*
|
|
1876
|
+
* // Example response
|
|
1877
|
+
* // {
|
|
1878
|
+
* // "done": false,
|
|
1879
|
+
* // "error": {},
|
|
1880
|
+
* // "metadata": {},
|
|
1881
|
+
* // "name": "my_name",
|
|
1882
|
+
* // "response": {}
|
|
1883
|
+
* // }
|
|
1884
|
+
* }
|
|
1885
|
+
*
|
|
1886
|
+
* main().catch(e => {
|
|
1887
|
+
* console.error(e);
|
|
1888
|
+
* throw e;
|
|
1889
|
+
* });
|
|
1890
|
+
*
|
|
1891
|
+
* ```
|
|
1196
1892
|
*
|
|
1197
1893
|
* @param params - Parameters for request
|
|
1198
1894
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1207,6 +1903,64 @@ export declare namespace securityposture_v1 {
|
|
|
1207
1903
|
extract(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1208
1904
|
/**
|
|
1209
1905
|
* Gets a single revision of a Posture.
|
|
1906
|
+
* @example
|
|
1907
|
+
* ```js
|
|
1908
|
+
* // Before running the sample:
|
|
1909
|
+
* // - Enable the API at:
|
|
1910
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1911
|
+
* // - Login into gcloud by running:
|
|
1912
|
+
* // ```sh
|
|
1913
|
+
* // $ gcloud auth application-default login
|
|
1914
|
+
* // ```
|
|
1915
|
+
* // - Install the npm module by running:
|
|
1916
|
+
* // ```sh
|
|
1917
|
+
* // $ npm install googleapis
|
|
1918
|
+
* // ```
|
|
1919
|
+
*
|
|
1920
|
+
* const {google} = require('googleapis');
|
|
1921
|
+
* const securityposture = google.securityposture('v1');
|
|
1922
|
+
*
|
|
1923
|
+
* async function main() {
|
|
1924
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1925
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1926
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1927
|
+
* });
|
|
1928
|
+
*
|
|
1929
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1930
|
+
* const authClient = await auth.getClient();
|
|
1931
|
+
* google.options({auth: authClient});
|
|
1932
|
+
*
|
|
1933
|
+
* // Do the magic
|
|
1934
|
+
* const res = await securityposture.organizations.locations.postures.get({
|
|
1935
|
+
* // Required. The name of the Posture, in the format `organizations/{organization\}/locations/global/postures/{posture_id\}`.
|
|
1936
|
+
* name: 'organizations/my-organization/locations/my-location/postures/my-posture',
|
|
1937
|
+
* // Optional. The posture revision to retrieve. If not specified, the most recently updated revision is retrieved.
|
|
1938
|
+
* revisionId: 'placeholder-value',
|
|
1939
|
+
* });
|
|
1940
|
+
* console.log(res.data);
|
|
1941
|
+
*
|
|
1942
|
+
* // Example response
|
|
1943
|
+
* // {
|
|
1944
|
+
* // "annotations": {},
|
|
1945
|
+
* // "categories": [],
|
|
1946
|
+
* // "createTime": "my_createTime",
|
|
1947
|
+
* // "description": "my_description",
|
|
1948
|
+
* // "etag": "my_etag",
|
|
1949
|
+
* // "name": "my_name",
|
|
1950
|
+
* // "policySets": [],
|
|
1951
|
+
* // "reconciling": false,
|
|
1952
|
+
* // "revisionId": "my_revisionId",
|
|
1953
|
+
* // "state": "my_state",
|
|
1954
|
+
* // "updateTime": "my_updateTime"
|
|
1955
|
+
* // }
|
|
1956
|
+
* }
|
|
1957
|
+
*
|
|
1958
|
+
* main().catch(e => {
|
|
1959
|
+
* console.error(e);
|
|
1960
|
+
* throw e;
|
|
1961
|
+
* });
|
|
1962
|
+
*
|
|
1963
|
+
* ```
|
|
1210
1964
|
*
|
|
1211
1965
|
* @param params - Parameters for request
|
|
1212
1966
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1221,6 +1975,60 @@ export declare namespace securityposture_v1 {
|
|
|
1221
1975
|
get(callback: BodyResponseCallback<Schema$Posture>): void;
|
|
1222
1976
|
/**
|
|
1223
1977
|
* Lists the most recent revisions of all Posture resources in a specified organization and location.
|
|
1978
|
+
* @example
|
|
1979
|
+
* ```js
|
|
1980
|
+
* // Before running the sample:
|
|
1981
|
+
* // - Enable the API at:
|
|
1982
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1983
|
+
* // - Login into gcloud by running:
|
|
1984
|
+
* // ```sh
|
|
1985
|
+
* // $ gcloud auth application-default login
|
|
1986
|
+
* // ```
|
|
1987
|
+
* // - Install the npm module by running:
|
|
1988
|
+
* // ```sh
|
|
1989
|
+
* // $ npm install googleapis
|
|
1990
|
+
* // ```
|
|
1991
|
+
*
|
|
1992
|
+
* const {google} = require('googleapis');
|
|
1993
|
+
* const securityposture = google.securityposture('v1');
|
|
1994
|
+
*
|
|
1995
|
+
* async function main() {
|
|
1996
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1997
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1998
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1999
|
+
* });
|
|
2000
|
+
*
|
|
2001
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2002
|
+
* const authClient = await auth.getClient();
|
|
2003
|
+
* google.options({auth: authClient});
|
|
2004
|
+
*
|
|
2005
|
+
* // Do the magic
|
|
2006
|
+
* const res = await securityposture.organizations.locations.postures.list({
|
|
2007
|
+
* // Optional. A filter to apply to the list of postures, in the format defined in [AIP-160: Filtering](https://google.aip.dev/160).
|
|
2008
|
+
* filter: 'placeholder-value',
|
|
2009
|
+
* // The maximum number of postures to return. The default value is `500`. If you exceed the maximum value of `1000`, then the service uses the maximum value.
|
|
2010
|
+
* pageSize: 'placeholder-value',
|
|
2011
|
+
* // A pagination token returned from a previous request to list postures. Provide this token to retrieve the next page of results.
|
|
2012
|
+
* pageToken: 'placeholder-value',
|
|
2013
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
2014
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
2015
|
+
* });
|
|
2016
|
+
* console.log(res.data);
|
|
2017
|
+
*
|
|
2018
|
+
* // Example response
|
|
2019
|
+
* // {
|
|
2020
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
2021
|
+
* // "postures": [],
|
|
2022
|
+
* // "unreachable": []
|
|
2023
|
+
* // }
|
|
2024
|
+
* }
|
|
2025
|
+
*
|
|
2026
|
+
* main().catch(e => {
|
|
2027
|
+
* console.error(e);
|
|
2028
|
+
* throw e;
|
|
2029
|
+
* });
|
|
2030
|
+
*
|
|
2031
|
+
* ```
|
|
1224
2032
|
*
|
|
1225
2033
|
* @param params - Parameters for request
|
|
1226
2034
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1235,6 +2043,58 @@ export declare namespace securityposture_v1 {
|
|
|
1235
2043
|
list(callback: BodyResponseCallback<Schema$ListPosturesResponse>): void;
|
|
1236
2044
|
/**
|
|
1237
2045
|
* Lists all revisions of a single Posture.
|
|
2046
|
+
* @example
|
|
2047
|
+
* ```js
|
|
2048
|
+
* // Before running the sample:
|
|
2049
|
+
* // - Enable the API at:
|
|
2050
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
2051
|
+
* // - Login into gcloud by running:
|
|
2052
|
+
* // ```sh
|
|
2053
|
+
* // $ gcloud auth application-default login
|
|
2054
|
+
* // ```
|
|
2055
|
+
* // - Install the npm module by running:
|
|
2056
|
+
* // ```sh
|
|
2057
|
+
* // $ npm install googleapis
|
|
2058
|
+
* // ```
|
|
2059
|
+
*
|
|
2060
|
+
* const {google} = require('googleapis');
|
|
2061
|
+
* const securityposture = google.securityposture('v1');
|
|
2062
|
+
*
|
|
2063
|
+
* async function main() {
|
|
2064
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2065
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2066
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2067
|
+
* });
|
|
2068
|
+
*
|
|
2069
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2070
|
+
* const authClient = await auth.getClient();
|
|
2071
|
+
* google.options({auth: authClient});
|
|
2072
|
+
*
|
|
2073
|
+
* // Do the magic
|
|
2074
|
+
* const res =
|
|
2075
|
+
* await securityposture.organizations.locations.postures.listRevisions({
|
|
2076
|
+
* // Required. The name of the Posture, in the format `organizations/{organization\}/locations/global/postures/{posture_id\}`.
|
|
2077
|
+
* name: 'organizations/my-organization/locations/my-location/postures/my-posture',
|
|
2078
|
+
* // Optional. The maximum number of posture revisions to return. The default value is `500`. If you exceed the maximum value of `1000`, then the service uses the maximum value.
|
|
2079
|
+
* pageSize: 'placeholder-value',
|
|
2080
|
+
* // Optional. A pagination token from a previous request to list posture revisions. Provide this token to retrieve the next page of results.
|
|
2081
|
+
* pageToken: 'placeholder-value',
|
|
2082
|
+
* });
|
|
2083
|
+
* console.log(res.data);
|
|
2084
|
+
*
|
|
2085
|
+
* // Example response
|
|
2086
|
+
* // {
|
|
2087
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
2088
|
+
* // "revisions": []
|
|
2089
|
+
* // }
|
|
2090
|
+
* }
|
|
2091
|
+
*
|
|
2092
|
+
* main().catch(e => {
|
|
2093
|
+
* console.error(e);
|
|
2094
|
+
* throw e;
|
|
2095
|
+
* });
|
|
2096
|
+
*
|
|
2097
|
+
* ```
|
|
1238
2098
|
*
|
|
1239
2099
|
* @param params - Parameters for request
|
|
1240
2100
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1249,6 +2109,78 @@ export declare namespace securityposture_v1 {
|
|
|
1249
2109
|
listRevisions(callback: BodyResponseCallback<Schema$ListPostureRevisionsResponse>): void;
|
|
1250
2110
|
/**
|
|
1251
2111
|
* Updates a revision of an existing Posture. If the posture revision that you update is currently deployed, then a new revision of the posture is created. To prevent concurrent updates from overwriting each other, always follow the read-modify-write pattern when you update a posture: 1. Call GetPosture to get the current version of the posture. 2. Update the fields in the posture as needed. 3. Call UpdatePosture to update the posture. Ensure that your request includes the `etag` value from the GetPosture response. **Important:** If you omit the `etag` when you call UpdatePosture, then the updated posture unconditionally overwrites the existing posture.
|
|
2112
|
+
* @example
|
|
2113
|
+
* ```js
|
|
2114
|
+
* // Before running the sample:
|
|
2115
|
+
* // - Enable the API at:
|
|
2116
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
2117
|
+
* // - Login into gcloud by running:
|
|
2118
|
+
* // ```sh
|
|
2119
|
+
* // $ gcloud auth application-default login
|
|
2120
|
+
* // ```
|
|
2121
|
+
* // - Install the npm module by running:
|
|
2122
|
+
* // ```sh
|
|
2123
|
+
* // $ npm install googleapis
|
|
2124
|
+
* // ```
|
|
2125
|
+
*
|
|
2126
|
+
* const {google} = require('googleapis');
|
|
2127
|
+
* const securityposture = google.securityposture('v1');
|
|
2128
|
+
*
|
|
2129
|
+
* async function main() {
|
|
2130
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2131
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2132
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2133
|
+
* });
|
|
2134
|
+
*
|
|
2135
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2136
|
+
* const authClient = await auth.getClient();
|
|
2137
|
+
* google.options({auth: authClient});
|
|
2138
|
+
*
|
|
2139
|
+
* // Do the magic
|
|
2140
|
+
* const res = await securityposture.organizations.locations.postures.patch({
|
|
2141
|
+
* // Required. Identifier. The name of the posture, in the format `organizations/{organization\}/locations/global/postures/{posture_id\}`.
|
|
2142
|
+
* name: 'organizations/my-organization/locations/my-location/postures/my-posture',
|
|
2143
|
+
* // Required. The revision ID of the posture to update. If the posture revision that you update is currently deployed, then a new revision of the posture is created.
|
|
2144
|
+
* revisionId: 'placeholder-value',
|
|
2145
|
+
* // Required. The fields in the Posture to update. You can update only the following fields: * Posture.description * Posture.policy_sets * Posture.state
|
|
2146
|
+
* updateMask: 'placeholder-value',
|
|
2147
|
+
*
|
|
2148
|
+
* // Request body metadata
|
|
2149
|
+
* requestBody: {
|
|
2150
|
+
* // request body parameters
|
|
2151
|
+
* // {
|
|
2152
|
+
* // "annotations": {},
|
|
2153
|
+
* // "categories": [],
|
|
2154
|
+
* // "createTime": "my_createTime",
|
|
2155
|
+
* // "description": "my_description",
|
|
2156
|
+
* // "etag": "my_etag",
|
|
2157
|
+
* // "name": "my_name",
|
|
2158
|
+
* // "policySets": [],
|
|
2159
|
+
* // "reconciling": false,
|
|
2160
|
+
* // "revisionId": "my_revisionId",
|
|
2161
|
+
* // "state": "my_state",
|
|
2162
|
+
* // "updateTime": "my_updateTime"
|
|
2163
|
+
* // }
|
|
2164
|
+
* },
|
|
2165
|
+
* });
|
|
2166
|
+
* console.log(res.data);
|
|
2167
|
+
*
|
|
2168
|
+
* // Example response
|
|
2169
|
+
* // {
|
|
2170
|
+
* // "done": false,
|
|
2171
|
+
* // "error": {},
|
|
2172
|
+
* // "metadata": {},
|
|
2173
|
+
* // "name": "my_name",
|
|
2174
|
+
* // "response": {}
|
|
2175
|
+
* // }
|
|
2176
|
+
* }
|
|
2177
|
+
*
|
|
2178
|
+
* main().catch(e => {
|
|
2179
|
+
* console.error(e);
|
|
2180
|
+
* throw e;
|
|
2181
|
+
* });
|
|
2182
|
+
*
|
|
2183
|
+
* ```
|
|
1252
2184
|
*
|
|
1253
2185
|
* @param params - Parameters for request
|
|
1254
2186
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1361,6 +2293,60 @@ export declare namespace securityposture_v1 {
|
|
|
1361
2293
|
constructor(context: APIRequestContext);
|
|
1362
2294
|
/**
|
|
1363
2295
|
* Gets a single revision of a PostureTemplate.
|
|
2296
|
+
* @example
|
|
2297
|
+
* ```js
|
|
2298
|
+
* // Before running the sample:
|
|
2299
|
+
* // - Enable the API at:
|
|
2300
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
2301
|
+
* // - Login into gcloud by running:
|
|
2302
|
+
* // ```sh
|
|
2303
|
+
* // $ gcloud auth application-default login
|
|
2304
|
+
* // ```
|
|
2305
|
+
* // - Install the npm module by running:
|
|
2306
|
+
* // ```sh
|
|
2307
|
+
* // $ npm install googleapis
|
|
2308
|
+
* // ```
|
|
2309
|
+
*
|
|
2310
|
+
* const {google} = require('googleapis');
|
|
2311
|
+
* const securityposture = google.securityposture('v1');
|
|
2312
|
+
*
|
|
2313
|
+
* async function main() {
|
|
2314
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2315
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2316
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2317
|
+
* });
|
|
2318
|
+
*
|
|
2319
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2320
|
+
* const authClient = await auth.getClient();
|
|
2321
|
+
* google.options({auth: authClient});
|
|
2322
|
+
*
|
|
2323
|
+
* // Do the magic
|
|
2324
|
+
* const res =
|
|
2325
|
+
* await securityposture.organizations.locations.postureTemplates.get({
|
|
2326
|
+
* // Required. The name of the PostureTemplate, in the format `organizations/{organization\}/locations/global/postureTemplates/{posture_template\}`.
|
|
2327
|
+
* name: 'organizations/my-organization/locations/my-location/postureTemplates/my-postureTemplate',
|
|
2328
|
+
* // Optional. The posture template revision to retrieve. If not specified, the most recently updated revision is retrieved.
|
|
2329
|
+
* revisionId: 'placeholder-value',
|
|
2330
|
+
* });
|
|
2331
|
+
* console.log(res.data);
|
|
2332
|
+
*
|
|
2333
|
+
* // Example response
|
|
2334
|
+
* // {
|
|
2335
|
+
* // "categories": [],
|
|
2336
|
+
* // "description": "my_description",
|
|
2337
|
+
* // "name": "my_name",
|
|
2338
|
+
* // "policySets": [],
|
|
2339
|
+
* // "revisionId": "my_revisionId",
|
|
2340
|
+
* // "state": "my_state"
|
|
2341
|
+
* // }
|
|
2342
|
+
* }
|
|
2343
|
+
*
|
|
2344
|
+
* main().catch(e => {
|
|
2345
|
+
* console.error(e);
|
|
2346
|
+
* throw e;
|
|
2347
|
+
* });
|
|
2348
|
+
*
|
|
2349
|
+
* ```
|
|
1364
2350
|
*
|
|
1365
2351
|
* @param params - Parameters for request
|
|
1366
2352
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1375,6 +2361,60 @@ export declare namespace securityposture_v1 {
|
|
|
1375
2361
|
get(callback: BodyResponseCallback<Schema$PostureTemplate>): void;
|
|
1376
2362
|
/**
|
|
1377
2363
|
* Lists every PostureTemplate in a given organization and location.
|
|
2364
|
+
* @example
|
|
2365
|
+
* ```js
|
|
2366
|
+
* // Before running the sample:
|
|
2367
|
+
* // - Enable the API at:
|
|
2368
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
2369
|
+
* // - Login into gcloud by running:
|
|
2370
|
+
* // ```sh
|
|
2371
|
+
* // $ gcloud auth application-default login
|
|
2372
|
+
* // ```
|
|
2373
|
+
* // - Install the npm module by running:
|
|
2374
|
+
* // ```sh
|
|
2375
|
+
* // $ npm install googleapis
|
|
2376
|
+
* // ```
|
|
2377
|
+
*
|
|
2378
|
+
* const {google} = require('googleapis');
|
|
2379
|
+
* const securityposture = google.securityposture('v1');
|
|
2380
|
+
*
|
|
2381
|
+
* async function main() {
|
|
2382
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2383
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2384
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2385
|
+
* });
|
|
2386
|
+
*
|
|
2387
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2388
|
+
* const authClient = await auth.getClient();
|
|
2389
|
+
* google.options({auth: authClient});
|
|
2390
|
+
*
|
|
2391
|
+
* // Do the magic
|
|
2392
|
+
* const res =
|
|
2393
|
+
* await securityposture.organizations.locations.postureTemplates.list({
|
|
2394
|
+
* // Optional. A filter to apply to the list of postures, in the format defined in [AIP-160: Filtering](https://google.aip.dev/160).
|
|
2395
|
+
* filter: 'placeholder-value',
|
|
2396
|
+
* // Optional. The maximum number of posture templates to return. The default value is `500`. If you exceed the maximum value of `1000`, then the service uses the maximum value.
|
|
2397
|
+
* pageSize: 'placeholder-value',
|
|
2398
|
+
* // Optional. A pagination token returned from a previous request to list posture templates. Provide this token to retrieve the next page of results.
|
|
2399
|
+
* pageToken: 'placeholder-value',
|
|
2400
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
2401
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
2402
|
+
* });
|
|
2403
|
+
* console.log(res.data);
|
|
2404
|
+
*
|
|
2405
|
+
* // Example response
|
|
2406
|
+
* // {
|
|
2407
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
2408
|
+
* // "postureTemplates": []
|
|
2409
|
+
* // }
|
|
2410
|
+
* }
|
|
2411
|
+
*
|
|
2412
|
+
* main().catch(e => {
|
|
2413
|
+
* console.error(e);
|
|
2414
|
+
* throw e;
|
|
2415
|
+
* });
|
|
2416
|
+
*
|
|
2417
|
+
* ```
|
|
1378
2418
|
*
|
|
1379
2419
|
* @param params - Parameters for request
|
|
1380
2420
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1421,6 +2461,67 @@ export declare namespace securityposture_v1 {
|
|
|
1421
2461
|
constructor(context: APIRequestContext);
|
|
1422
2462
|
/**
|
|
1423
2463
|
* Validates a specified infrastructure-as-code (IaC) configuration, and creates a Report with the validation results. Only Terraform configurations are supported. Only modified assets are validated.
|
|
2464
|
+
* @example
|
|
2465
|
+
* ```js
|
|
2466
|
+
* // Before running the sample:
|
|
2467
|
+
* // - Enable the API at:
|
|
2468
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
2469
|
+
* // - Login into gcloud by running:
|
|
2470
|
+
* // ```sh
|
|
2471
|
+
* // $ gcloud auth application-default login
|
|
2472
|
+
* // ```
|
|
2473
|
+
* // - Install the npm module by running:
|
|
2474
|
+
* // ```sh
|
|
2475
|
+
* // $ npm install googleapis
|
|
2476
|
+
* // ```
|
|
2477
|
+
*
|
|
2478
|
+
* const {google} = require('googleapis');
|
|
2479
|
+
* const securityposture = google.securityposture('v1');
|
|
2480
|
+
*
|
|
2481
|
+
* async function main() {
|
|
2482
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2483
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2484
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2485
|
+
* });
|
|
2486
|
+
*
|
|
2487
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2488
|
+
* const authClient = await auth.getClient();
|
|
2489
|
+
* google.options({auth: authClient});
|
|
2490
|
+
*
|
|
2491
|
+
* // Do the magic
|
|
2492
|
+
* const res =
|
|
2493
|
+
* await securityposture.organizations.locations.reports.createIaCValidationReport(
|
|
2494
|
+
* {
|
|
2495
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
2496
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
2497
|
+
*
|
|
2498
|
+
* // Request body metadata
|
|
2499
|
+
* requestBody: {
|
|
2500
|
+
* // request body parameters
|
|
2501
|
+
* // {
|
|
2502
|
+
* // "iac": {}
|
|
2503
|
+
* // }
|
|
2504
|
+
* },
|
|
2505
|
+
* },
|
|
2506
|
+
* );
|
|
2507
|
+
* console.log(res.data);
|
|
2508
|
+
*
|
|
2509
|
+
* // Example response
|
|
2510
|
+
* // {
|
|
2511
|
+
* // "done": false,
|
|
2512
|
+
* // "error": {},
|
|
2513
|
+
* // "metadata": {},
|
|
2514
|
+
* // "name": "my_name",
|
|
2515
|
+
* // "response": {}
|
|
2516
|
+
* // }
|
|
2517
|
+
* }
|
|
2518
|
+
*
|
|
2519
|
+
* main().catch(e => {
|
|
2520
|
+
* console.error(e);
|
|
2521
|
+
* throw e;
|
|
2522
|
+
* });
|
|
2523
|
+
*
|
|
2524
|
+
* ```
|
|
1424
2525
|
*
|
|
1425
2526
|
* @param params - Parameters for request
|
|
1426
2527
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1435,6 +2536,55 @@ export declare namespace securityposture_v1 {
|
|
|
1435
2536
|
createIaCValidationReport(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1436
2537
|
/**
|
|
1437
2538
|
* Gets details for a Report.
|
|
2539
|
+
* @example
|
|
2540
|
+
* ```js
|
|
2541
|
+
* // Before running the sample:
|
|
2542
|
+
* // - Enable the API at:
|
|
2543
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
2544
|
+
* // - Login into gcloud by running:
|
|
2545
|
+
* // ```sh
|
|
2546
|
+
* // $ gcloud auth application-default login
|
|
2547
|
+
* // ```
|
|
2548
|
+
* // - Install the npm module by running:
|
|
2549
|
+
* // ```sh
|
|
2550
|
+
* // $ npm install googleapis
|
|
2551
|
+
* // ```
|
|
2552
|
+
*
|
|
2553
|
+
* const {google} = require('googleapis');
|
|
2554
|
+
* const securityposture = google.securityposture('v1');
|
|
2555
|
+
*
|
|
2556
|
+
* async function main() {
|
|
2557
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2558
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2559
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2560
|
+
* });
|
|
2561
|
+
*
|
|
2562
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2563
|
+
* const authClient = await auth.getClient();
|
|
2564
|
+
* google.options({auth: authClient});
|
|
2565
|
+
*
|
|
2566
|
+
* // Do the magic
|
|
2567
|
+
* const res = await securityposture.organizations.locations.reports.get({
|
|
2568
|
+
* // Required. The name of the report, in the format `organizations/{organization\}/locations/global/reports/{report_id\}`.
|
|
2569
|
+
* name: 'organizations/my-organization/locations/my-location/reports/my-report',
|
|
2570
|
+
* });
|
|
2571
|
+
* console.log(res.data);
|
|
2572
|
+
*
|
|
2573
|
+
* // Example response
|
|
2574
|
+
* // {
|
|
2575
|
+
* // "createTime": "my_createTime",
|
|
2576
|
+
* // "iacValidationReport": {},
|
|
2577
|
+
* // "name": "my_name",
|
|
2578
|
+
* // "updateTime": "my_updateTime"
|
|
2579
|
+
* // }
|
|
2580
|
+
* }
|
|
2581
|
+
*
|
|
2582
|
+
* main().catch(e => {
|
|
2583
|
+
* console.error(e);
|
|
2584
|
+
* throw e;
|
|
2585
|
+
* });
|
|
2586
|
+
*
|
|
2587
|
+
* ```
|
|
1438
2588
|
*
|
|
1439
2589
|
* @param params - Parameters for request
|
|
1440
2590
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1449,6 +2599,60 @@ export declare namespace securityposture_v1 {
|
|
|
1449
2599
|
get(callback: BodyResponseCallback<Schema$Report>): void;
|
|
1450
2600
|
/**
|
|
1451
2601
|
* Lists every Report in a given organization and location.
|
|
2602
|
+
* @example
|
|
2603
|
+
* ```js
|
|
2604
|
+
* // Before running the sample:
|
|
2605
|
+
* // - Enable the API at:
|
|
2606
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
2607
|
+
* // - Login into gcloud by running:
|
|
2608
|
+
* // ```sh
|
|
2609
|
+
* // $ gcloud auth application-default login
|
|
2610
|
+
* // ```
|
|
2611
|
+
* // - Install the npm module by running:
|
|
2612
|
+
* // ```sh
|
|
2613
|
+
* // $ npm install googleapis
|
|
2614
|
+
* // ```
|
|
2615
|
+
*
|
|
2616
|
+
* const {google} = require('googleapis');
|
|
2617
|
+
* const securityposture = google.securityposture('v1');
|
|
2618
|
+
*
|
|
2619
|
+
* async function main() {
|
|
2620
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2621
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2622
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2623
|
+
* });
|
|
2624
|
+
*
|
|
2625
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2626
|
+
* const authClient = await auth.getClient();
|
|
2627
|
+
* google.options({auth: authClient});
|
|
2628
|
+
*
|
|
2629
|
+
* // Do the magic
|
|
2630
|
+
* const res = await securityposture.organizations.locations.reports.list({
|
|
2631
|
+
* // Optional. A filter to apply to the list of reports, in the format defined in [AIP-160: Filtering](https://google.aip.dev/160).
|
|
2632
|
+
* filter: 'placeholder-value',
|
|
2633
|
+
* // Optional. The maximum number of reports to return. The default value is `500`. If you exceed the maximum value of `1000`, then the service uses the maximum value.
|
|
2634
|
+
* pageSize: 'placeholder-value',
|
|
2635
|
+
* // Optional. A pagination token returned from a previous request to list reports. Provide this token to retrieve the next page of results.
|
|
2636
|
+
* pageToken: 'placeholder-value',
|
|
2637
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
2638
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
2639
|
+
* });
|
|
2640
|
+
* console.log(res.data);
|
|
2641
|
+
*
|
|
2642
|
+
* // Example response
|
|
2643
|
+
* // {
|
|
2644
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
2645
|
+
* // "reports": [],
|
|
2646
|
+
* // "unreachable": []
|
|
2647
|
+
* // }
|
|
2648
|
+
* }
|
|
2649
|
+
*
|
|
2650
|
+
* main().catch(e => {
|
|
2651
|
+
* console.error(e);
|
|
2652
|
+
* throw e;
|
|
2653
|
+
* });
|
|
2654
|
+
*
|
|
2655
|
+
* ```
|
|
1452
2656
|
*
|
|
1453
2657
|
* @param params - Parameters for request
|
|
1454
2658
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1506,6 +2710,56 @@ export declare namespace securityposture_v1 {
|
|
|
1506
2710
|
constructor(context: APIRequestContext);
|
|
1507
2711
|
/**
|
|
1508
2712
|
* Gets information about a location.
|
|
2713
|
+
* @example
|
|
2714
|
+
* ```js
|
|
2715
|
+
* // Before running the sample:
|
|
2716
|
+
* // - Enable the API at:
|
|
2717
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
2718
|
+
* // - Login into gcloud by running:
|
|
2719
|
+
* // ```sh
|
|
2720
|
+
* // $ gcloud auth application-default login
|
|
2721
|
+
* // ```
|
|
2722
|
+
* // - Install the npm module by running:
|
|
2723
|
+
* // ```sh
|
|
2724
|
+
* // $ npm install googleapis
|
|
2725
|
+
* // ```
|
|
2726
|
+
*
|
|
2727
|
+
* const {google} = require('googleapis');
|
|
2728
|
+
* const securityposture = google.securityposture('v1');
|
|
2729
|
+
*
|
|
2730
|
+
* async function main() {
|
|
2731
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2732
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2733
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2734
|
+
* });
|
|
2735
|
+
*
|
|
2736
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2737
|
+
* const authClient = await auth.getClient();
|
|
2738
|
+
* google.options({auth: authClient});
|
|
2739
|
+
*
|
|
2740
|
+
* // Do the magic
|
|
2741
|
+
* const res = await securityposture.projects.locations.get({
|
|
2742
|
+
* // Resource name for the location.
|
|
2743
|
+
* name: 'projects/my-project/locations/my-location',
|
|
2744
|
+
* });
|
|
2745
|
+
* console.log(res.data);
|
|
2746
|
+
*
|
|
2747
|
+
* // Example response
|
|
2748
|
+
* // {
|
|
2749
|
+
* // "displayName": "my_displayName",
|
|
2750
|
+
* // "labels": {},
|
|
2751
|
+
* // "locationId": "my_locationId",
|
|
2752
|
+
* // "metadata": {},
|
|
2753
|
+
* // "name": "my_name"
|
|
2754
|
+
* // }
|
|
2755
|
+
* }
|
|
2756
|
+
*
|
|
2757
|
+
* main().catch(e => {
|
|
2758
|
+
* console.error(e);
|
|
2759
|
+
* throw e;
|
|
2760
|
+
* });
|
|
2761
|
+
*
|
|
2762
|
+
* ```
|
|
1509
2763
|
*
|
|
1510
2764
|
* @param params - Parameters for request
|
|
1511
2765
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1520,6 +2774,61 @@ export declare namespace securityposture_v1 {
|
|
|
1520
2774
|
get(callback: BodyResponseCallback<Schema$Location>): void;
|
|
1521
2775
|
/**
|
|
1522
2776
|
* Lists information about the supported locations for this service.
|
|
2777
|
+
* @example
|
|
2778
|
+
* ```js
|
|
2779
|
+
* // Before running the sample:
|
|
2780
|
+
* // - Enable the API at:
|
|
2781
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
2782
|
+
* // - Login into gcloud by running:
|
|
2783
|
+
* // ```sh
|
|
2784
|
+
* // $ gcloud auth application-default login
|
|
2785
|
+
* // ```
|
|
2786
|
+
* // - Install the npm module by running:
|
|
2787
|
+
* // ```sh
|
|
2788
|
+
* // $ npm install googleapis
|
|
2789
|
+
* // ```
|
|
2790
|
+
*
|
|
2791
|
+
* const {google} = require('googleapis');
|
|
2792
|
+
* const securityposture = google.securityposture('v1');
|
|
2793
|
+
*
|
|
2794
|
+
* async function main() {
|
|
2795
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2796
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2797
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2798
|
+
* });
|
|
2799
|
+
*
|
|
2800
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2801
|
+
* const authClient = await auth.getClient();
|
|
2802
|
+
* google.options({auth: authClient});
|
|
2803
|
+
*
|
|
2804
|
+
* // Do the magic
|
|
2805
|
+
* const res = await securityposture.projects.locations.list({
|
|
2806
|
+
* // Optional. Do not use this field. It is unsupported and is ignored unless explicitly documented otherwise. This is primarily for internal usage.
|
|
2807
|
+
* extraLocationTypes: 'placeholder-value',
|
|
2808
|
+
* // A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).
|
|
2809
|
+
* filter: 'placeholder-value',
|
|
2810
|
+
* // The resource that owns the locations collection, if applicable.
|
|
2811
|
+
* name: 'projects/my-project',
|
|
2812
|
+
* // The maximum number of results to return. If not set, the service selects a default.
|
|
2813
|
+
* pageSize: 'placeholder-value',
|
|
2814
|
+
* // A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
|
|
2815
|
+
* pageToken: 'placeholder-value',
|
|
2816
|
+
* });
|
|
2817
|
+
* console.log(res.data);
|
|
2818
|
+
*
|
|
2819
|
+
* // Example response
|
|
2820
|
+
* // {
|
|
2821
|
+
* // "locations": [],
|
|
2822
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
2823
|
+
* // }
|
|
2824
|
+
* }
|
|
2825
|
+
*
|
|
2826
|
+
* main().catch(e => {
|
|
2827
|
+
* console.error(e);
|
|
2828
|
+
* throw e;
|
|
2829
|
+
* });
|
|
2830
|
+
*
|
|
2831
|
+
* ```
|
|
1523
2832
|
*
|
|
1524
2833
|
* @param params - Parameters for request
|
|
1525
2834
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1540,6 +2849,10 @@ export declare namespace securityposture_v1 {
|
|
|
1540
2849
|
name?: string;
|
|
1541
2850
|
}
|
|
1542
2851
|
export interface Params$Resource$Projects$Locations$List extends StandardParameters {
|
|
2852
|
+
/**
|
|
2853
|
+
* Optional. Do not use this field. It is unsupported and is ignored unless explicitly documented otherwise. This is primarily for internal usage.
|
|
2854
|
+
*/
|
|
2855
|
+
extraLocationTypes?: string[];
|
|
1543
2856
|
/**
|
|
1544
2857
|
* A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).
|
|
1545
2858
|
*/
|