Esempio n. 1
0
 def Args(parser):
     instance_groups_flags.GetInstanceGroupManagerArg(
         region_flag=True).AddArgument(
             parser, operation_type='update per instance config for')
     instance_groups_flags.AddMigStatefulFlagsForInstanceConfigs(
         parser, for_update=True)
     instance_groups_flags.AddMigStatefulUpdateInstanceFlag(parser)
 def Args(cls, parser):
     instance_groups_flags.GetInstanceGroupManagerArg(
         region_flag=True).AddArgument(
             parser,
             operation_type='update the all instances configuration for')
     managed_instance_groups_flags.AddFlagsForUpdateAllInstancesConfig(
         parser)
Esempio n. 3
0
 def Args(parser):
     parser.display_info.AddFormat(managed_flags.DEFAULT_LIST_FORMAT)
     _AddInstanceGroupManagerArgs(parser)
     igm_arg = instance_groups_flags.GetInstanceGroupManagerArg(
         zones_flag=True)
     igm_arg.AddArgument(parser, operation_type='create')
     instance_groups_flags.AddZonesFlag(parser)
Esempio n. 4
0
 def Args(parser):
     instance_groups_flags.GetInstanceGroupManagerArg(
         region_flag=True).AddArgument(
             parser, operation_type='describe an instance in')
     parser.add_argument('--instance',
                         required=True,
                         help='Name of the managed instance to describe.')
Esempio n. 5
0
 def Args(parser):
     instance_groups_flags.GetInstanceGroupManagerArg(
         region_flag=False).AddArgument(parser, operation_type='describe')
     parser.display_info.AddFormat("""table(
     items.instance,
     items.override.disks.deviceName)
 """)
Esempio n. 6
0
 def Args(parser):
     instance_groups_flags.GetInstanceGroupManagerArg(
         region_flag=False).AddArgument(parser, operation_type='update')
     parser.add_argument(
         '--instances',
         metavar='INSTANCE',
         type=arg_parsers.ArgList(min_length=1),
     )
Esempio n. 7
0
 def CreateGroupReference(self, args, client, resources):
     group_ref = (instance_groups_flags.GetInstanceGroupManagerArg(
     ).ResolveAsResource)(args,
                          resources,
                          default_scope=compute_scope.ScopeEnum.ZONE,
                          scope_lister=flags.GetDefaultScopeLister(client))
     if _IsZonalGroup(group_ref):
         zonal_resource_fetcher = zone_utils.ZoneResourceFetcher(client)
         zonal_resource_fetcher.WarnForZonalCreation([group_ref])
     return group_ref
Esempio n. 8
0
 def Args(cls, parser):
     parser.display_info.AddFormat(managed_flags.DEFAULT_LIST_FORMAT)
     _AddInstanceGroupManagerArgs(parser=parser)
     auto_healing_utils.AddAutohealingArgs(parser)
     igm_arg = instance_groups_flags.GetInstanceGroupManagerArg(
         zones_flag=True)
     igm_arg.AddArgument(parser, operation_type='create')
     instance_groups_flags.AddZonesFlag(parser)
     instance_groups_flags.AddMigCreateStatefulFlags(parser)
     instance_groups_flags.AddMigInstanceRedistributionTypeFlag(parser)
Esempio n. 9
0
 def Args(parser):
   instance_groups_flags.GetInstanceGroupManagerArg(
       region_flag=False).AddArgument(
           parser, operation_type='delete')
   parser.add_argument(
       '--instances',
       metavar='INSTANCE',
       required=True,
       type=arg_parsers.ArgList(min_length=1),
       help='Names of instances to delete instance-configs from.')
