
                             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	r " S
 S\R                  5      rg)z2The command to update Fleet Observability Feature.    )absolute_import)division)unicode_literals)messages)arg_parsers)
exceptions)basea    Path of the YAML(or JSON) file that contains the logging configurations.

  The JSON file is formatted as follows, with camelCase field naming:

  ```
  {
      "loggingConfig": {
          "defaultConfig": {
              "mode": "COPY"
          },
          "fleetScopeLogsConfig": {
              "mode": "MOVE"
          }
      }
  }
  ```

  The YAML file is formatted as follows, with camelCase field naming:

  ```
  ---
  loggingConfig:
    defaultConfig:
      mode: COPY
    fleetScopeLogsConfig:
      mode: MOVE
  ```
c                   2    \ rS rSrSrSr\S 5       rS rSr	g)Update9   zUpdates the Fleet Observability Feature resource.

This command updates the Fleet Observability Feature in a fleet.

## EXAMPLES

To describe the Fleet Observability Feature, run:

  $ {command} --logging-config=LOGGING-CONFIG
fleetobservabilityc                 T    UR                  S[        R                  " 5       [        S9  g )N--logging-config)typehelp)add_argumentr   YAMLFileContents!_UPDATE_LOGGING_CONFIG_HELPF_TEXT)clsparsers     8lib/surface/container/fleet/fleetobservability/update.pyArgsUpdate.ArgsG   s'    
))+.      c                 p   UR                   nSU;  a  [        R                  " SS5      eUR                  SS 5      n [        R
                  " UU R                  R                  5      nU R                  R                  U R                  R                  U R                  R                  US9S9S9nU R!                  S	/U5        g ! [        R                  [        [        4 aS  n[        R                  " SSR                  UR                  (       a  UR                  S   5      5      eU5      5      eS nAff = f)
NloggingConfigr   z;Missing field [loggingConfig] in logging configuration filez'{}'r   )r   )r   )specz&spec.fleetobservability.logging_config)logging_configr   InvalidArgumentExceptiongetmessages_utilDictToMessageWithErrorCheckr   FleetObservabilityLoggingConfigDecodeErrorAttributeErrorKeyErrorformatargsFeatureCommonFeatureSpecFleetObservabilityFeatureSpecr   )selfr(   file_contentlogging_config_from_filer   errfs          r   Run
Update.RunO   s*   &&Ll*//

GI I  ,//F;$@@
"
--
7
79n 	]],,#}}JJ,  K   -  	 	A
 	KK9:A> %%~x@ ;//

--sxx
9; ;58
9; ;;s   +C D5"AD00D5 N)
__name__
__module____qualname____firstlineno____doc__feature_nameclassmethodr   r1   __static_attributes__r3   r   r   r   r   9   s%    	 &, ?r   r   N)r8   
__future__r   r   r   googlecloudsdk.api_lib.utilr   r!   googlecloudsdk.callioper   r   3googlecloudsdk.command_lib.container.fleet.featuresr	   r   UpdateCommandr   r3   r   r   <module>rA      s9    9 &  ' A / . D% !>+?T +?r   