Files
google-apis-rs/google_cloudasset1_cli/methods_export-assets/index.html
2024-03-05 21:06:01 +01:00

377 lines
21 KiB
HTML

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><link rel="canonical" href="http://byron.github.io/google-apis-rs/google-cloudasset1-cli/methods_export-assets/" />
<link rel="shortcut icon" href="../img/favicon.ico" />
<title>Export Assets - Cloud Asset v5.0.4+20240302</title>
<link rel="stylesheet" href="../css/theme.css" />
<link rel="stylesheet" href="../css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/github.min.css" />
<script>
// Current page data
var mkdocs_page_name = "Export Assets";
var mkdocs_page_input_path = "methods_export-assets.md";
var mkdocs_page_url = "/google-apis-rs/google-cloudasset1-cli/methods_export-assets/";
</script>
<script src="../js/jquery-3.6.0.min.js" defer></script>
<!--[if lt IE 9]>
<script src="../js/html5shiv.min.js"></script>
<![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href=".." class="icon icon-home"> Cloud Asset v5.0.4+20240302
</a><div role="search">
<form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul>
<li class="toctree-l1"><a class="reference internal" href="..">Home</a>
</li>
</ul>
<p class="caption"><span class="caption-text">Assets</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../assets_list/">List</a>
</li>
</ul>
<p class="caption"><span class="caption-text">Effective Iam Policies</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../effective-iam-policies_batch-get/">Batch Get</a>
</li>
</ul>
<p class="caption"><span class="caption-text">Feeds</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../feeds_create/">Create</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../feeds_delete/">Delete</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../feeds_get/">Get</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../feeds_list/">List</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../feeds_patch/">Patch</a>
</li>
</ul>
<p class="caption"><span class="caption-text">Methods</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../methods_analyze-iam-policy/">Analyze Iam Policy</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../methods_analyze-iam-policy-longrunning/">Analyze Iam Policy Longrunning</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../methods_analyze-move/">Analyze Move</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../methods_analyze-org-policies/">Analyze Org Policies</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../methods_analyze-org-policy-governed-assets/">Analyze Org Policy Governed Assets</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../methods_analyze-org-policy-governed-containers/">Analyze Org Policy Governed Containers</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../methods_batch-get-assets-history/">Batch Get Assets History</a>
</li>
<li class="toctree-l1 current"><a class="reference internal current" href="./">Export Assets</a>
<ul class="current">
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../methods_query-assets/">Query Assets</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../methods_search-all-iam-policies/">Search All Iam Policies</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../methods_search-all-resources/">Search All Resources</a>
</li>
</ul>
<p class="caption"><span class="caption-text">Operations</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../operations_get/">Get</a>
</li>
</ul>
<p class="caption"><span class="caption-text">Saved Queries</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../saved-queries_create/">Create</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../saved-queries_delete/">Delete</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../saved-queries_get/">Get</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../saved-queries_list/">List</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="../saved-queries_patch/">Patch</a>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="Mobile navigation menu">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="..">Cloud Asset v5.0.4+20240302</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href=".." class="icon icon-home" alt="Docs"></a> &raquo;</li>
<li>Methods &raquo;</li>
<li>Export Assets</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/Byron/google-apis-rs/tree/main/gen/cloudasset1-cli/edit/master/docs/methods_export-assets.md"
class="icon icon-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div class="section" itemprop="articleBody">
<p>Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a google.cloud.asset.v1.Asset in the JSON format; for BigQuery table destinations, the output table stores the fields in asset Protobuf as columns. This API implements the google.longrunning.Operation API, which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.</p>
<h1 id="scopes">Scopes</h1>
<p>You will need authorization for the <em>https://www.googleapis.com/auth/cloud-platform</em> scope to make a valid call.</p>
<p>If unset, the scope for this method defaults to <em>https://www.googleapis.com/auth/cloud-platform</em>.
You can set the scope for this method like this: <code>cloudasset1 --scope &lt;scope&gt; methods export-assets ...</code></p>
<h1 id="required-scalar-argument">Required Scalar Argument</h1>
<ul>
<li><strong>&lt;parent&gt;</strong> <em>(string)</em><ul>
<li>Required. The relative name of the root asset. This can only be an organization number (such as &#34;organizations/123&#34;), a project ID (such as &#34;projects/my-project-id&#34;), or a project number (such as &#34;projects/12345&#34;), or a folder number (such as &#34;folders/123&#34;).</li>
</ul>
</li>
</ul>
<h1 id="required-request-value">Required Request Value</h1>
<p>The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure.
In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.</p>
<p>For example, a structure like this:</p>
<pre><code>ExportAssetsRequest:
asset-types: [string]
content-type: string
output-config:
bigquery-destination:
dataset: string
force: boolean
partition-spec:
partition-key: string
separate-tables-per-asset-type: boolean
table: string
gcs-destination:
uri: string
uri-prefix: string
read-time: string
relationship-types: [string]
</code></pre>
<p>can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.</p>
<ul>
<li><code>-r . asset-types=et</code><ul>
<li>A list of asset types to take a snapshot for. For example: &#34;compute.googleapis.com/Disk&#34;. Regular expressions are also supported. For example: * &#34;compute.googleapis.com.<em>&#34; snapshots resources whose asset type starts with &#34;compute.googleapis.com&#34;. * &#34;.</em>Instance&#34; snapshots resources whose asset type ends with &#34;Instance&#34;. * &#34;.<em>Instance.</em>&#34; snapshots resources whose asset type contains &#34;Instance&#34;. See <a href="https://github.com/google/re2/wiki/Syntax">RE2</a> for all supported regular expression syntax. If the regular expression does not match any supported asset type, an INVALID_ARGUMENT error will be returned. If specified, only matching assets will be returned, otherwise, it will snapshot all asset types. See <a href="https://cloud.google.com/asset-inventory/docs/overview">Introduction to Cloud Asset Inventory</a> for all supported asset types.</li>
<li>Each invocation of this argument appends the given value to the array.</li>
</ul>
</li>
<li><code>content-type=sed</code><ul>
<li>Asset content type. If not specified, no content but the asset name will be returned.</li>
</ul>
</li>
<li><code>output-config.bigquery-destination dataset=et</code><ul>
<li>Required. The BigQuery dataset in format &#34;projects/projectId/datasets/datasetId&#34;, to which the snapshot result should be exported. If this dataset does not exist, the export call returns an INVALID_ARGUMENT error. Setting the <code>contentType</code> for <code>exportAssets</code> determines the <a href="/asset-inventory/docs/exporting-to-bigquery#bigquery-schema">schema</a> of the BigQuery table. Setting <code>separateTablesPerAssetType</code> to <code>TRUE</code> also influences the schema.</li>
</ul>
</li>
<li><code>force=true</code><ul>
<li>If the destination table already exists and this flag is <code>TRUE</code>, the table will be overwritten by the contents of assets snapshot. If the flag is <code>FALSE</code> or unset and the destination table already exists, the export call returns an INVALID_ARGUMEMT error.</li>
</ul>
</li>
<li>
<p><code>partition-spec partition-key=vero</code></p>
<ul>
<li>The partition key for BigQuery partitioned table.</li>
</ul>
</li>
<li>
<p><code>.. separate-tables-per-asset-type=false</code></p>
<ul>
<li>If this flag is <code>TRUE</code>, the snapshot results will be written to one or multiple tables, each of which contains results of one asset type. The [force] and [partition_spec] fields will apply to each of them. Field [table] will be concatenated with &#34;<em>&#34; and the asset type names (see https://cloud.google.com/asset-inventory/docs/supported-asset-types for supported asset types) to construct per-asset-type table names, in which all non-alphanumeric characters like &#34;.&#34; and &#34;/&#34; will be substituted by &#34;</em>&#34;. Example: if field [table] is &#34;mytable&#34; and snapshot results contain &#34;storage.googleapis.com/Bucket&#34; assets, the corresponding table name will be &#34;mytable_storage_googleapis_com_Bucket&#34;. If any of these tables does not exist, a new table with the concatenated name will be created. When [content_type] in the ExportAssetsRequest is <code>RESOURCE</code>, the schema of each table will include RECORD-type columns mapped to the nested fields in the Asset.resource.data field of that asset type (up to the 15 nested level BigQuery supports (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The fields in &gt;15 nested levels will be stored in JSON format string as a child column of its parent RECORD column. If error occurs when exporting to any table, the whole export call will return an error but the export results that already succeed will persist. Example: if exporting to table_type_A succeeds when exporting to table_type_B fails during one export call, the results in table_type_A will persist and there will not be partial results persisting in a table.</li>
</ul>
</li>
<li>
<p><code>table=duo</code></p>
<ul>
<li>Required. The BigQuery table to which the snapshot result should be written. If this table does not exist, a new table with the given name will be created.</li>
</ul>
</li>
<li>
<p><code>..gcs-destination uri=dolore</code></p>
<ul>
<li>The URI of the Cloud Storage object. It&#39;s the same URI that is used by gsutil. Example: &#34;gs://bucket_name/object_name&#34;. See <a href="https://cloud.google.com/storage/docs/viewing-editing-metadata">Viewing and Editing Object Metadata</a> for more information. If the specified Cloud Storage object already exists and there is no <a href="https://cloud.google.com/storage/docs/object-holds">hold</a>, it will be overwritten with the exported result.</li>
</ul>
</li>
<li>
<p><code>uri-prefix=et</code></p>
<ul>
<li>The URI prefix of all generated Cloud Storage objects. Example: &#34;gs://bucket_name/object_name_prefix&#34;. Each object URI is in format: &#34;gs://bucket_name/object_name_prefix// and only contains assets for that type. starts from 0. Example: &#34;gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0&#34; is the first shard of output objects containing all compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be returned if file with the same name &#34;gs://bucket_name/object_name_prefix&#34; already exists.</li>
</ul>
</li>
<li>
<p><code>... read-time=voluptua.</code></p>
<ul>
<li>Timestamp to take an asset snapshot. This can only be set to a timestamp between the current time and the current time minus 35 days (inclusive). If not specified, the current time will be used. Due to delays in resource data collection and indexing, there is a volatile window during which running the same query may get different results.</li>
</ul>
</li>
<li><code>relationship-types=amet.</code><ul>
<li>A list of relationship types to export, for example: <code>INSTANCE_TO_INSTANCEGROUP</code>. This field should only be specified if content_type=RELATIONSHIP. * If specified: it snapshots specified relationships. It returns an error if any of the [relationship_types] doesn&#39;t belong to the supported relationship types of the [asset_types] or if any of the [asset_types] doesn&#39;t belong to the source types of the [relationship_types]. * Otherwise: it snapshots the supported relationships for all [asset_types] or returns an error if any of the [asset_types] has no relationship support. An unspecified asset types field means all supported asset_types. See <a href="https://cloud.google.com/asset-inventory/docs/overview">Introduction to Cloud Asset Inventory</a> for all supported asset types and relationship types.</li>
<li>Each invocation of this argument appends the given value to the array.</li>
</ul>
</li>
</ul>
<h3 id="about-cursors">About Cursors</h3>
<p>The cursor position is key to comfortably set complex nested structures. The following rules apply:</p>
<ul>
<li>The cursor position is always set relative to the current one, unless the field name starts with the <code>.</code> character. Fields can be nested such as in <code>-r f.s.o</code> .</li>
<li>The cursor position is set relative to the top-level structure if it starts with <code>.</code>, e.g. <code>-r .s.s</code></li>
<li>You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify <code>-r struct.sub_struct=bar</code>.</li>
<li>You can move the cursor one level up by using <code>..</code>. Each additional <code>.</code> moves it up one additional level. E.g. <code>...</code> would go three levels up.</li>
</ul>
<h1 id="optional-output-flags">Optional Output Flags</h1>
<p>The method's return value a JSON encoded structure, which will be written to standard output by default.</p>
<ul>
<li><strong>-o out</strong><ul>
<li><em>out</em> specifies the <em>destination</em> to which to write the server's result to.
It will be a JSON-encoded structure.
The <em>destination</em> may be <code>-</code> to indicate standard output, or a filepath that is to contain the received bytes.
If unset, it defaults to standard output.</li>
</ul>
</li>
</ul>
<h1 id="optional-general-properties">Optional General Properties</h1>
<p>The following properties can configure any call, and are not specific to this method.</p>
<ul>
<li>
<p><strong>-p $-xgafv=string</strong></p>
<ul>
<li>V1 error format.</li>
</ul>
</li>
<li>
<p><strong>-p access-token=string</strong></p>
<ul>
<li>OAuth access token.</li>
</ul>
</li>
<li>
<p><strong>-p alt=string</strong></p>
<ul>
<li>Data format for response.</li>
</ul>
</li>
<li>
<p><strong>-p callback=string</strong></p>
<ul>
<li>JSONP</li>
</ul>
</li>
<li>
<p><strong>-p fields=string</strong></p>
<ul>
<li>Selector specifying which fields to include in a partial response.</li>
</ul>
</li>
<li>
<p><strong>-p key=string</strong></p>
<ul>
<li>API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.</li>
</ul>
</li>
<li>
<p><strong>-p oauth-token=string</strong></p>
<ul>
<li>OAuth 2.0 token for the current user.</li>
</ul>
</li>
<li>
<p><strong>-p pretty-print=boolean</strong></p>
<ul>
<li>Returns response with indentations and line breaks.</li>
</ul>
</li>
<li>
<p><strong>-p quota-user=string</strong></p>
<ul>
<li>Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.</li>
</ul>
</li>
<li>
<p><strong>-p upload-type=string</strong></p>
<ul>
<li>Legacy upload protocol for media (e.g. &#34;media&#34;, &#34;multipart&#34;).</li>
</ul>
</li>
<li>
<p><strong>-p upload-protocol=string</strong></p>
<ul>
<li>Upload protocol for media (e.g. &#34;raw&#34;, &#34;multipart&#34;).</li>
</ul>
</li>
</ul>
</div>
</div><footer>
<div class="rst-footer-buttons" role="navigation" aria-label="Footer Navigation">
<a href="../methods_batch-get-assets-history/" class="btn btn-neutral float-left" title="Batch Get Assets History"><span class="icon icon-circle-arrow-left"></span> Previous</a>
<a href="../methods_query-assets/" class="btn btn-neutral float-right" title="Query Assets">Next <span class="icon icon-circle-arrow-right"></span></a>
</div>
<hr/>
<div role="contentinfo">
<!-- Copyright etc -->
<p>Copyright &copy; 2015-2020, `Sebastian Thiel`</p>
</div>
Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" aria-label="Versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span>
<a href="https://github.com/Byron/google-apis-rs/tree/main/gen/cloudasset1-cli" class="fa fa-github" style="color: #fcfcfc"> GitHub</a>
</span>
<span><a href="../methods_batch-get-assets-history/" style="color: #fcfcfc">&laquo; Previous</a></span>
<span><a href="../methods_query-assets/" style="color: #fcfcfc">Next &raquo;</a></span>
</span>
</div>
<script>var base_url = '..';</script>
<script src="../js/theme_extra.js" defer></script>
<script src="../js/theme.js" defer></script>
<script src="../search/main.js" defer></script>
<script defer>
window.onload = function () {
SphinxRtdTheme.Navigation.enable(true);
};
</script>
</body>
</html>