@googleapis/securityposture 1.0.1 → 2.1.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 +29 -0
- package/build/v1.d.ts +1314 -0
- package/build/v1.js.map +1 -1
- package/package.json +1 -1
- package/v1.ts +1314 -0
package/v1.ts
CHANGED
|
@@ -987,6 +987,56 @@ export namespace securityposture_v1 {
|
|
|
987
987
|
|
|
988
988
|
/**
|
|
989
989
|
* 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`.
|
|
990
|
+
* @example
|
|
991
|
+
* ```js
|
|
992
|
+
* // Before running the sample:
|
|
993
|
+
* // - Enable the API at:
|
|
994
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
995
|
+
* // - Login into gcloud by running:
|
|
996
|
+
* // ```sh
|
|
997
|
+
* // $ gcloud auth application-default login
|
|
998
|
+
* // ```
|
|
999
|
+
* // - Install the npm module by running:
|
|
1000
|
+
* // ```sh
|
|
1001
|
+
* // $ npm install googleapis
|
|
1002
|
+
* // ```
|
|
1003
|
+
*
|
|
1004
|
+
* const {google} = require('googleapis');
|
|
1005
|
+
* const securityposture = google.securityposture('v1');
|
|
1006
|
+
*
|
|
1007
|
+
* async function main() {
|
|
1008
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1009
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1010
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1011
|
+
* });
|
|
1012
|
+
*
|
|
1013
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1014
|
+
* const authClient = await auth.getClient();
|
|
1015
|
+
* google.options({auth: authClient});
|
|
1016
|
+
*
|
|
1017
|
+
* // Do the magic
|
|
1018
|
+
* const res = await securityposture.organizations.locations.operations.cancel({
|
|
1019
|
+
* // The name of the operation resource to be cancelled.
|
|
1020
|
+
* name: 'organizations/my-organization/locations/my-location/operations/my-operation',
|
|
1021
|
+
*
|
|
1022
|
+
* // Request body metadata
|
|
1023
|
+
* requestBody: {
|
|
1024
|
+
* // request body parameters
|
|
1025
|
+
* // {}
|
|
1026
|
+
* },
|
|
1027
|
+
* });
|
|
1028
|
+
* console.log(res.data);
|
|
1029
|
+
*
|
|
1030
|
+
* // Example response
|
|
1031
|
+
* // {}
|
|
1032
|
+
* }
|
|
1033
|
+
*
|
|
1034
|
+
* main().catch(e => {
|
|
1035
|
+
* console.error(e);
|
|
1036
|
+
* throw e;
|
|
1037
|
+
* });
|
|
1038
|
+
*
|
|
1039
|
+
* ```
|
|
990
1040
|
*
|
|
991
1041
|
* @param params - Parameters for request
|
|
992
1042
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1077,6 +1127,50 @@ export namespace securityposture_v1 {
|
|
|
1077
1127
|
|
|
1078
1128
|
/**
|
|
1079
1129
|
* 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`.
|
|
1130
|
+
* @example
|
|
1131
|
+
* ```js
|
|
1132
|
+
* // Before running the sample:
|
|
1133
|
+
* // - Enable the API at:
|
|
1134
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1135
|
+
* // - Login into gcloud by running:
|
|
1136
|
+
* // ```sh
|
|
1137
|
+
* // $ gcloud auth application-default login
|
|
1138
|
+
* // ```
|
|
1139
|
+
* // - Install the npm module by running:
|
|
1140
|
+
* // ```sh
|
|
1141
|
+
* // $ npm install googleapis
|
|
1142
|
+
* // ```
|
|
1143
|
+
*
|
|
1144
|
+
* const {google} = require('googleapis');
|
|
1145
|
+
* const securityposture = google.securityposture('v1');
|
|
1146
|
+
*
|
|
1147
|
+
* async function main() {
|
|
1148
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1149
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1150
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1151
|
+
* });
|
|
1152
|
+
*
|
|
1153
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1154
|
+
* const authClient = await auth.getClient();
|
|
1155
|
+
* google.options({auth: authClient});
|
|
1156
|
+
*
|
|
1157
|
+
* // Do the magic
|
|
1158
|
+
* const res = await securityposture.organizations.locations.operations.delete({
|
|
1159
|
+
* // The name of the operation resource to be deleted.
|
|
1160
|
+
* name: 'organizations/my-organization/locations/my-location/operations/my-operation',
|
|
1161
|
+
* });
|
|
1162
|
+
* console.log(res.data);
|
|
1163
|
+
*
|
|
1164
|
+
* // Example response
|
|
1165
|
+
* // {}
|
|
1166
|
+
* }
|
|
1167
|
+
*
|
|
1168
|
+
* main().catch(e => {
|
|
1169
|
+
* console.error(e);
|
|
1170
|
+
* throw e;
|
|
1171
|
+
* });
|
|
1172
|
+
*
|
|
1173
|
+
* ```
|
|
1080
1174
|
*
|
|
1081
1175
|
* @param params - Parameters for request
|
|
1082
1176
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1167,6 +1261,56 @@ export namespace securityposture_v1 {
|
|
|
1167
1261
|
|
|
1168
1262
|
/**
|
|
1169
1263
|
* 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.
|
|
1264
|
+
* @example
|
|
1265
|
+
* ```js
|
|
1266
|
+
* // Before running the sample:
|
|
1267
|
+
* // - Enable the API at:
|
|
1268
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1269
|
+
* // - Login into gcloud by running:
|
|
1270
|
+
* // ```sh
|
|
1271
|
+
* // $ gcloud auth application-default login
|
|
1272
|
+
* // ```
|
|
1273
|
+
* // - Install the npm module by running:
|
|
1274
|
+
* // ```sh
|
|
1275
|
+
* // $ npm install googleapis
|
|
1276
|
+
* // ```
|
|
1277
|
+
*
|
|
1278
|
+
* const {google} = require('googleapis');
|
|
1279
|
+
* const securityposture = google.securityposture('v1');
|
|
1280
|
+
*
|
|
1281
|
+
* async function main() {
|
|
1282
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1283
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1284
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1285
|
+
* });
|
|
1286
|
+
*
|
|
1287
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1288
|
+
* const authClient = await auth.getClient();
|
|
1289
|
+
* google.options({auth: authClient});
|
|
1290
|
+
*
|
|
1291
|
+
* // Do the magic
|
|
1292
|
+
* const res = await securityposture.organizations.locations.operations.get({
|
|
1293
|
+
* // The name of the operation resource.
|
|
1294
|
+
* name: 'organizations/my-organization/locations/my-location/operations/my-operation',
|
|
1295
|
+
* });
|
|
1296
|
+
* console.log(res.data);
|
|
1297
|
+
*
|
|
1298
|
+
* // Example response
|
|
1299
|
+
* // {
|
|
1300
|
+
* // "done": false,
|
|
1301
|
+
* // "error": {},
|
|
1302
|
+
* // "metadata": {},
|
|
1303
|
+
* // "name": "my_name",
|
|
1304
|
+
* // "response": {}
|
|
1305
|
+
* // }
|
|
1306
|
+
* }
|
|
1307
|
+
*
|
|
1308
|
+
* main().catch(e => {
|
|
1309
|
+
* console.error(e);
|
|
1310
|
+
* throw e;
|
|
1311
|
+
* });
|
|
1312
|
+
*
|
|
1313
|
+
* ```
|
|
1170
1314
|
*
|
|
1171
1315
|
* @param params - Parameters for request
|
|
1172
1316
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1256,6 +1400,59 @@ export namespace securityposture_v1 {
|
|
|
1256
1400
|
|
|
1257
1401
|
/**
|
|
1258
1402
|
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
|
|
1403
|
+
* @example
|
|
1404
|
+
* ```js
|
|
1405
|
+
* // Before running the sample:
|
|
1406
|
+
* // - Enable the API at:
|
|
1407
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1408
|
+
* // - Login into gcloud by running:
|
|
1409
|
+
* // ```sh
|
|
1410
|
+
* // $ gcloud auth application-default login
|
|
1411
|
+
* // ```
|
|
1412
|
+
* // - Install the npm module by running:
|
|
1413
|
+
* // ```sh
|
|
1414
|
+
* // $ npm install googleapis
|
|
1415
|
+
* // ```
|
|
1416
|
+
*
|
|
1417
|
+
* const {google} = require('googleapis');
|
|
1418
|
+
* const securityposture = google.securityposture('v1');
|
|
1419
|
+
*
|
|
1420
|
+
* async function main() {
|
|
1421
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1422
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1423
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1424
|
+
* });
|
|
1425
|
+
*
|
|
1426
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1427
|
+
* const authClient = await auth.getClient();
|
|
1428
|
+
* google.options({auth: authClient});
|
|
1429
|
+
*
|
|
1430
|
+
* // Do the magic
|
|
1431
|
+
* const res = await securityposture.organizations.locations.operations.list({
|
|
1432
|
+
* // The standard list filter.
|
|
1433
|
+
* filter: 'placeholder-value',
|
|
1434
|
+
* // The name of the operation's parent resource.
|
|
1435
|
+
* name: 'organizations/my-organization/locations/my-location',
|
|
1436
|
+
* // The standard list page size.
|
|
1437
|
+
* pageSize: 'placeholder-value',
|
|
1438
|
+
* // The standard list page token.
|
|
1439
|
+
* pageToken: 'placeholder-value',
|
|
1440
|
+
* });
|
|
1441
|
+
* console.log(res.data);
|
|
1442
|
+
*
|
|
1443
|
+
* // Example response
|
|
1444
|
+
* // {
|
|
1445
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
1446
|
+
* // "operations": []
|
|
1447
|
+
* // }
|
|
1448
|
+
* }
|
|
1449
|
+
*
|
|
1450
|
+
* main().catch(e => {
|
|
1451
|
+
* console.error(e);
|
|
1452
|
+
* throw e;
|
|
1453
|
+
* });
|
|
1454
|
+
*
|
|
1455
|
+
* ```
|
|
1259
1456
|
*
|
|
1260
1457
|
* @param params - Parameters for request
|
|
1261
1458
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1403,6 +1600,81 @@ export namespace securityposture_v1 {
|
|
|
1403
1600
|
|
|
1404
1601
|
/**
|
|
1405
1602
|
* Creates a new PostureDeployment in a given project and location.
|
|
1603
|
+
* @example
|
|
1604
|
+
* ```js
|
|
1605
|
+
* // Before running the sample:
|
|
1606
|
+
* // - Enable the API at:
|
|
1607
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1608
|
+
* // - Login into gcloud by running:
|
|
1609
|
+
* // ```sh
|
|
1610
|
+
* // $ gcloud auth application-default login
|
|
1611
|
+
* // ```
|
|
1612
|
+
* // - Install the npm module by running:
|
|
1613
|
+
* // ```sh
|
|
1614
|
+
* // $ npm install googleapis
|
|
1615
|
+
* // ```
|
|
1616
|
+
*
|
|
1617
|
+
* const {google} = require('googleapis');
|
|
1618
|
+
* const securityposture = google.securityposture('v1');
|
|
1619
|
+
*
|
|
1620
|
+
* async function main() {
|
|
1621
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1622
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1623
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1624
|
+
* });
|
|
1625
|
+
*
|
|
1626
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1627
|
+
* const authClient = await auth.getClient();
|
|
1628
|
+
* google.options({auth: authClient});
|
|
1629
|
+
*
|
|
1630
|
+
* // Do the magic
|
|
1631
|
+
* const res =
|
|
1632
|
+
* await securityposture.organizations.locations.postureDeployments.create({
|
|
1633
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
1634
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
1635
|
+
* // Required. An identifier for the posture deployment.
|
|
1636
|
+
* postureDeploymentId: 'placeholder-value',
|
|
1637
|
+
*
|
|
1638
|
+
* // Request body metadata
|
|
1639
|
+
* requestBody: {
|
|
1640
|
+
* // request body parameters
|
|
1641
|
+
* // {
|
|
1642
|
+
* // "annotations": {},
|
|
1643
|
+
* // "categories": [],
|
|
1644
|
+
* // "createTime": "my_createTime",
|
|
1645
|
+
* // "description": "my_description",
|
|
1646
|
+
* // "desiredPostureId": "my_desiredPostureId",
|
|
1647
|
+
* // "desiredPostureRevisionId": "my_desiredPostureRevisionId",
|
|
1648
|
+
* // "etag": "my_etag",
|
|
1649
|
+
* // "failureMessage": "my_failureMessage",
|
|
1650
|
+
* // "name": "my_name",
|
|
1651
|
+
* // "postureId": "my_postureId",
|
|
1652
|
+
* // "postureRevisionId": "my_postureRevisionId",
|
|
1653
|
+
* // "reconciling": false,
|
|
1654
|
+
* // "state": "my_state",
|
|
1655
|
+
* // "targetResource": "my_targetResource",
|
|
1656
|
+
* // "updateTime": "my_updateTime"
|
|
1657
|
+
* // }
|
|
1658
|
+
* },
|
|
1659
|
+
* });
|
|
1660
|
+
* console.log(res.data);
|
|
1661
|
+
*
|
|
1662
|
+
* // Example response
|
|
1663
|
+
* // {
|
|
1664
|
+
* // "done": false,
|
|
1665
|
+
* // "error": {},
|
|
1666
|
+
* // "metadata": {},
|
|
1667
|
+
* // "name": "my_name",
|
|
1668
|
+
* // "response": {}
|
|
1669
|
+
* // }
|
|
1670
|
+
* }
|
|
1671
|
+
*
|
|
1672
|
+
* main().catch(e => {
|
|
1673
|
+
* console.error(e);
|
|
1674
|
+
* throw e;
|
|
1675
|
+
* });
|
|
1676
|
+
*
|
|
1677
|
+
* ```
|
|
1406
1678
|
*
|
|
1407
1679
|
* @param params - Parameters for request
|
|
1408
1680
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1496,6 +1768,59 @@ export namespace securityposture_v1 {
|
|
|
1496
1768
|
|
|
1497
1769
|
/**
|
|
1498
1770
|
* Deletes a PostureDeployment.
|
|
1771
|
+
* @example
|
|
1772
|
+
* ```js
|
|
1773
|
+
* // Before running the sample:
|
|
1774
|
+
* // - Enable the API at:
|
|
1775
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1776
|
+
* // - Login into gcloud by running:
|
|
1777
|
+
* // ```sh
|
|
1778
|
+
* // $ gcloud auth application-default login
|
|
1779
|
+
* // ```
|
|
1780
|
+
* // - Install the npm module by running:
|
|
1781
|
+
* // ```sh
|
|
1782
|
+
* // $ npm install googleapis
|
|
1783
|
+
* // ```
|
|
1784
|
+
*
|
|
1785
|
+
* const {google} = require('googleapis');
|
|
1786
|
+
* const securityposture = google.securityposture('v1');
|
|
1787
|
+
*
|
|
1788
|
+
* async function main() {
|
|
1789
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1790
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1791
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1792
|
+
* });
|
|
1793
|
+
*
|
|
1794
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1795
|
+
* const authClient = await auth.getClient();
|
|
1796
|
+
* google.options({auth: authClient});
|
|
1797
|
+
*
|
|
1798
|
+
* // Do the magic
|
|
1799
|
+
* const res =
|
|
1800
|
+
* await securityposture.organizations.locations.postureDeployments.delete({
|
|
1801
|
+
* // 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.
|
|
1802
|
+
* etag: 'placeholder-value',
|
|
1803
|
+
* // Required. The name of the posture deployment, in the format `organizations/{organization\}/locations/global/postureDeployments/{posture_id\}`.
|
|
1804
|
+
* name: 'organizations/my-organization/locations/my-location/postureDeployments/my-postureDeployment',
|
|
1805
|
+
* });
|
|
1806
|
+
* console.log(res.data);
|
|
1807
|
+
*
|
|
1808
|
+
* // Example response
|
|
1809
|
+
* // {
|
|
1810
|
+
* // "done": false,
|
|
1811
|
+
* // "error": {},
|
|
1812
|
+
* // "metadata": {},
|
|
1813
|
+
* // "name": "my_name",
|
|
1814
|
+
* // "response": {}
|
|
1815
|
+
* // }
|
|
1816
|
+
* }
|
|
1817
|
+
*
|
|
1818
|
+
* main().catch(e => {
|
|
1819
|
+
* console.error(e);
|
|
1820
|
+
* throw e;
|
|
1821
|
+
* });
|
|
1822
|
+
*
|
|
1823
|
+
* ```
|
|
1499
1824
|
*
|
|
1500
1825
|
* @param params - Parameters for request
|
|
1501
1826
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1586,6 +1911,67 @@ export namespace securityposture_v1 {
|
|
|
1586
1911
|
|
|
1587
1912
|
/**
|
|
1588
1913
|
* Gets details for a PostureDeployment.
|
|
1914
|
+
* @example
|
|
1915
|
+
* ```js
|
|
1916
|
+
* // Before running the sample:
|
|
1917
|
+
* // - Enable the API at:
|
|
1918
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
1919
|
+
* // - Login into gcloud by running:
|
|
1920
|
+
* // ```sh
|
|
1921
|
+
* // $ gcloud auth application-default login
|
|
1922
|
+
* // ```
|
|
1923
|
+
* // - Install the npm module by running:
|
|
1924
|
+
* // ```sh
|
|
1925
|
+
* // $ npm install googleapis
|
|
1926
|
+
* // ```
|
|
1927
|
+
*
|
|
1928
|
+
* const {google} = require('googleapis');
|
|
1929
|
+
* const securityposture = google.securityposture('v1');
|
|
1930
|
+
*
|
|
1931
|
+
* async function main() {
|
|
1932
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1933
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1934
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1935
|
+
* });
|
|
1936
|
+
*
|
|
1937
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1938
|
+
* const authClient = await auth.getClient();
|
|
1939
|
+
* google.options({auth: authClient});
|
|
1940
|
+
*
|
|
1941
|
+
* // Do the magic
|
|
1942
|
+
* const res =
|
|
1943
|
+
* await securityposture.organizations.locations.postureDeployments.get({
|
|
1944
|
+
* // Required. The name of the PostureDeployment, in the format `organizations/{organization\}/locations/global/postureDeployments/{posture_deployment_id\}`.
|
|
1945
|
+
* name: 'organizations/my-organization/locations/my-location/postureDeployments/my-postureDeployment',
|
|
1946
|
+
* });
|
|
1947
|
+
* console.log(res.data);
|
|
1948
|
+
*
|
|
1949
|
+
* // Example response
|
|
1950
|
+
* // {
|
|
1951
|
+
* // "annotations": {},
|
|
1952
|
+
* // "categories": [],
|
|
1953
|
+
* // "createTime": "my_createTime",
|
|
1954
|
+
* // "description": "my_description",
|
|
1955
|
+
* // "desiredPostureId": "my_desiredPostureId",
|
|
1956
|
+
* // "desiredPostureRevisionId": "my_desiredPostureRevisionId",
|
|
1957
|
+
* // "etag": "my_etag",
|
|
1958
|
+
* // "failureMessage": "my_failureMessage",
|
|
1959
|
+
* // "name": "my_name",
|
|
1960
|
+
* // "postureId": "my_postureId",
|
|
1961
|
+
* // "postureRevisionId": "my_postureRevisionId",
|
|
1962
|
+
* // "reconciling": false,
|
|
1963
|
+
* // "state": "my_state",
|
|
1964
|
+
* // "targetResource": "my_targetResource",
|
|
1965
|
+
* // "updateTime": "my_updateTime"
|
|
1966
|
+
* // }
|
|
1967
|
+
* }
|
|
1968
|
+
*
|
|
1969
|
+
* main().catch(e => {
|
|
1970
|
+
* console.error(e);
|
|
1971
|
+
* throw e;
|
|
1972
|
+
* });
|
|
1973
|
+
*
|
|
1974
|
+
* ```
|
|
1589
1975
|
*
|
|
1590
1976
|
* @param params - Parameters for request
|
|
1591
1977
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1676,6 +2062,61 @@ export namespace securityposture_v1 {
|
|
|
1676
2062
|
|
|
1677
2063
|
/**
|
|
1678
2064
|
* Lists every PostureDeployment in a project and location.
|
|
2065
|
+
* @example
|
|
2066
|
+
* ```js
|
|
2067
|
+
* // Before running the sample:
|
|
2068
|
+
* // - Enable the API at:
|
|
2069
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
2070
|
+
* // - Login into gcloud by running:
|
|
2071
|
+
* // ```sh
|
|
2072
|
+
* // $ gcloud auth application-default login
|
|
2073
|
+
* // ```
|
|
2074
|
+
* // - Install the npm module by running:
|
|
2075
|
+
* // ```sh
|
|
2076
|
+
* // $ npm install googleapis
|
|
2077
|
+
* // ```
|
|
2078
|
+
*
|
|
2079
|
+
* const {google} = require('googleapis');
|
|
2080
|
+
* const securityposture = google.securityposture('v1');
|
|
2081
|
+
*
|
|
2082
|
+
* async function main() {
|
|
2083
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2084
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2085
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2086
|
+
* });
|
|
2087
|
+
*
|
|
2088
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2089
|
+
* const authClient = await auth.getClient();
|
|
2090
|
+
* google.options({auth: authClient});
|
|
2091
|
+
*
|
|
2092
|
+
* // Do the magic
|
|
2093
|
+
* const res =
|
|
2094
|
+
* await securityposture.organizations.locations.postureDeployments.list({
|
|
2095
|
+
* // Optional. A filter to apply to the list of postures, in the format defined in [AIP-160: Filtering](https://google.aip.dev/160).
|
|
2096
|
+
* filter: 'placeholder-value',
|
|
2097
|
+
* // 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.
|
|
2098
|
+
* pageSize: 'placeholder-value',
|
|
2099
|
+
* // Optional. A pagination token returned from a previous request to list posture deployments. Provide this token to retrieve the next page of results.
|
|
2100
|
+
* pageToken: 'placeholder-value',
|
|
2101
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
2102
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
2103
|
+
* });
|
|
2104
|
+
* console.log(res.data);
|
|
2105
|
+
*
|
|
2106
|
+
* // Example response
|
|
2107
|
+
* // {
|
|
2108
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
2109
|
+
* // "postureDeployments": [],
|
|
2110
|
+
* // "unreachable": []
|
|
2111
|
+
* // }
|
|
2112
|
+
* }
|
|
2113
|
+
*
|
|
2114
|
+
* main().catch(e => {
|
|
2115
|
+
* console.error(e);
|
|
2116
|
+
* throw e;
|
|
2117
|
+
* });
|
|
2118
|
+
*
|
|
2119
|
+
* ```
|
|
1679
2120
|
*
|
|
1680
2121
|
* @param params - Parameters for request
|
|
1681
2122
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1775,6 +2216,81 @@ export namespace securityposture_v1 {
|
|
|
1775
2216
|
|
|
1776
2217
|
/**
|
|
1777
2218
|
* 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.
|
|
2219
|
+
* @example
|
|
2220
|
+
* ```js
|
|
2221
|
+
* // Before running the sample:
|
|
2222
|
+
* // - Enable the API at:
|
|
2223
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
2224
|
+
* // - Login into gcloud by running:
|
|
2225
|
+
* // ```sh
|
|
2226
|
+
* // $ gcloud auth application-default login
|
|
2227
|
+
* // ```
|
|
2228
|
+
* // - Install the npm module by running:
|
|
2229
|
+
* // ```sh
|
|
2230
|
+
* // $ npm install googleapis
|
|
2231
|
+
* // ```
|
|
2232
|
+
*
|
|
2233
|
+
* const {google} = require('googleapis');
|
|
2234
|
+
* const securityposture = google.securityposture('v1');
|
|
2235
|
+
*
|
|
2236
|
+
* async function main() {
|
|
2237
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2238
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2239
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2240
|
+
* });
|
|
2241
|
+
*
|
|
2242
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2243
|
+
* const authClient = await auth.getClient();
|
|
2244
|
+
* google.options({auth: authClient});
|
|
2245
|
+
*
|
|
2246
|
+
* // Do the magic
|
|
2247
|
+
* const res =
|
|
2248
|
+
* await securityposture.organizations.locations.postureDeployments.patch({
|
|
2249
|
+
* // Required. Identifier. The name of the posture deployment, in the format `organizations/{organization\}/locations/global/postureDeployments/{deployment_id\}`.
|
|
2250
|
+
* name: 'organizations/my-organization/locations/my-location/postureDeployments/my-postureDeployment',
|
|
2251
|
+
* // Required. The fields in the PostureDeployment to update. You can update only the following fields: * PostureDeployment.posture_id * PostureDeployment.posture_revision_id
|
|
2252
|
+
* updateMask: 'placeholder-value',
|
|
2253
|
+
*
|
|
2254
|
+
* // Request body metadata
|
|
2255
|
+
* requestBody: {
|
|
2256
|
+
* // request body parameters
|
|
2257
|
+
* // {
|
|
2258
|
+
* // "annotations": {},
|
|
2259
|
+
* // "categories": [],
|
|
2260
|
+
* // "createTime": "my_createTime",
|
|
2261
|
+
* // "description": "my_description",
|
|
2262
|
+
* // "desiredPostureId": "my_desiredPostureId",
|
|
2263
|
+
* // "desiredPostureRevisionId": "my_desiredPostureRevisionId",
|
|
2264
|
+
* // "etag": "my_etag",
|
|
2265
|
+
* // "failureMessage": "my_failureMessage",
|
|
2266
|
+
* // "name": "my_name",
|
|
2267
|
+
* // "postureId": "my_postureId",
|
|
2268
|
+
* // "postureRevisionId": "my_postureRevisionId",
|
|
2269
|
+
* // "reconciling": false,
|
|
2270
|
+
* // "state": "my_state",
|
|
2271
|
+
* // "targetResource": "my_targetResource",
|
|
2272
|
+
* // "updateTime": "my_updateTime"
|
|
2273
|
+
* // }
|
|
2274
|
+
* },
|
|
2275
|
+
* });
|
|
2276
|
+
* console.log(res.data);
|
|
2277
|
+
*
|
|
2278
|
+
* // Example response
|
|
2279
|
+
* // {
|
|
2280
|
+
* // "done": false,
|
|
2281
|
+
* // "error": {},
|
|
2282
|
+
* // "metadata": {},
|
|
2283
|
+
* // "name": "my_name",
|
|
2284
|
+
* // "response": {}
|
|
2285
|
+
* // }
|
|
2286
|
+
* }
|
|
2287
|
+
*
|
|
2288
|
+
* main().catch(e => {
|
|
2289
|
+
* console.error(e);
|
|
2290
|
+
* throw e;
|
|
2291
|
+
* });
|
|
2292
|
+
*
|
|
2293
|
+
* ```
|
|
1778
2294
|
*
|
|
1779
2295
|
* @param params - Parameters for request
|
|
1780
2296
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1942,6 +2458,76 @@ export namespace securityposture_v1 {
|
|
|
1942
2458
|
|
|
1943
2459
|
/**
|
|
1944
2460
|
* Creates a new Posture.
|
|
2461
|
+
* @example
|
|
2462
|
+
* ```js
|
|
2463
|
+
* // Before running the sample:
|
|
2464
|
+
* // - Enable the API at:
|
|
2465
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
2466
|
+
* // - Login into gcloud by running:
|
|
2467
|
+
* // ```sh
|
|
2468
|
+
* // $ gcloud auth application-default login
|
|
2469
|
+
* // ```
|
|
2470
|
+
* // - Install the npm module by running:
|
|
2471
|
+
* // ```sh
|
|
2472
|
+
* // $ npm install googleapis
|
|
2473
|
+
* // ```
|
|
2474
|
+
*
|
|
2475
|
+
* const {google} = require('googleapis');
|
|
2476
|
+
* const securityposture = google.securityposture('v1');
|
|
2477
|
+
*
|
|
2478
|
+
* async function main() {
|
|
2479
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2480
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2481
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2482
|
+
* });
|
|
2483
|
+
*
|
|
2484
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2485
|
+
* const authClient = await auth.getClient();
|
|
2486
|
+
* google.options({auth: authClient});
|
|
2487
|
+
*
|
|
2488
|
+
* // Do the magic
|
|
2489
|
+
* const res = await securityposture.organizations.locations.postures.create({
|
|
2490
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
2491
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
2492
|
+
* // Required. An identifier for the posture.
|
|
2493
|
+
* postureId: 'placeholder-value',
|
|
2494
|
+
*
|
|
2495
|
+
* // Request body metadata
|
|
2496
|
+
* requestBody: {
|
|
2497
|
+
* // request body parameters
|
|
2498
|
+
* // {
|
|
2499
|
+
* // "annotations": {},
|
|
2500
|
+
* // "categories": [],
|
|
2501
|
+
* // "createTime": "my_createTime",
|
|
2502
|
+
* // "description": "my_description",
|
|
2503
|
+
* // "etag": "my_etag",
|
|
2504
|
+
* // "name": "my_name",
|
|
2505
|
+
* // "policySets": [],
|
|
2506
|
+
* // "reconciling": false,
|
|
2507
|
+
* // "revisionId": "my_revisionId",
|
|
2508
|
+
* // "state": "my_state",
|
|
2509
|
+
* // "updateTime": "my_updateTime"
|
|
2510
|
+
* // }
|
|
2511
|
+
* },
|
|
2512
|
+
* });
|
|
2513
|
+
* console.log(res.data);
|
|
2514
|
+
*
|
|
2515
|
+
* // Example response
|
|
2516
|
+
* // {
|
|
2517
|
+
* // "done": false,
|
|
2518
|
+
* // "error": {},
|
|
2519
|
+
* // "metadata": {},
|
|
2520
|
+
* // "name": "my_name",
|
|
2521
|
+
* // "response": {}
|
|
2522
|
+
* // }
|
|
2523
|
+
* }
|
|
2524
|
+
*
|
|
2525
|
+
* main().catch(e => {
|
|
2526
|
+
* console.error(e);
|
|
2527
|
+
* throw e;
|
|
2528
|
+
* });
|
|
2529
|
+
*
|
|
2530
|
+
* ```
|
|
1945
2531
|
*
|
|
1946
2532
|
* @param params - Parameters for request
|
|
1947
2533
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2034,6 +2620,58 @@ export namespace securityposture_v1 {
|
|
|
2034
2620
|
|
|
2035
2621
|
/**
|
|
2036
2622
|
* Deletes all revisions of a Posture. You can only delete a posture if none of its revisions are deployed.
|
|
2623
|
+
* @example
|
|
2624
|
+
* ```js
|
|
2625
|
+
* // Before running the sample:
|
|
2626
|
+
* // - Enable the API at:
|
|
2627
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
2628
|
+
* // - Login into gcloud by running:
|
|
2629
|
+
* // ```sh
|
|
2630
|
+
* // $ gcloud auth application-default login
|
|
2631
|
+
* // ```
|
|
2632
|
+
* // - Install the npm module by running:
|
|
2633
|
+
* // ```sh
|
|
2634
|
+
* // $ npm install googleapis
|
|
2635
|
+
* // ```
|
|
2636
|
+
*
|
|
2637
|
+
* const {google} = require('googleapis');
|
|
2638
|
+
* const securityposture = google.securityposture('v1');
|
|
2639
|
+
*
|
|
2640
|
+
* async function main() {
|
|
2641
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2642
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2643
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2644
|
+
* });
|
|
2645
|
+
*
|
|
2646
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2647
|
+
* const authClient = await auth.getClient();
|
|
2648
|
+
* google.options({auth: authClient});
|
|
2649
|
+
*
|
|
2650
|
+
* // Do the magic
|
|
2651
|
+
* const res = await securityposture.organizations.locations.postures.delete({
|
|
2652
|
+
* // 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.
|
|
2653
|
+
* etag: 'placeholder-value',
|
|
2654
|
+
* // Required. The name of the Posture, in the format `organizations/{organization\}/locations/global/postures/{posture_id\}`.
|
|
2655
|
+
* name: 'organizations/my-organization/locations/my-location/postures/my-posture',
|
|
2656
|
+
* });
|
|
2657
|
+
* console.log(res.data);
|
|
2658
|
+
*
|
|
2659
|
+
* // Example response
|
|
2660
|
+
* // {
|
|
2661
|
+
* // "done": false,
|
|
2662
|
+
* // "error": {},
|
|
2663
|
+
* // "metadata": {},
|
|
2664
|
+
* // "name": "my_name",
|
|
2665
|
+
* // "response": {}
|
|
2666
|
+
* // }
|
|
2667
|
+
* }
|
|
2668
|
+
*
|
|
2669
|
+
* main().catch(e => {
|
|
2670
|
+
* console.error(e);
|
|
2671
|
+
* throw e;
|
|
2672
|
+
* });
|
|
2673
|
+
*
|
|
2674
|
+
* ```
|
|
2037
2675
|
*
|
|
2038
2676
|
* @param params - Parameters for request
|
|
2039
2677
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2123,6 +2761,65 @@ export namespace securityposture_v1 {
|
|
|
2123
2761
|
|
|
2124
2762
|
/**
|
|
2125
2763
|
* 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.
|
|
2764
|
+
* @example
|
|
2765
|
+
* ```js
|
|
2766
|
+
* // Before running the sample:
|
|
2767
|
+
* // - Enable the API at:
|
|
2768
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
2769
|
+
* // - Login into gcloud by running:
|
|
2770
|
+
* // ```sh
|
|
2771
|
+
* // $ gcloud auth application-default login
|
|
2772
|
+
* // ```
|
|
2773
|
+
* // - Install the npm module by running:
|
|
2774
|
+
* // ```sh
|
|
2775
|
+
* // $ npm install googleapis
|
|
2776
|
+
* // ```
|
|
2777
|
+
*
|
|
2778
|
+
* const {google} = require('googleapis');
|
|
2779
|
+
* const securityposture = google.securityposture('v1');
|
|
2780
|
+
*
|
|
2781
|
+
* async function main() {
|
|
2782
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2783
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2784
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2785
|
+
* });
|
|
2786
|
+
*
|
|
2787
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2788
|
+
* const authClient = await auth.getClient();
|
|
2789
|
+
* google.options({auth: authClient});
|
|
2790
|
+
*
|
|
2791
|
+
* // Do the magic
|
|
2792
|
+
* const res = await securityposture.organizations.locations.postures.extract({
|
|
2793
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
2794
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
2795
|
+
*
|
|
2796
|
+
* // Request body metadata
|
|
2797
|
+
* requestBody: {
|
|
2798
|
+
* // request body parameters
|
|
2799
|
+
* // {
|
|
2800
|
+
* // "postureId": "my_postureId",
|
|
2801
|
+
* // "workload": "my_workload"
|
|
2802
|
+
* // }
|
|
2803
|
+
* },
|
|
2804
|
+
* });
|
|
2805
|
+
* console.log(res.data);
|
|
2806
|
+
*
|
|
2807
|
+
* // Example response
|
|
2808
|
+
* // {
|
|
2809
|
+
* // "done": false,
|
|
2810
|
+
* // "error": {},
|
|
2811
|
+
* // "metadata": {},
|
|
2812
|
+
* // "name": "my_name",
|
|
2813
|
+
* // "response": {}
|
|
2814
|
+
* // }
|
|
2815
|
+
* }
|
|
2816
|
+
*
|
|
2817
|
+
* main().catch(e => {
|
|
2818
|
+
* console.error(e);
|
|
2819
|
+
* throw e;
|
|
2820
|
+
* });
|
|
2821
|
+
*
|
|
2822
|
+
* ```
|
|
2126
2823
|
*
|
|
2127
2824
|
* @param params - Parameters for request
|
|
2128
2825
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2215,6 +2912,64 @@ export namespace securityposture_v1 {
|
|
|
2215
2912
|
|
|
2216
2913
|
/**
|
|
2217
2914
|
* Gets a single revision of a Posture.
|
|
2915
|
+
* @example
|
|
2916
|
+
* ```js
|
|
2917
|
+
* // Before running the sample:
|
|
2918
|
+
* // - Enable the API at:
|
|
2919
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
2920
|
+
* // - Login into gcloud by running:
|
|
2921
|
+
* // ```sh
|
|
2922
|
+
* // $ gcloud auth application-default login
|
|
2923
|
+
* // ```
|
|
2924
|
+
* // - Install the npm module by running:
|
|
2925
|
+
* // ```sh
|
|
2926
|
+
* // $ npm install googleapis
|
|
2927
|
+
* // ```
|
|
2928
|
+
*
|
|
2929
|
+
* const {google} = require('googleapis');
|
|
2930
|
+
* const securityposture = google.securityposture('v1');
|
|
2931
|
+
*
|
|
2932
|
+
* async function main() {
|
|
2933
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2934
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2935
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2936
|
+
* });
|
|
2937
|
+
*
|
|
2938
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2939
|
+
* const authClient = await auth.getClient();
|
|
2940
|
+
* google.options({auth: authClient});
|
|
2941
|
+
*
|
|
2942
|
+
* // Do the magic
|
|
2943
|
+
* const res = await securityposture.organizations.locations.postures.get({
|
|
2944
|
+
* // Required. The name of the Posture, in the format `organizations/{organization\}/locations/global/postures/{posture_id\}`.
|
|
2945
|
+
* name: 'organizations/my-organization/locations/my-location/postures/my-posture',
|
|
2946
|
+
* // Optional. The posture revision to retrieve. If not specified, the most recently updated revision is retrieved.
|
|
2947
|
+
* revisionId: 'placeholder-value',
|
|
2948
|
+
* });
|
|
2949
|
+
* console.log(res.data);
|
|
2950
|
+
*
|
|
2951
|
+
* // Example response
|
|
2952
|
+
* // {
|
|
2953
|
+
* // "annotations": {},
|
|
2954
|
+
* // "categories": [],
|
|
2955
|
+
* // "createTime": "my_createTime",
|
|
2956
|
+
* // "description": "my_description",
|
|
2957
|
+
* // "etag": "my_etag",
|
|
2958
|
+
* // "name": "my_name",
|
|
2959
|
+
* // "policySets": [],
|
|
2960
|
+
* // "reconciling": false,
|
|
2961
|
+
* // "revisionId": "my_revisionId",
|
|
2962
|
+
* // "state": "my_state",
|
|
2963
|
+
* // "updateTime": "my_updateTime"
|
|
2964
|
+
* // }
|
|
2965
|
+
* }
|
|
2966
|
+
*
|
|
2967
|
+
* main().catch(e => {
|
|
2968
|
+
* console.error(e);
|
|
2969
|
+
* throw e;
|
|
2970
|
+
* });
|
|
2971
|
+
*
|
|
2972
|
+
* ```
|
|
2218
2973
|
*
|
|
2219
2974
|
* @param params - Parameters for request
|
|
2220
2975
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2304,6 +3059,60 @@ export namespace securityposture_v1 {
|
|
|
2304
3059
|
|
|
2305
3060
|
/**
|
|
2306
3061
|
* Lists the most recent revisions of all Posture resources in a specified organization and location.
|
|
3062
|
+
* @example
|
|
3063
|
+
* ```js
|
|
3064
|
+
* // Before running the sample:
|
|
3065
|
+
* // - Enable the API at:
|
|
3066
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
3067
|
+
* // - Login into gcloud by running:
|
|
3068
|
+
* // ```sh
|
|
3069
|
+
* // $ gcloud auth application-default login
|
|
3070
|
+
* // ```
|
|
3071
|
+
* // - Install the npm module by running:
|
|
3072
|
+
* // ```sh
|
|
3073
|
+
* // $ npm install googleapis
|
|
3074
|
+
* // ```
|
|
3075
|
+
*
|
|
3076
|
+
* const {google} = require('googleapis');
|
|
3077
|
+
* const securityposture = google.securityposture('v1');
|
|
3078
|
+
*
|
|
3079
|
+
* async function main() {
|
|
3080
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3081
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3082
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
3083
|
+
* });
|
|
3084
|
+
*
|
|
3085
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3086
|
+
* const authClient = await auth.getClient();
|
|
3087
|
+
* google.options({auth: authClient});
|
|
3088
|
+
*
|
|
3089
|
+
* // Do the magic
|
|
3090
|
+
* const res = await securityposture.organizations.locations.postures.list({
|
|
3091
|
+
* // Optional. A filter to apply to the list of postures, in the format defined in [AIP-160: Filtering](https://google.aip.dev/160).
|
|
3092
|
+
* filter: 'placeholder-value',
|
|
3093
|
+
* // 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.
|
|
3094
|
+
* pageSize: 'placeholder-value',
|
|
3095
|
+
* // A pagination token returned from a previous request to list postures. Provide this token to retrieve the next page of results.
|
|
3096
|
+
* pageToken: 'placeholder-value',
|
|
3097
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
3098
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
3099
|
+
* });
|
|
3100
|
+
* console.log(res.data);
|
|
3101
|
+
*
|
|
3102
|
+
* // Example response
|
|
3103
|
+
* // {
|
|
3104
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
3105
|
+
* // "postures": [],
|
|
3106
|
+
* // "unreachable": []
|
|
3107
|
+
* // }
|
|
3108
|
+
* }
|
|
3109
|
+
*
|
|
3110
|
+
* main().catch(e => {
|
|
3111
|
+
* console.error(e);
|
|
3112
|
+
* throw e;
|
|
3113
|
+
* });
|
|
3114
|
+
*
|
|
3115
|
+
* ```
|
|
2307
3116
|
*
|
|
2308
3117
|
* @param params - Parameters for request
|
|
2309
3118
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2398,6 +3207,58 @@ export namespace securityposture_v1 {
|
|
|
2398
3207
|
|
|
2399
3208
|
/**
|
|
2400
3209
|
* Lists all revisions of a single Posture.
|
|
3210
|
+
* @example
|
|
3211
|
+
* ```js
|
|
3212
|
+
* // Before running the sample:
|
|
3213
|
+
* // - Enable the API at:
|
|
3214
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
3215
|
+
* // - Login into gcloud by running:
|
|
3216
|
+
* // ```sh
|
|
3217
|
+
* // $ gcloud auth application-default login
|
|
3218
|
+
* // ```
|
|
3219
|
+
* // - Install the npm module by running:
|
|
3220
|
+
* // ```sh
|
|
3221
|
+
* // $ npm install googleapis
|
|
3222
|
+
* // ```
|
|
3223
|
+
*
|
|
3224
|
+
* const {google} = require('googleapis');
|
|
3225
|
+
* const securityposture = google.securityposture('v1');
|
|
3226
|
+
*
|
|
3227
|
+
* async function main() {
|
|
3228
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3229
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3230
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
3231
|
+
* });
|
|
3232
|
+
*
|
|
3233
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3234
|
+
* const authClient = await auth.getClient();
|
|
3235
|
+
* google.options({auth: authClient});
|
|
3236
|
+
*
|
|
3237
|
+
* // Do the magic
|
|
3238
|
+
* const res =
|
|
3239
|
+
* await securityposture.organizations.locations.postures.listRevisions({
|
|
3240
|
+
* // Required. The name of the Posture, in the format `organizations/{organization\}/locations/global/postures/{posture_id\}`.
|
|
3241
|
+
* name: 'organizations/my-organization/locations/my-location/postures/my-posture',
|
|
3242
|
+
* // 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.
|
|
3243
|
+
* pageSize: 'placeholder-value',
|
|
3244
|
+
* // Optional. A pagination token from a previous request to list posture revisions. Provide this token to retrieve the next page of results.
|
|
3245
|
+
* pageToken: 'placeholder-value',
|
|
3246
|
+
* });
|
|
3247
|
+
* console.log(res.data);
|
|
3248
|
+
*
|
|
3249
|
+
* // Example response
|
|
3250
|
+
* // {
|
|
3251
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
3252
|
+
* // "revisions": []
|
|
3253
|
+
* // }
|
|
3254
|
+
* }
|
|
3255
|
+
*
|
|
3256
|
+
* main().catch(e => {
|
|
3257
|
+
* console.error(e);
|
|
3258
|
+
* throw e;
|
|
3259
|
+
* });
|
|
3260
|
+
*
|
|
3261
|
+
* ```
|
|
2401
3262
|
*
|
|
2402
3263
|
* @param params - Parameters for request
|
|
2403
3264
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2497,6 +3358,78 @@ export namespace securityposture_v1 {
|
|
|
2497
3358
|
|
|
2498
3359
|
/**
|
|
2499
3360
|
* 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.
|
|
3361
|
+
* @example
|
|
3362
|
+
* ```js
|
|
3363
|
+
* // Before running the sample:
|
|
3364
|
+
* // - Enable the API at:
|
|
3365
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
3366
|
+
* // - Login into gcloud by running:
|
|
3367
|
+
* // ```sh
|
|
3368
|
+
* // $ gcloud auth application-default login
|
|
3369
|
+
* // ```
|
|
3370
|
+
* // - Install the npm module by running:
|
|
3371
|
+
* // ```sh
|
|
3372
|
+
* // $ npm install googleapis
|
|
3373
|
+
* // ```
|
|
3374
|
+
*
|
|
3375
|
+
* const {google} = require('googleapis');
|
|
3376
|
+
* const securityposture = google.securityposture('v1');
|
|
3377
|
+
*
|
|
3378
|
+
* async function main() {
|
|
3379
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3380
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3381
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
3382
|
+
* });
|
|
3383
|
+
*
|
|
3384
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3385
|
+
* const authClient = await auth.getClient();
|
|
3386
|
+
* google.options({auth: authClient});
|
|
3387
|
+
*
|
|
3388
|
+
* // Do the magic
|
|
3389
|
+
* const res = await securityposture.organizations.locations.postures.patch({
|
|
3390
|
+
* // Required. Identifier. The name of the posture, in the format `organizations/{organization\}/locations/global/postures/{posture_id\}`.
|
|
3391
|
+
* name: 'organizations/my-organization/locations/my-location/postures/my-posture',
|
|
3392
|
+
* // 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.
|
|
3393
|
+
* revisionId: 'placeholder-value',
|
|
3394
|
+
* // Required. The fields in the Posture to update. You can update only the following fields: * Posture.description * Posture.policy_sets * Posture.state
|
|
3395
|
+
* updateMask: 'placeholder-value',
|
|
3396
|
+
*
|
|
3397
|
+
* // Request body metadata
|
|
3398
|
+
* requestBody: {
|
|
3399
|
+
* // request body parameters
|
|
3400
|
+
* // {
|
|
3401
|
+
* // "annotations": {},
|
|
3402
|
+
* // "categories": [],
|
|
3403
|
+
* // "createTime": "my_createTime",
|
|
3404
|
+
* // "description": "my_description",
|
|
3405
|
+
* // "etag": "my_etag",
|
|
3406
|
+
* // "name": "my_name",
|
|
3407
|
+
* // "policySets": [],
|
|
3408
|
+
* // "reconciling": false,
|
|
3409
|
+
* // "revisionId": "my_revisionId",
|
|
3410
|
+
* // "state": "my_state",
|
|
3411
|
+
* // "updateTime": "my_updateTime"
|
|
3412
|
+
* // }
|
|
3413
|
+
* },
|
|
3414
|
+
* });
|
|
3415
|
+
* console.log(res.data);
|
|
3416
|
+
*
|
|
3417
|
+
* // Example response
|
|
3418
|
+
* // {
|
|
3419
|
+
* // "done": false,
|
|
3420
|
+
* // "error": {},
|
|
3421
|
+
* // "metadata": {},
|
|
3422
|
+
* // "name": "my_name",
|
|
3423
|
+
* // "response": {}
|
|
3424
|
+
* // }
|
|
3425
|
+
* }
|
|
3426
|
+
*
|
|
3427
|
+
* main().catch(e => {
|
|
3428
|
+
* console.error(e);
|
|
3429
|
+
* throw e;
|
|
3430
|
+
* });
|
|
3431
|
+
*
|
|
3432
|
+
* ```
|
|
2500
3433
|
*
|
|
2501
3434
|
* @param params - Parameters for request
|
|
2502
3435
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2698,6 +3631,60 @@ export namespace securityposture_v1 {
|
|
|
2698
3631
|
|
|
2699
3632
|
/**
|
|
2700
3633
|
* Gets a single revision of a PostureTemplate.
|
|
3634
|
+
* @example
|
|
3635
|
+
* ```js
|
|
3636
|
+
* // Before running the sample:
|
|
3637
|
+
* // - Enable the API at:
|
|
3638
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
3639
|
+
* // - Login into gcloud by running:
|
|
3640
|
+
* // ```sh
|
|
3641
|
+
* // $ gcloud auth application-default login
|
|
3642
|
+
* // ```
|
|
3643
|
+
* // - Install the npm module by running:
|
|
3644
|
+
* // ```sh
|
|
3645
|
+
* // $ npm install googleapis
|
|
3646
|
+
* // ```
|
|
3647
|
+
*
|
|
3648
|
+
* const {google} = require('googleapis');
|
|
3649
|
+
* const securityposture = google.securityposture('v1');
|
|
3650
|
+
*
|
|
3651
|
+
* async function main() {
|
|
3652
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3653
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3654
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
3655
|
+
* });
|
|
3656
|
+
*
|
|
3657
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3658
|
+
* const authClient = await auth.getClient();
|
|
3659
|
+
* google.options({auth: authClient});
|
|
3660
|
+
*
|
|
3661
|
+
* // Do the magic
|
|
3662
|
+
* const res =
|
|
3663
|
+
* await securityposture.organizations.locations.postureTemplates.get({
|
|
3664
|
+
* // Required. The name of the PostureTemplate, in the format `organizations/{organization\}/locations/global/postureTemplates/{posture_template\}`.
|
|
3665
|
+
* name: 'organizations/my-organization/locations/my-location/postureTemplates/my-postureTemplate',
|
|
3666
|
+
* // Optional. The posture template revision to retrieve. If not specified, the most recently updated revision is retrieved.
|
|
3667
|
+
* revisionId: 'placeholder-value',
|
|
3668
|
+
* });
|
|
3669
|
+
* console.log(res.data);
|
|
3670
|
+
*
|
|
3671
|
+
* // Example response
|
|
3672
|
+
* // {
|
|
3673
|
+
* // "categories": [],
|
|
3674
|
+
* // "description": "my_description",
|
|
3675
|
+
* // "name": "my_name",
|
|
3676
|
+
* // "policySets": [],
|
|
3677
|
+
* // "revisionId": "my_revisionId",
|
|
3678
|
+
* // "state": "my_state"
|
|
3679
|
+
* // }
|
|
3680
|
+
* }
|
|
3681
|
+
*
|
|
3682
|
+
* main().catch(e => {
|
|
3683
|
+
* console.error(e);
|
|
3684
|
+
* throw e;
|
|
3685
|
+
* });
|
|
3686
|
+
*
|
|
3687
|
+
* ```
|
|
2701
3688
|
*
|
|
2702
3689
|
* @param params - Parameters for request
|
|
2703
3690
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2788,6 +3775,60 @@ export namespace securityposture_v1 {
|
|
|
2788
3775
|
|
|
2789
3776
|
/**
|
|
2790
3777
|
* Lists every PostureTemplate in a given organization and location.
|
|
3778
|
+
* @example
|
|
3779
|
+
* ```js
|
|
3780
|
+
* // Before running the sample:
|
|
3781
|
+
* // - Enable the API at:
|
|
3782
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
3783
|
+
* // - Login into gcloud by running:
|
|
3784
|
+
* // ```sh
|
|
3785
|
+
* // $ gcloud auth application-default login
|
|
3786
|
+
* // ```
|
|
3787
|
+
* // - Install the npm module by running:
|
|
3788
|
+
* // ```sh
|
|
3789
|
+
* // $ npm install googleapis
|
|
3790
|
+
* // ```
|
|
3791
|
+
*
|
|
3792
|
+
* const {google} = require('googleapis');
|
|
3793
|
+
* const securityposture = google.securityposture('v1');
|
|
3794
|
+
*
|
|
3795
|
+
* async function main() {
|
|
3796
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3797
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3798
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
3799
|
+
* });
|
|
3800
|
+
*
|
|
3801
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3802
|
+
* const authClient = await auth.getClient();
|
|
3803
|
+
* google.options({auth: authClient});
|
|
3804
|
+
*
|
|
3805
|
+
* // Do the magic
|
|
3806
|
+
* const res =
|
|
3807
|
+
* await securityposture.organizations.locations.postureTemplates.list({
|
|
3808
|
+
* // Optional. A filter to apply to the list of postures, in the format defined in [AIP-160: Filtering](https://google.aip.dev/160).
|
|
3809
|
+
* filter: 'placeholder-value',
|
|
3810
|
+
* // 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.
|
|
3811
|
+
* pageSize: 'placeholder-value',
|
|
3812
|
+
* // Optional. A pagination token returned from a previous request to list posture templates. Provide this token to retrieve the next page of results.
|
|
3813
|
+
* pageToken: 'placeholder-value',
|
|
3814
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
3815
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
3816
|
+
* });
|
|
3817
|
+
* console.log(res.data);
|
|
3818
|
+
*
|
|
3819
|
+
* // Example response
|
|
3820
|
+
* // {
|
|
3821
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
3822
|
+
* // "postureTemplates": []
|
|
3823
|
+
* // }
|
|
3824
|
+
* }
|
|
3825
|
+
*
|
|
3826
|
+
* main().catch(e => {
|
|
3827
|
+
* console.error(e);
|
|
3828
|
+
* throw e;
|
|
3829
|
+
* });
|
|
3830
|
+
*
|
|
3831
|
+
* ```
|
|
2791
3832
|
*
|
|
2792
3833
|
* @param params - Parameters for request
|
|
2793
3834
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2925,6 +3966,67 @@ export namespace securityposture_v1 {
|
|
|
2925
3966
|
|
|
2926
3967
|
/**
|
|
2927
3968
|
* 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.
|
|
3969
|
+
* @example
|
|
3970
|
+
* ```js
|
|
3971
|
+
* // Before running the sample:
|
|
3972
|
+
* // - Enable the API at:
|
|
3973
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
3974
|
+
* // - Login into gcloud by running:
|
|
3975
|
+
* // ```sh
|
|
3976
|
+
* // $ gcloud auth application-default login
|
|
3977
|
+
* // ```
|
|
3978
|
+
* // - Install the npm module by running:
|
|
3979
|
+
* // ```sh
|
|
3980
|
+
* // $ npm install googleapis
|
|
3981
|
+
* // ```
|
|
3982
|
+
*
|
|
3983
|
+
* const {google} = require('googleapis');
|
|
3984
|
+
* const securityposture = google.securityposture('v1');
|
|
3985
|
+
*
|
|
3986
|
+
* async function main() {
|
|
3987
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3988
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3989
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
3990
|
+
* });
|
|
3991
|
+
*
|
|
3992
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3993
|
+
* const authClient = await auth.getClient();
|
|
3994
|
+
* google.options({auth: authClient});
|
|
3995
|
+
*
|
|
3996
|
+
* // Do the magic
|
|
3997
|
+
* const res =
|
|
3998
|
+
* await securityposture.organizations.locations.reports.createIaCValidationReport(
|
|
3999
|
+
* {
|
|
4000
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
4001
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
4002
|
+
*
|
|
4003
|
+
* // Request body metadata
|
|
4004
|
+
* requestBody: {
|
|
4005
|
+
* // request body parameters
|
|
4006
|
+
* // {
|
|
4007
|
+
* // "iac": {}
|
|
4008
|
+
* // }
|
|
4009
|
+
* },
|
|
4010
|
+
* },
|
|
4011
|
+
* );
|
|
4012
|
+
* console.log(res.data);
|
|
4013
|
+
*
|
|
4014
|
+
* // Example response
|
|
4015
|
+
* // {
|
|
4016
|
+
* // "done": false,
|
|
4017
|
+
* // "error": {},
|
|
4018
|
+
* // "metadata": {},
|
|
4019
|
+
* // "name": "my_name",
|
|
4020
|
+
* // "response": {}
|
|
4021
|
+
* // }
|
|
4022
|
+
* }
|
|
4023
|
+
*
|
|
4024
|
+
* main().catch(e => {
|
|
4025
|
+
* console.error(e);
|
|
4026
|
+
* throw e;
|
|
4027
|
+
* });
|
|
4028
|
+
*
|
|
4029
|
+
* ```
|
|
2928
4030
|
*
|
|
2929
4031
|
* @param params - Parameters for request
|
|
2930
4032
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -3019,6 +4121,55 @@ export namespace securityposture_v1 {
|
|
|
3019
4121
|
|
|
3020
4122
|
/**
|
|
3021
4123
|
* Gets details for a Report.
|
|
4124
|
+
* @example
|
|
4125
|
+
* ```js
|
|
4126
|
+
* // Before running the sample:
|
|
4127
|
+
* // - Enable the API at:
|
|
4128
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
4129
|
+
* // - Login into gcloud by running:
|
|
4130
|
+
* // ```sh
|
|
4131
|
+
* // $ gcloud auth application-default login
|
|
4132
|
+
* // ```
|
|
4133
|
+
* // - Install the npm module by running:
|
|
4134
|
+
* // ```sh
|
|
4135
|
+
* // $ npm install googleapis
|
|
4136
|
+
* // ```
|
|
4137
|
+
*
|
|
4138
|
+
* const {google} = require('googleapis');
|
|
4139
|
+
* const securityposture = google.securityposture('v1');
|
|
4140
|
+
*
|
|
4141
|
+
* async function main() {
|
|
4142
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4143
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4144
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
4145
|
+
* });
|
|
4146
|
+
*
|
|
4147
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4148
|
+
* const authClient = await auth.getClient();
|
|
4149
|
+
* google.options({auth: authClient});
|
|
4150
|
+
*
|
|
4151
|
+
* // Do the magic
|
|
4152
|
+
* const res = await securityposture.organizations.locations.reports.get({
|
|
4153
|
+
* // Required. The name of the report, in the format `organizations/{organization\}/locations/global/reports/{report_id\}`.
|
|
4154
|
+
* name: 'organizations/my-organization/locations/my-location/reports/my-report',
|
|
4155
|
+
* });
|
|
4156
|
+
* console.log(res.data);
|
|
4157
|
+
*
|
|
4158
|
+
* // Example response
|
|
4159
|
+
* // {
|
|
4160
|
+
* // "createTime": "my_createTime",
|
|
4161
|
+
* // "iacValidationReport": {},
|
|
4162
|
+
* // "name": "my_name",
|
|
4163
|
+
* // "updateTime": "my_updateTime"
|
|
4164
|
+
* // }
|
|
4165
|
+
* }
|
|
4166
|
+
*
|
|
4167
|
+
* main().catch(e => {
|
|
4168
|
+
* console.error(e);
|
|
4169
|
+
* throw e;
|
|
4170
|
+
* });
|
|
4171
|
+
*
|
|
4172
|
+
* ```
|
|
3022
4173
|
*
|
|
3023
4174
|
* @param params - Parameters for request
|
|
3024
4175
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -3108,6 +4259,60 @@ export namespace securityposture_v1 {
|
|
|
3108
4259
|
|
|
3109
4260
|
/**
|
|
3110
4261
|
* Lists every Report in a given organization and location.
|
|
4262
|
+
* @example
|
|
4263
|
+
* ```js
|
|
4264
|
+
* // Before running the sample:
|
|
4265
|
+
* // - Enable the API at:
|
|
4266
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
4267
|
+
* // - Login into gcloud by running:
|
|
4268
|
+
* // ```sh
|
|
4269
|
+
* // $ gcloud auth application-default login
|
|
4270
|
+
* // ```
|
|
4271
|
+
* // - Install the npm module by running:
|
|
4272
|
+
* // ```sh
|
|
4273
|
+
* // $ npm install googleapis
|
|
4274
|
+
* // ```
|
|
4275
|
+
*
|
|
4276
|
+
* const {google} = require('googleapis');
|
|
4277
|
+
* const securityposture = google.securityposture('v1');
|
|
4278
|
+
*
|
|
4279
|
+
* async function main() {
|
|
4280
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4281
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4282
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
4283
|
+
* });
|
|
4284
|
+
*
|
|
4285
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4286
|
+
* const authClient = await auth.getClient();
|
|
4287
|
+
* google.options({auth: authClient});
|
|
4288
|
+
*
|
|
4289
|
+
* // Do the magic
|
|
4290
|
+
* const res = await securityposture.organizations.locations.reports.list({
|
|
4291
|
+
* // Optional. A filter to apply to the list of reports, in the format defined in [AIP-160: Filtering](https://google.aip.dev/160).
|
|
4292
|
+
* filter: 'placeholder-value',
|
|
4293
|
+
* // 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.
|
|
4294
|
+
* pageSize: 'placeholder-value',
|
|
4295
|
+
* // Optional. A pagination token returned from a previous request to list reports. Provide this token to retrieve the next page of results.
|
|
4296
|
+
* pageToken: 'placeholder-value',
|
|
4297
|
+
* // Required. The parent resource name, in the format `organizations/{organization\}/locations/global`.
|
|
4298
|
+
* parent: 'organizations/my-organization/locations/my-location',
|
|
4299
|
+
* });
|
|
4300
|
+
* console.log(res.data);
|
|
4301
|
+
*
|
|
4302
|
+
* // Example response
|
|
4303
|
+
* // {
|
|
4304
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
4305
|
+
* // "reports": [],
|
|
4306
|
+
* // "unreachable": []
|
|
4307
|
+
* // }
|
|
4308
|
+
* }
|
|
4309
|
+
*
|
|
4310
|
+
* main().catch(e => {
|
|
4311
|
+
* console.error(e);
|
|
4312
|
+
* throw e;
|
|
4313
|
+
* });
|
|
4314
|
+
*
|
|
4315
|
+
* ```
|
|
3111
4316
|
*
|
|
3112
4317
|
* @param params - Parameters for request
|
|
3113
4318
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -3255,6 +4460,56 @@ export namespace securityposture_v1 {
|
|
|
3255
4460
|
|
|
3256
4461
|
/**
|
|
3257
4462
|
* Gets information about a location.
|
|
4463
|
+
* @example
|
|
4464
|
+
* ```js
|
|
4465
|
+
* // Before running the sample:
|
|
4466
|
+
* // - Enable the API at:
|
|
4467
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
4468
|
+
* // - Login into gcloud by running:
|
|
4469
|
+
* // ```sh
|
|
4470
|
+
* // $ gcloud auth application-default login
|
|
4471
|
+
* // ```
|
|
4472
|
+
* // - Install the npm module by running:
|
|
4473
|
+
* // ```sh
|
|
4474
|
+
* // $ npm install googleapis
|
|
4475
|
+
* // ```
|
|
4476
|
+
*
|
|
4477
|
+
* const {google} = require('googleapis');
|
|
4478
|
+
* const securityposture = google.securityposture('v1');
|
|
4479
|
+
*
|
|
4480
|
+
* async function main() {
|
|
4481
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4482
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4483
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
4484
|
+
* });
|
|
4485
|
+
*
|
|
4486
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4487
|
+
* const authClient = await auth.getClient();
|
|
4488
|
+
* google.options({auth: authClient});
|
|
4489
|
+
*
|
|
4490
|
+
* // Do the magic
|
|
4491
|
+
* const res = await securityposture.projects.locations.get({
|
|
4492
|
+
* // Resource name for the location.
|
|
4493
|
+
* name: 'projects/my-project/locations/my-location',
|
|
4494
|
+
* });
|
|
4495
|
+
* console.log(res.data);
|
|
4496
|
+
*
|
|
4497
|
+
* // Example response
|
|
4498
|
+
* // {
|
|
4499
|
+
* // "displayName": "my_displayName",
|
|
4500
|
+
* // "labels": {},
|
|
4501
|
+
* // "locationId": "my_locationId",
|
|
4502
|
+
* // "metadata": {},
|
|
4503
|
+
* // "name": "my_name"
|
|
4504
|
+
* // }
|
|
4505
|
+
* }
|
|
4506
|
+
*
|
|
4507
|
+
* main().catch(e => {
|
|
4508
|
+
* console.error(e);
|
|
4509
|
+
* throw e;
|
|
4510
|
+
* });
|
|
4511
|
+
*
|
|
4512
|
+
* ```
|
|
3258
4513
|
*
|
|
3259
4514
|
* @param params - Parameters for request
|
|
3260
4515
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -3344,6 +4599,61 @@ export namespace securityposture_v1 {
|
|
|
3344
4599
|
|
|
3345
4600
|
/**
|
|
3346
4601
|
* Lists information about the supported locations for this service.
|
|
4602
|
+
* @example
|
|
4603
|
+
* ```js
|
|
4604
|
+
* // Before running the sample:
|
|
4605
|
+
* // - Enable the API at:
|
|
4606
|
+
* // https://console.developers.google.com/apis/api/securityposture.googleapis.com
|
|
4607
|
+
* // - Login into gcloud by running:
|
|
4608
|
+
* // ```sh
|
|
4609
|
+
* // $ gcloud auth application-default login
|
|
4610
|
+
* // ```
|
|
4611
|
+
* // - Install the npm module by running:
|
|
4612
|
+
* // ```sh
|
|
4613
|
+
* // $ npm install googleapis
|
|
4614
|
+
* // ```
|
|
4615
|
+
*
|
|
4616
|
+
* const {google} = require('googleapis');
|
|
4617
|
+
* const securityposture = google.securityposture('v1');
|
|
4618
|
+
*
|
|
4619
|
+
* async function main() {
|
|
4620
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4621
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4622
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
4623
|
+
* });
|
|
4624
|
+
*
|
|
4625
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4626
|
+
* const authClient = await auth.getClient();
|
|
4627
|
+
* google.options({auth: authClient});
|
|
4628
|
+
*
|
|
4629
|
+
* // Do the magic
|
|
4630
|
+
* const res = await securityposture.projects.locations.list({
|
|
4631
|
+
* // Optional. A list of extra location types that should be used as conditions for controlling the visibility of the locations.
|
|
4632
|
+
* extraLocationTypes: 'placeholder-value',
|
|
4633
|
+
* // 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).
|
|
4634
|
+
* filter: 'placeholder-value',
|
|
4635
|
+
* // The resource that owns the locations collection, if applicable.
|
|
4636
|
+
* name: 'projects/my-project',
|
|
4637
|
+
* // The maximum number of results to return. If not set, the service selects a default.
|
|
4638
|
+
* pageSize: 'placeholder-value',
|
|
4639
|
+
* // A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
|
|
4640
|
+
* pageToken: 'placeholder-value',
|
|
4641
|
+
* });
|
|
4642
|
+
* console.log(res.data);
|
|
4643
|
+
*
|
|
4644
|
+
* // Example response
|
|
4645
|
+
* // {
|
|
4646
|
+
* // "locations": [],
|
|
4647
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
4648
|
+
* // }
|
|
4649
|
+
* }
|
|
4650
|
+
*
|
|
4651
|
+
* main().catch(e => {
|
|
4652
|
+
* console.error(e);
|
|
4653
|
+
* throw e;
|
|
4654
|
+
* });
|
|
4655
|
+
*
|
|
4656
|
+
* ```
|
|
3347
4657
|
*
|
|
3348
4658
|
* @param params - Parameters for request
|
|
3349
4659
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -3446,6 +4756,10 @@ export namespace securityposture_v1 {
|
|
|
3446
4756
|
}
|
|
3447
4757
|
export interface Params$Resource$Projects$Locations$List
|
|
3448
4758
|
extends StandardParameters {
|
|
4759
|
+
/**
|
|
4760
|
+
* Optional. A list of extra location types that should be used as conditions for controlling the visibility of the locations.
|
|
4761
|
+
*/
|
|
4762
|
+
extraLocationTypes?: string[];
|
|
3449
4763
|
/**
|
|
3450
4764
|
* 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).
|
|
3451
4765
|
*/
|