func()

in cli_tools/gce_vm_image_import/cli/args.go [96:225]


func (args *imageImportArgs) registerFlags(flagSet *flag.FlagSet) {
	flagSet.Var((*flags.LowerTrimmedString)(&args.ClientID), importer.ClientFlag,
		"Identifies the client of the importer, e.g. 'gcloud', 'pantheon', or 'api'.")

	flagSet.Var((*flags.TrimmedString)(&args.ClientVersion), "client_version",
		"Identifies the version of the client of the importer.")

	flagSet.Var((*flags.TrimmedString)(&args.Project), "project",
		"The project where workflows will be run, and where the resulting image will be stored.")

	flagSet.Var((*flags.TrimmedString)(&args.Network), "network",
		"Name of the network in your project to use for the image import. "+
			"The network must have access to Google Cloud Storage. "+
			"If not specified, the network named default is used.")

	flagSet.Var((*flags.TrimmedString)(&args.Subnet), "subnet",
		"Name of the subnetwork in your project to use for the image import. "+
			"If the network resource is in legacy mode, do not provide this property. "+
			"If the network is in auto subnet mode, providing the subnetwork is optional. "+
			"If the network is in custom subnet mode, then this field should be specified. "+
			"Zone should be specified if this field is specified.")

	flagSet.Var((*flags.LowerTrimmedString)(&args.Zone), "zone",
		"The zone where workflows will be run, and where the resulting image will be stored.")

	flagSet.Var((*flags.TrimmedString)(&args.ScratchBucketGcsPath), "scratch_bucket_gcs_path",
		"A system-generated bucket name will be used if omitted. "+
			"If the bucket doesn't exist, it will be created. If it does exist, it will be reused.")

	flagSet.Var((*flags.TrimmedString)(&args.Oauth), "oauth",
		"Path to oauth json file.")

	flagSet.Var((*flags.TrimmedString)(&args.EndpointsOverride.Compute), "compute_endpoint_override",
		"API endpoint to override default for Compute.")

	flagSet.Var((*flags.TrimmedString)(&args.EndpointsOverride.Storage), "storage_endpoint_override",
		"API endpoint to override default for Storage.")

	flagSet.Var((*flags.TrimmedString)(&args.EndpointsOverride.CloudLogging), "cloud_logging_endpoint_override",
		"API endpoint to override default for Cloud Logging.")

	flagSet.Var((*flags.TrimmedString)(&args.ComputeServiceAccount), "compute_service_account",
		"Compute service account to be used by importer Virtual Machine. When empty, the Compute Engine default service account is used.")

	flagSet.BoolVar(&args.GcsLogsDisabled, "disable_gcs_logging", false,
		"Do not store logs in GCS.")

	flagSet.BoolVar(&args.CloudLogsDisabled, "disable_cloud_logging", false,
		"Do not store logs in Cloud Logging.")

	flagSet.BoolVar(&args.StdoutLogsDisabled, "disable_stdout_logging", false,
		"Do not write logs to stdout.")

	flagSet.BoolVar(&args.NoExternalIP, "no_external_ip", false,
		"Temporary VMs are created in your project during {operation}. "+
			"Set this flag so that these temporary VMs are not assigned external IP addresses. "+
			"For more information, see: https://cloud.google.com/compute/docs/import/importing-virtual-disks#no-external-ip")

	flagSet.Var((*flags.TrimmedString)(&args.ExecutionID), "execution_id",
		"The execution ID to differentiate GCE resources of each imports.")

	flagSet.Bool("kms_key", false, "Reserved for future use.")
	flagSet.Bool("kms_keyring", false, "Reserved for future use.")
	flagSet.Bool("kms_location", false, "Reserved for future use.")
	flagSet.Bool("kms_project", false, "Reserved for future use.")

	flagSet.Var((*flags.LowerTrimmedString)(&args.ImageName), importer.ImageFlag,
		"Name of the disk image to create.")

	flagSet.Var((*flags.TrimmedString)(&args.Family), "family",
		"Family to set for the imported image.")

	flagSet.Var((*flags.TrimmedString)(&args.Description), "description",
		"Description to set for the imported image.")

	flagSet.Var((*flags.KeyValueString)(&args.Labels), "labels",
		"List of label KEY=VALUE pairs to add. "+
			"For more information, see: https://cloud.google.com/compute/docs/labeling-resources")

	flagSet.Var((*flags.LowerTrimmedString)(&args.StorageLocation), "storage_location",
		"Specifies a Cloud Storage location, either a region or a multi-region, "+
			"where image content is to be stored. If not specified, the multi-region "+
			"location closest to the source is chosen automatically.")

	flagSet.Var((*flags.TrimmedString)(&args.SourceFile), "source_file",
		"The Cloud Storage URI of the virtual disk file to import.")

	flagSet.Var((*flags.TrimmedString)(&args.SourceImage), "source_image",
		"An existing Compute Engine image from which to import.")

	flagSet.BoolVar(&args.BYOL, importer.BYOLFlag, false,
		"Import using an existing license. These are equivalent: "+
			"`-os=rhel-8 -byol`, `-os=rhel-8-byol -byol`, and `-os=rhel-8-byol`")

	flagSet.BoolVar(&args.DataDisk, importer.DataDiskFlag, false,
		"Specifies that the disk has no bootable OS installed on it. "+
			"Imports the disk without making it bootable or installing Google tools on it.")

	flagSet.Var((*flags.LowerTrimmedString)(&args.OS), importer.OSFlag,
		"Specifies the OS of the image being imported. OS must be one of: "+
			strings.Join(daisyutils.GetSortedOSIDs(), ", ")+".")

	flagSet.BoolVar(&args.NoGuestEnvironment, "no_guest_environment", false,
		"When enabled, the Google Guest Environment will not be installed.")

	flagSet.BoolVar(&args.NestedVirtualizationEnabled, "enable_nested_virtualization", true,
		"When enabled, temporary worker VMs will be created with enabled nested virtualization. "+
			"See https://cloud.google.com/compute/docs/instances/nested-virtualization/enabling for details.")

	flagSet.Var((*flags.StringArrayFlag)(&args.WorkerMachineSeries), "worker_machine_series",
		"The import tool automatically selects the machine series for temporary worker VMs based on the execution context. "+
			"The argument overrides this behavior and specifies the machine series to use for worker VMs. "+
			"Additionally it is possible to specify fallback machine series by setting this argument twice. "+
			"For example, -worker_machine_series n1 -worker_machine_series n2")

	flagSet.DurationVar(&args.Timeout, "timeout", time.Hour*2,
		"Maximum time a build can last before it is failed as TIMEOUT. For example, "+
			"specifying 2h will fail the process after 2 hours. See $ gcloud topic datetimes "+
			"for information on duration formats.")

	flagSet.Var((*flags.TrimmedString)(&args.CustomWorkflow), importer.CustomWorkflowFlag,
		"A Daisy workflow JSON file to use for translation.")

	flagSet.BoolVar(&args.UefiCompatible, "uefi_compatible", false,
		"Enables UEFI booting, which is an alternative system boot method. "+
			"Most public images use the GRUB bootloader as their primary boot method.")

	flagSet.BoolVar(&args.SysprepWindows, "sysprep_windows", false,
		"Generalize image using Windows Sysprep. Only applicable to Windows.")
}