예제 #1
0
def _DoFilter(context, http, api_client_default, args):
    """Set up paramter defaults and endpoints."""
    if args.endpoint:
        log.warn('The --endpoint flag is deprecated and will be removed.  '
                 'Set the api_endpoint_overrides/compute property instead.  '
                 'e.g. gcloud config set api_client_overrides/compute beta')
    utils.SetResourceParamDefaults()
    utils.UpdateContextEndpointEntries(context, http, api_client_default)
예제 #2
0
def _DoFilter(context, http, api_client_default, args):
    """Set up paramter defaults and endpoints."""
    if args.endpoint:
        log.warn('The --endpoint flag is deprecated and will be removed.  '
                 'Set the api_endpoint_overrides/compute property instead.  '
                 '\n\n'
                 'You can do this persistently with, e.g., '
                 '`gcloud config set api_endpoint_overrides/compute '
                 'https://www.googleapis.com/compute/staging_v1`.'
                 '\n\n'
                 'Or you can do this on a one-off basis by setting the '
                 'CLOUDSDK_API_CLIENT_OVERRIDES_COMPUTE environment variable.')
    utils.SetResourceParamDefaults()
    utils.UpdateContextEndpointEntries(context, http, api_client_default)
예제 #3
0
 def FromContext(cls, context):
     """Updates required global state and constructs ConfigurationHelper."""
     http = context['http']
     compute_utils.UpdateContextEndpointEntries(context, http)
     batch_url = context['batch-url']
     compute = context['compute']
     resources = context['resources']
     zone_prop = properties.VALUES.compute.zone
     project_prop = properties.VALUES.core.project
     project = project_prop.Get(required=True)
     resources.SetParamDefault('compute', None, 'project',
                               resolvers.FromProperty(project_prop))
     resources.SetParamDefault('compute', None, 'zone',
                               resolvers.FromProperty(zone_prop))
     return cls(batch_url, compute, http, project, resources)
예제 #4
0
    def Filter(self, context, args):
        http = cli.Http()
        core_values = properties.VALUES.core
        compute_values = properties.VALUES.compute
        context['http'] = http
        context['project'] = core_values.project.Get(required=True)

        for api, param, prop in (('compute', 'project', core_values.project),
                                 ('resourceviews', 'projectName',
                                  core_values.project), ('compute', 'zone',
                                                         compute_values.zone),
                                 ('resourceviews', 'zone',
                                  compute_values.zone),
                                 ('compute', 'region', compute_values.region),
                                 ('resourceviews', 'region',
                                  compute_values.region)):
            resources.SetParamDefault(api=api,
                                      collection=None,
                                      param=param,
                                      resolver=resolvers.FromProperty(prop))

        utils.UpdateContextEndpointEntries(context, )
예제 #5
0
def _DoFilter(context, http, api_client_default, args):
    """Set up paramter defaults and endpoints."""
    utils.SetResourceParamDefaults()
    utils.UpdateContextEndpointEntries(context, http, api_client_default)