def _CommonArgs(parser):
    """Register parser args common to all tracks."""
    metadata_utils.AddMetadataArgs(parser)
    instance_utils.AddDiskArgs(parser)
    instance_utils.AddLocalSsdArgs(parser)
    instance_utils.AddImageArgs(parser)
    instance_utils.AddCanIpForwardArgs(parser)
    instance_utils.AddAddressArgs(parser, instances=True)
    instance_utils.AddMachineTypeArgs(parser)
    instance_utils.AddMaintenancePolicyArgs(parser)
    instance_utils.AddNoRestartOnFailureArgs(parser)
    instance_utils.AddPreemptibleVmArgs(parser)
    instance_utils.AddScopeArgs(parser)
    instance_utils.AddTagsArgs(parser)
    instance_utils.AddCustomMachineTypeArgs(parser)
    instance_utils.AddNetworkArgs(parser)

    parser.add_argument(
        '--description',
        help='Specifies a textual description of the instances.')

    parser.add_argument('names',
                        metavar='NAME',
                        nargs='+',
                        help='The names of the instances to create.')

    utils.AddZoneFlag(parser,
                      resource_type='instances',
                      operation_type='create')
Пример #2
0
def _CommonArgs(parser):
    """Common arguments used in Alpha, Beta, and GA."""
    metadata_utils.AddMetadataArgs(parser)
    instance_utils.AddDiskArgs(parser)
    instance_utils.AddLocalSsdArgs(parser)
    instance_utils.AddCanIpForwardArgs(parser)
    instance_utils.AddAddressArgs(parser, instances=False)
    instance_utils.AddMachineTypeArgs(parser)
    instance_utils.AddMaintenancePolicyArgs(parser)
    instance_utils.AddNoRestartOnFailureArgs(parser)
    instance_utils.AddPreemptibleVmArgs(parser)
    instance_utils.AddScopeArgs(parser)
    instance_utils.AddTagsArgs(parser)
    instance_utils.AddCustomMachineTypeArgs(parser)

    instance_utils.AddNetworkArgs(parser)
    flags.AddRegionFlag(parser,
                        resource_type='instance template',
                        operation_type='create')

    parser.add_argument(
        '--description',
        help='Specifies a textual description for the instance template.')

    parser.add_argument('name',
                        metavar='NAME',
                        help='The name of the instance template to create.')
    def Args(parser):

        parser.add_argument(
            'name',
            metavar='NAME',
            completion_resource='compute.instances',
            help='The name of the instance to change the machine type for.')

        instance_utils.AddMachineTypeArgs(parser)
        instance_utils.AddCustomMachineTypeArgs(parser)

        flags.AddZoneFlag(parser,
                          resource_type='instance',
                          operation_type='change the machine type for')