
                         <   S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSK	Jr  SS	KJr  S
r\R                   " \R"                  R$                  \R"                  R&                  \R"                  R(                  5       " S S\R*                  5      5       rg)z=Command to export assets to Google Cloud Storage or BigQuery.    )absolute_import)division)unicode_literals)client_util)base)flags)utils)logz gcloud asset operations describec                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
Export    z9Export the cloud assets to Google Cloud Storage/BigQuery.a        Export the cloud assets to Google Cloud Storage or BigQuery. Use gcloud
      asset operations describe to get the latest status of the operation. Note
      that to export a project different from the project you want to bill, you
      can use  --billing-project or authenticate with a service account.
      See https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/gcloud-asset
      for examples of using a service account.
      a        To export a snapshot of assets of type 'compute.googleapis.com/Disk' in
      project 'test-project' at '2019-03-05T00:00:00Z' to
      'gs://bucket-name/object-name' and only export the asset metadata, run:

        $ {command} --project='test-project' --asset-types='compute.googleapis.com/Disk' --snapshot-time='2019-03-05T00:00:00Z' --output-path='gs://bucket-name/object-name' --content-type='resource'

      To export a snapshot of assets of type 'compute.googleapis.com/Disk' in
      project 'test-project' at '2019-03-05T00:00:00Z' to
      'projects/projectId/datasets/datasetId/tables/table_name', overwrite the table
      if existed, run:

        $ {command} --project='test-project' --asset-types='compute.googleapis.com/Disk' --snapshot-time='2019-03-05T00:00:00Z' --bigquery-table='projects/projectId/datasets/datasetId/tables/table_name' --output-bigquery-force --content-type='resource'
      )DESCRIPTIONEXAMPLESc                    [         R                  " U SSS5        [         R                  " U 5        [         R                  " U 5        [         R                  " U SS9  [         R
                  " U 5        [         R                  " U 5        g )Nz$The project which is the root asset.z3The ID of the organization which is the root asset.z-The ID of the folder which is the root asset.F)required)r   AddParentArgsAddSnapshotTimeArgsAddAssetTypesArgsAddContentTypeArgsAddDestinationArgsAddRelationshipTypesArgs)parsers    lib/surface/asset/export.pyArgsExport.ArgsA   sf    	 FMGI 
f%	F#	Ve4	V$	""6*    c                 d   [         R                  " UR                  UR                  UR                  5      n[
        R                  " U5      nUR                  U5      n[        R                  " USSS9  [        R                  R                  SR                  [        UR                  5      5        g )NTz
root asset)is_asynckindz1Use [{} {}] to check the status of the operation.)asset_utilsGetParentNameForExportorganizationprojectfolderr   AssetExportClientr   r
   ExportResourcestatusPrintformatOPERATION_DESCRIBE_COMMANDname)selfargsparentclient	operations        r   Run
Export.RunL   s    //0A0A4<<04=F**62Fd#Iv<@JJHOO"INN4 5r    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r1   __static_attributes__r3   r   r   r   r       s2     B

-8 + +5r   r   N)r8   
__future__r   r   r   googlecloudsdk.api_lib.assetr   googlecloudsdk.callioper    googlecloudsdk.command_lib.assetr   r	   r    googlecloudsdk.corer
   r*   ReleaseTracksReleaseTrackALPHABETAGACommandr   r3   r   r   <module>rG      s    D &  ' 4 ( 2 A # @  D%%++T->->-C-C%%((*25T\\ 25*25r   