def Args(parser): """Register parser args.""" _Args(parser, container_mount_enabled=True) instances_flags.AddNetworkTierArgs(parser, instance=True) instances_flags.AddContainerMountDiskFlag(parser) instances_flags.AddLocalSsdArgsWithSize(parser) instances_flags.AddMinCpuPlatformArgs(parser, base.ReleaseTrack.BETA)
def _Args(parser, release_track, container_mount_enabled=False, enable_guest_accelerators=False, support_multi_writer=True): """Add flags shared by all release tracks.""" parser.display_info.AddFormat(instance_templates_flags.DEFAULT_LIST_FORMAT) metadata_utils.AddMetadataArgs(parser) instances_flags.AddDiskArgs( parser, container_mount_enabled=container_mount_enabled) instances_flags.AddCreateDiskArgs( parser, container_mount_enabled=container_mount_enabled, support_multi_writer=support_multi_writer) if release_track == base.ReleaseTrack.ALPHA: instances_flags.AddLocalSsdArgsWithSize(parser) elif release_track == base.ReleaseTrack.BETA: instances_flags.AddLocalSsdArgs(parser) instances_flags.AddCanIpForwardArgs(parser) instances_flags.AddContainerMountDiskFlag(parser) instances_flags.AddAddressArgs(parser, instances=False, containers=True) instances_flags.AddMachineTypeArgs(parser) deprecate_maintenance_policy = release_track in [base.ReleaseTrack.ALPHA] instances_flags.AddMaintenancePolicyArgs(parser, deprecate_maintenance_policy) instances_flags.AddNoRestartOnFailureArgs(parser) instances_flags.AddPreemptibleVmArgs(parser) instances_flags.AddServiceAccountAndScopeArgs(parser, False) instances_flags.AddTagsArgs(parser) instances_flags.AddCustomMachineTypeArgs(parser) instances_flags.AddNetworkArgs(parser) instances_flags.AddKonletArgs(parser) instances_flags.AddImageArgs(parser) instances_flags.AddMinCpuPlatformArgs(parser, release_track) instances_flags.AddNetworkTierArgs(parser, instance=True) instances_flags.AddConfidentialComputeArgs(parser) instances_flags.AddShieldedInstanceConfigArgs(parser) labels_util.AddCreateLabelsFlags(parser) instances_flags.AddPrivateNetworkIpArgs(parser) if enable_guest_accelerators: instances_flags.AddAcceleratorArgs(parser) flags.AddRegionFlag(parser, resource_type='instance template', operation_type='create') parser.add_argument( '--description', help='Specifies a textual description for the instance template.') CreateWithContainer.InstanceTemplateArg = ( instance_templates_flags.MakeInstanceTemplateArg()) CreateWithContainer.InstanceTemplateArg.AddArgument( parser, operation_type='create') parser.display_info.AddCacheUpdater(completers.InstanceTemplatesCompleter)
def Args(parser): _Args(parser, deprecate_maintenance_policy=True, container_mount_enabled=True) instances_flags.AddNetworkTierArgs(parser, instance=True) instances_flags.AddContainerMountDiskFlag(parser) instances_flags.AddLocalSsdArgsWithSize(parser) instances_flags.AddLocalNvdimmArgs(parser) instances_flags.AddMinCpuPlatformArgs(parser, base.ReleaseTrack.ALPHA)
def _Args(parser, deprecate_maintenance_policy=False, container_mount_enabled=False, support_multi_writer=True): """Add flags shared by all release tracks.""" parser.display_info.AddFormat(instances_flags.DEFAULT_LIST_FORMAT) metadata_utils.AddMetadataArgs(parser) instances_flags.AddDiskArgs( parser, True, container_mount_enabled=container_mount_enabled) instances_flags.AddCreateDiskArgs( parser, container_mount_enabled=container_mount_enabled, support_multi_writer=support_multi_writer) instances_flags.AddCanIpForwardArgs(parser) instances_flags.AddContainerMountDiskFlag(parser) instances_flags.AddAddressArgs(parser, instances=True, containers=True) instances_flags.AddAcceleratorArgs(parser) instances_flags.AddMachineTypeArgs(parser) instances_flags.AddMaintenancePolicyArgs( parser, deprecate=deprecate_maintenance_policy) instances_flags.AddNoRestartOnFailureArgs(parser) instances_flags.AddPreemptibleVmArgs(parser) instances_flags.AddProvisioningModelVmArgs(parser) instances_flags.AddInstanceTerminationActionVmArgs(parser) instances_flags.AddServiceAccountAndScopeArgs(parser, False) instances_flags.AddTagsArgs(parser) instances_flags.AddCustomMachineTypeArgs(parser) instances_flags.AddNetworkArgs(parser) instances_flags.AddPrivateNetworkIpArgs(parser) instances_flags.AddNetworkPerformanceConfigsArgs(parser) instances_flags.AddShieldedInstanceConfigArgs( parser=parser, for_container=True) instances_flags.AddKonletArgs(parser) instances_flags.AddPublicPtrArgs(parser, instance=True) instances_flags.AddImageArgs(parser) instances_flags.AddConfidentialComputeArgs(parser) instances_flags.AddNestedVirtualizationArgs(parser) instances_flags.AddThreadsPerCoreArgs(parser) labels_util.AddCreateLabelsFlags(parser) parser.add_argument( '--description', help='Specifies a textual description of the instances.') instances_flags.INSTANCES_ARG.AddArgument(parser, operation_type='create') CreateWithContainer.SOURCE_INSTANCE_TEMPLATE = ( instances_flags.MakeSourceInstanceTemplateArg()) CreateWithContainer.SOURCE_INSTANCE_TEMPLATE.AddArgument(parser) parser.display_info.AddCacheUpdater(completers.InstancesCompleter)
def Args(parser): _Args(parser, base.ReleaseTrack.ALPHA, container_mount_enabled=True) instances_flags.AddContainerMountDiskFlag(parser) instances_flags.AddLocalNvdimmArgs(parser)
def Args(parser): _Args(parser, base.ReleaseTrack.BETA, container_mount_enabled=True) instances_flags.AddContainerMountDiskFlag(parser)