示例#1
0
  def Args(parser):
    parser.add_argument(
        'POLICY_ID',
        type=str,
        help="""\
        ID of the guest policy to create.

        This ID must contain only lowercase letters, numbers, and hyphens, start
        with a letter, end with a number or a letter, be between 1-63
        characters, and unique within the project, folder, or organization.""",
    )
    parser.add_argument(
        '--file',
        required=True,
        help='The JSON or YAML file with the guest policy to create.',
    )
    parser.add_argument(
        '--description',
        type=str,
        help="""\
        Description of the guest policy to create. Length of the description is
        limited to 1024 characters.

        If specified, it will override any description provided in the file.""",
    )
    osconfig_command_utils.AddResourceParentArgs(parser, 'guest policy',
                                                 'to create')
示例#2
0
    def Args(parser):
        parser.add_argument('POLICY_ID',
                            type=str,
                            help='ID of the guest policy to update.')
        osconfig_command_utils.AddResourceParentArgs(parser, 'guest policy',
                                                     'to update')

        update_group = parser.add_group(help='The update component.',
                                        required=True)
        update_group.add_argument('--file',
                                  help="""\
        The JSON or YAML file with the updated guest policy.

        If this file specifies an "etag" value, the update will succeed only if
        the policy already in place matches that etag. A policy in a file that
        does not contain an etag value will simply replace the existing policy.
        """)
        update_group.add_argument('--description',
                                  type=str,
                                  help="""\
        Description of the guest policy to update. Length of the description is
        limited to 1024 characters.

        If specified, it will override any description provided in the file."""
                                  )
        parser.add_argument('--etag',
                            type=str,
                            help="""\
        The etag value of the guest policy to update.

        If specified, it will override any etag provided in the file, and the
        update will succeed only if the policy already in place matches this
        etag.""")
示例#3
0
 def Args(parser):
     """See base class."""
     parser.add_argument('POLICY_ID',
                         type=str,
                         help='ID of the guest policy to describe.')
     osconfig_command_utils.AddResourceParentArgs(parser, 'guest policy',
                                                  'to describe')
示例#4
0
 def Args(parser):
     osconfig_command_utils.AddResourceParentArgs(parser, 'guest policies',
                                                  'to list')
     parser.display_info.AddFormat("""
       table(
         name.basename(),
         description(),
         create_time,
         update_time
       )
     """)
     parser.display_info.AddTransforms(
         {'description': _TransformGuestPolicyDescription})
     parser.display_info.AddUriFunc(_MakeGetUriFunc())
示例#5
0
  def Args(parser):
    """See base class."""
    parser.add_argument(
        'POLICY_ID', type=str, help='Name of the guest policy to update.')
    parser.add_argument(
        '--file',
        required=True,
        help="""\
        The JSON or YAML file with the updated guest policy.

        If this file specifies an etag value, the update succeeds only if
        the policy that is already in place has a matching etag value. If no
        etag value is specified, the specifications in the updated policy file
        replaces the existing policy.
        """)
    osconfig_command_utils.AddResourceParentArgs(parser, 'guest policy',
                                                 'to update')
示例#6
0
  def Args(parser):
    """See base class."""
    parser.add_argument(
        'POLICY_ID',
        type=str,
        help="""\
        Name of the guest policy to create.

        This name must contain only lowercase letters, numbers, and hyphens,
        start with a letter, end with a number or a letter, be between 1-63
        characters, and unique within the project, folder, or organization.""",
    )
    parser.add_argument(
        '--file',
        required=True,
        help='The JSON or YAML file with the guest policy to create.',
    )
    osconfig_command_utils.AddResourceParentArgs(parser, 'guest policy',
                                                 'to create')
示例#7
0
 def Args(parser):
     parser.add_argument('POLICY_ID',
                         type=str,
                         help='ID of the guest policy to delete.')
     osconfig_command_utils.AddResourceParentArgs(parser, 'guest policy',
                                                  'to delete')
示例#8
0
 def Args(parser):
     """See base class."""
     _Args(parser, base.ReleaseTrack.ALPHA)
     osconfig_command_utils.AddResourceParentArgs(parser, 'guest policies',
                                                  'to list')