Esempio n. 10
0
 def Args(cls, parser):
   health_check_group = parser.add_mutually_exclusive_group()
   cls.HEALTH_CHECK_ARG.AddArgument(health_check_group)
   parser.display_info.AddFormat(managed_flags.DEFAULT_LIST_FORMAT)
   _AddInstanceGroupManagerArgs(parser=parser)
   auto_healing_utils.AddAutohealingArgs(
       parser=parser, health_check_group=health_check_group)
   igm_arg = instance_groups_flags.GetInstanceGroupManagerArg(zones_flag=True)
   igm_arg.AddArgument(parser, operation_type='create')
   instance_groups_flags.AddZonesFlag(parser)
Esempio n. 11
0
 def CreateGroupReference(self, args, client, resources):
   if args.zones:
     zone_ref = resources.Parse(
         args.zones[0], collection='compute.zones',
         params={'project': properties.VALUES.core.project.GetOrFail})
     region = utils.ZoneNameToRegionName(zone_ref.Name())
     return resources.Parse(
         args.name,
         params={
             'region': region,
             'project': properties.VALUES.core.project.GetOrFail},
         collection='compute.regionInstanceGroupManagers')
   return (instance_groups_flags.GetInstanceGroupManagerArg().
           ResolveAsResource)(
               args, resources,
               default_scope=compute_scope.ScopeEnum.ZONE,
               scope_lister=flags.GetDefaultScopeLister(client))
Esempio n. 12
0
  def Run(self, args):
    holder = base_classes.ComputeApiHolder(self.ReleaseTrack())
    project = properties.VALUES.core.project.Get(required=True)
    igm_ref = (
        instance_groups_flags.GetInstanceGroupManagerArg(
            region_flag=False).
        ResolveAsResource)(
            args, holder.resources, default_scope=compute_scope.ScopeEnum.ZONE,
            scope_lister=flags.GetDefaultScopeLister(holder.client, project))

    request = self._GetDeletePerInstanceConfigRequests(
        holder, igm_ref, args.instances)

    service = holder.client.apitools_client.instanceGroupManagers
    operation = service.DeletePerInstanceConfigs(request)
    operation_ref = holder.resources.Parse(
        operation.selfLink, collection='compute.zoneOperations')
    operation_poller = poller.Poller(service)
    return waiter.WaitFor(
        operation_poller, operation_ref, 'Deleting instance configs.')
Esempio n. 13
0
    def Run(self, args):
        holder = base_classes.ComputeApiHolder(self.ReleaseTrack())
        client = holder.client
        project = properties.VALUES.core.project.Get(required=True)
        igm_ref = (instance_groups_flags.GetInstanceGroupManagerArg(
            region_flag=False).ResolveAsResource)(
                args,
                holder.resources,
                default_scope=compute_scope.ScopeEnum.ZONE,
                scope_lister=flags.GetDefaultScopeLister(
                    holder.client, project))

        request = (client.messages.
                   ComputeInstanceGroupManagersListPerInstanceConfigsRequest)(
                       filter=args.filter,
                       instanceGroupManager=igm_ref.Name(),
                       project=igm_ref.project,
                       zone=igm_ref.zone,
                   )

        return client.MakeRequests([
            (client.apitools_client.instanceGroupManagers,
             'ListPerInstanceConfigs', request)
        ])
Esempio n. 14
0
 def Args(parser):
     parser.display_info.AddFormat(managed_flags.DEFAULT_LIST_FORMAT)
     _AddInstanceGroupManagerArgs(parser=parser)
     instance_groups_flags.GetInstanceGroupManagerArg().AddArgument(
         parser, operation_type='create')
Esempio n. 15
0
 def Args(parser):
     instance_groups_flags.GetInstanceGroupManagerArg(
         region_flag=False).AddArgument(parser, operation_type='update')
     parser.add_argument('--instance', )
     instance_groups_flags.AddSettingStatefulDisksFlag(parser,
                                                       required=True)
Esempio n. 16
0
 def Args(parser):
     instance_groups_flags.GetInstanceGroupManagerArg(
         region_flag=True).AddArgument(parser,
                                       operation_type='create instance in')
     instance_groups_flags.AddCreateInstancesFlags(parser)