Exemplo n.º 1
0
    def Args(parser, version=base.ReleaseTrack.GA):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
      version: The version this tool is running as. base.ReleaseTrack.GA
          is the default.
    """
        flags.AddAsyncFlag(parser)
        flags.AddDeploymentNameFlag(parser)
        flags.AddPropertiesFlag(parser)

        if version in [base.ReleaseTrack.ALPHA]:
            labels_util.AddCreateLabelsFlags(parser)
        parser.add_argument(
            '--description',
            help='Optional description of the deployment to insert.',
            dest='description')

        parser.add_argument(
            '--config',
            help='Filename of config which specifies resources to deploy.',
            dest='config',
            required=True)

        parser.add_argument(
            '--preview',
            help=
            'Preview the requested create without actually instantiating the '
            'underlying resources. (default=False)',
            dest='preview',
            default=False,
            action='store_true')
Exemplo n.º 2
0
  def Args(parser, version=base.ReleaseTrack.GA):
    """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
      version: The version this tool is running as. base.ReleaseTrack.GA
          is the default.
    """
    flags.AddDeploymentNameFlag(parser)
    flags.AddPropertiesFlag(parser)
    flags.AddAsyncFlag(parser)

    parser.add_argument(
        '--description',
        help='The new description of the deployment.',
        dest='description'
    )

    group = parser.add_mutually_exclusive_group()
    group.add_argument(
        '--config',
        help='Filename of config that specifies resources to deploy. '
        'Required unless launching an already-previewed update to this '
        'deployment. More information is available at '
        'https://cloud.google.com/deployment-manager/docs/configuration/.',
        dest='config')

    if version in [base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA]:
      group.add_argument(
          '--manifest-id',
          help='Manifest Id of a previous deployment. '
          'This flag cannot be used with --config.',
          dest='manifest_id')

    labels_util.AddUpdateLabelsFlags(parser)

    parser.add_argument(
        '--preview',
        help='Preview the requested update without making any changes to the'
        'underlying resources. (default=False)',
        dest='preview',
        default=False,
        action='store_true')

    parser.add_argument(
        '--create-policy',
        help='Create policy for resources that have changed in the update.',
        default='CREATE_OR_ACQUIRE',
        choices=(sorted(dm_v2_base.GetMessages()
                        .DeploymentmanagerDeploymentsUpdateRequest
                        .CreatePolicyValueValuesEnum.to_dict().keys())))

    flags.AddDeletePolicyFlag(
        parser, dm_v2_base.GetMessages()
        .DeploymentmanagerDeploymentsUpdateRequest)
    flags.AddFingerprintFlag(parser)

    parser.display_info.AddFormat(flags.RESOURCES_AND_OUTPUTS_FORMAT)
Exemplo n.º 3
0
    def Args(parser):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    """
        flags.AddAsyncFlag(parser)
        type_providers.AddTypeProviderNameFlag(parser)
Exemplo n.º 4
0
  def Args(parser):
    """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    """
    parser.add_argument('deployment_name', nargs='+', help='Deployment name.')
    Delete._delete_policy_flag_map.choice_arg.AddToParser(parser)
    flags.AddAsyncFlag(parser)
Exemplo n.º 5
0
    def Args(parser):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    """
        flags.AddDeploymentNameFlag(parser)
        flags.AddAsyncFlag(parser)
        flags.AddFingerprintFlag(parser)
  def Args(parser):
    """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    """
    parser.add_argument('deployment_name', nargs='+', help='Deployment name.')
    flags.AddDeletePolicyFlag(
        parser, dm_base.GetMessages().DeploymentmanagerDeploymentsDeleteRequest)
    flags.AddAsyncFlag(parser)
Exemplo n.º 7
0
    def Args(parser, version=base.ReleaseTrack.GA):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
      version: The version this tool is running as. base.ReleaseTrack.GA
          is the default.
    """
        group = parser.add_mutually_exclusive_group()

        flags.AddAsyncFlag(group)
        flags.AddDeploymentNameFlag(parser)
        flags.AddPropertiesFlag(parser)

        if version in [base.ReleaseTrack.ALPHA]:
            labels_util.AddCreateLabelsFlags(parser)

            group.add_argument(
                '--automatic-rollback-on-error',
                help=
                'If the create request results in a deployment with resource '
                'errors, delete that deployment immediately after creation. '
                '(default=False)',
                dest='automatic_rollback',
                default=False,
                action='store_true')

        parser.add_argument(
            '--description',
            help='Optional description of the deployment to insert.',
            dest='description')

        parser.add_argument(
            '--config',
            help='Filename of config that specifies resources to deploy. '
            'More information is available at '
            'https://cloud.google.com/deployment-manager/docs/configuration/.',
            dest='config',
            required=True)

        parser.add_argument(
            '--preview',
            help=
            'Preview the requested create without actually instantiating the '
            'underlying resources. (default=False)',
            dest='preview',
            default=False,
            action='store_true')

        parser.display_info.AddFormat(flags.RESOURCES_AND_OUTPUTS_FORMAT)
Exemplo n.º 8
0
    def Args(parser):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    """
        flags.AddAsyncFlag(parser)
        composite_types.AddCompositeTypeNameFlag(parser)
        composite_types.AddDescriptionFlag(parser)
        composite_types.AddStatusFlag(parser)
        labels_util.AddUpdateLabelsFlags(parser, enable_clear=False)
Exemplo n.º 9
0
    def Args(parser):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    """
        flags.AddAsyncFlag(parser)
        type_providers.AddTypeProviderNameFlag(parser)
        type_providers.AddApiOptionsFileFlag(parser)
        type_providers.AddDescriptionFlag(parser)
        type_providers.AddDescriptorUrlFlag(parser)
        labels_util.AddCreateLabelsFlags(parser)
Exemplo n.º 10
0
  def Args(parser, version=base.ReleaseTrack.GA):
    """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
      version: The version this tool is running as. base.ReleaseTrack.GA
          is the default.
    """
    flags.AddDeploymentNameFlag(parser)
    flags.AddPropertiesFlag(parser)
    flags.AddAsyncFlag(parser)

    parser.add_argument(
        '--description',
        help='The new description of the deployment.',
        dest='description'
    )

    group = parser.add_mutually_exclusive_group()
    flags.AddConfigFlags(group)

    if version in [base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA]:
      group.add_argument(
          '--manifest-id',
          help='Manifest Id of a previous deployment. '
          'This flag cannot be used with --config.',
          dest='manifest_id')

    labels_util.AddUpdateLabelsFlags(parser, enable_clear=False)

    parser.add_argument(
        '--preview',
        help='Preview the requested update without making any changes to the'
        'underlying resources. (default=False)',
        dest='preview',
        default=False,
        action='store_true')

    if version in [base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA]:
      Update._create_policy_v2beta_flag_map.choice_arg.AddToParser(parser)
    else:
      Update._create_policy_flag_map.choice_arg.AddToParser(parser)

    Update._delete_policy_flag_map.choice_arg.AddToParser(parser)
    flags.AddFingerprintFlag(parser)

    parser.display_info.AddFormat(flags.RESOURCES_AND_OUTPUTS_FORMAT)