Return an operation id for a service method.

    Args:
      service_name: The name of the service.
      protorpc_method_name: The ProtoRPC method name.

    Returns:
      A string representing the operation id.
357943
def _construct_operation_id(self, service_name, protorpc_method_name):
    

    # camelCase the ProtoRPC method name
    method_name_camel = util.snake_case_to_headless_camel_case(
        protorpc_method_name)

    return '{0}_{1}'.format(service_name, method_name_camel)
670700
def __schema_descriptor(self, services):
    
    methods_desc = {}

    for service in services:
      protorpc_methods = service.all_remote_methods()
      for protorpc_method_name in protorpc_methods.iterkeys():
        rosy_method = '%s.%s' % (service.__name__, protorpc_method_name)
        method_id = self.__id_from_name[rosy_method]

        request_response = {}

        request_schema_id = self.__request_schema.get(method_id)
        if request_schema_id:
          request_response['request'] = {
              '$ref': request_schema_id
              }

        response_schema_id = self.__response_schema.get(method_id)
        if response_schema_id:
          request_response['response'] = {
              '$ref': response_schema_id
              }

        methods_desc[rosy_method] = request_response

    descriptor = {
        'methods': methods_desc,
        'schemas': self.__parser.schemas(),
        }

    return descriptor
791245
def get_id_generator(self, name):
        
        atomic_long = self.get_atomic_long(ID_GENERATOR_ATOMIC_LONG_PREFIX + name)
        return self.proxy.get_or_create(ID_GENERATOR_SERVICE, name, atomic_long=atomic_long)
1176151
def queue_name_for_method(method_name)
      return queue_names[method_name] if queue_names[method_name]

      queue_name = generate_queue_name(method_name)
      queue_for(method_name, queue_name)
      return queue_name
    end
136992
public ServiceMethod getMethod(String name) {
        for (ServiceMethod serviceMethod : getMethods()) {
            if (serviceMethod.getName().equals(name)) {
                return serviceMethod;
            }
        }
        return null;
    }
645149
def list(self, service_name, **params):
        
        result = self._invoke_call(service_name, 'list', **params)
        if result is not None:
            return result.get(service_name, list())
        return list()
635834
def _method_url(self, method_name):
        
        return "{base_url}/api/{api}/{method}".format(
            base_url=self._base_url(),
            api=self.api_version,
            method=method_name
        )
498959
def resolve_service_id(self, service_name=None, service_type=None):
        """"""
        services = [s._info for s in self.api.services.list()]

        service_name = service_name.lower()
        for s in services:
            name = s['name'].lower()
            if service_type and service_name:
                if (service_name == name and service_type == s['type']):
                    return s['id']
            elif service_name and service_name == name:
                return s['id']
            elif service_type and service_type == s['type']:
                return s['id']
        return None
612200
def get_service(self, name):
        
        self._convert_connected_app()
        if not self.project_config.services or name not in self.project_config.services:
            self._raise_service_not_valid(name)
        if name not in self.services:
            self._raise_service_not_configured(name)

        return self._get_service(name)
1301322
def getClientModuleName(self):
        
        name = GetModuleBaseNameFromWSDL(self._wsdl)
        if not name:
            raise WsdlGeneratorError, 'could not determine a service name'
        
        if self.client_module_suffix is None:
            return name

        return '%s%s' %(name, self.client_module_suffix)
706368
def get_service_name(self, name, search_filter):
        
        service_filter = "services[?name=='{}'].metadata.name".format(name)
        return one(jmespath.search(service_filter, self.get(search_filter)))
1021969
def get_operation_device(self, operation_name):
    
    operation = self._name_to_operation(operation_name)
    if isinstance(operation, tf.Operation):
      return operation.device
    else:  # mtf.Operation
      return None
122872
def get_service_name(wrapped, instance, args, kwargs):
    """"""
    if 'serviceAbbreviation' not in instance._service_model.metadata:
        return instance._service_model.metadata['endpointPrefix']
    return instance._service_model.metadata['serviceAbbreviation']
840247
def service_info(self, short_name):
        

        if short_name not in self.services:
            raise ArgumentError("Unknown service name", short_name=short_name)

        info = {}
        info['short_name'] = short_name
        info['long_name'] = self.services[short_name]['state'].long_name
        info['preregistered'] = self.services[short_name]['state'].preregistered

        return info
499296
def service_checks(self, name):
        
        return [
            ServiceCheckStub(
                ensure_unicode(stub.check_id),
                ensure_unicode(stub.name),
                stub.status,
                normalize_tags(stub.tags),
                ensure_unicode(stub.hostname),
                ensure_unicode(stub.message),
            )
            for stub in self._service_checks.get(to_string(name), [])
        ]
1037505
def convert_in_oid(service_name):
    
    s = service_name
    # convert the service_name to ascci
    service_ascii = [ord(c) for c in s] 
    # we need the length of the service name
    length = str(len(s))
    # make the oid
    oid = base_oid + "." + length + "." + ".".join(str(x) for x in service_ascii)
    return oid
624352
def getMethodByName(obj, name):

    
    try:#to get a method by asking the service
        obj = obj._getMethodByName(name)
    except:
        #assumed a childObject is ment 
        #split the name from objName.childObjName... -> [objName, childObjName, ...]
        #and get all objects up to the last in list with name checking from the service object
        names = name.split(".")
        for name in names:
            if nameAllowed(name):
                obj = getattr(obj, name)
            else:
                raise MethodNameNotAllowed()
        
    return obj