Invokes the /container-xxxx/describe API method.

    For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Containers-for-Execution#API-method%3A-%2Fcontainer-xxxx%2Fdescribe
559447
def container_describe(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/describe' % object_id, input_params, always_retry=always_retry, **kwargs)
226705
@Override
	public Object invoke(final Invocation invocation) throws Exception {
		if (invocation == null) throw new NullPointerException("invocation");

		MethodDescriptor<?, ?> method = invocation.getMethod();
		DataTypeDescriptor<?> resultd = (DataTypeDescriptor<?>) method.getResult();
		MessageDescriptor<? extends Message> excd = descriptor.getExc();

		RpcRequest request = protocol.getRequest(invocation);
		return session.send(request, resultd, excd);
	}
1099823
@Override
    public String describe(Session session) {

        try {
            return describeImpl(session);
        }
        catch (Exception e) {
            e.printStackTrace();

            return e.toString();
        }
    }
775020
def _synopsis(self, container_settings, container_status=''):

        '''  '''
    
    # compose default response
        settings = {
            'container_status': container_settings['State']['Status'],
            'container_exit': container_settings['State']['ExitCode'],
            'container_ip': container_settings['NetworkSettings']['IPAddress'],
            'image_name': container_settings['Config']['Image'],
            'container_alias': container_settings['Name'].replace('/',''),
            'container_variables': {},
            'mapped_ports': {},
            'mounted_volumes': {},
            'container_networks': []
        }
    
    # parse fields nested in container settings
        import re
        num_pattern = re.compile('\d+')
        if container_settings['NetworkSettings']['Ports']:
            for key, value in container_settings['NetworkSettings']['Ports'].items():
                if value:
                    port = num_pattern.findall(value[0]['HostPort'])[0]
                    settings['mapped_ports'][port] = num_pattern.findall(key)[0]
        elif container_settings['HostConfig']['PortBindings']:
            for key, value in container_settings['HostConfig']['PortBindings'].items():
                port = num_pattern.findall(value[0]['HostPort'])[0]
                settings['mapped_ports'][port] = num_pattern.findall(key)[0]
        if container_settings['Config']['Env']:
            for variable in container_settings['Config']['Env']:
                k, v = variable.split('=')
                settings['container_variables'][k] = v
        for volume in container_settings['Mounts']:
            system_path = volume['Source']
            container_path = volume['Destination']
            settings['mounted_volumes'][system_path] = container_path
        if container_settings['NetworkSettings']:
            if container_settings['NetworkSettings']['Networks']:
                for key in container_settings['NetworkSettings']['Networks'].keys():
                    settings['container_networks'].append(key)

    # determine stopped status
        if settings['container_status'] == 'exited':
            if not container_status:
                try:
                    from subprocess import check_output, STDOUT
                    sys_command = 'docker logs --tail 1 %s' % settings['container_alias']
                    check_output(sys_command, shell=True, stderr=STDOUT).decode('utf-8')
                    settings['container_status'] = 'stopped'
                except:
                    pass
            else:
                settings['container_status'] = container_status

        return settings
62393
def invoke(stage, async, dry_run, config_file, args):
    """"""
    config = _load_config(config_file)
    if stage is None:
        stage = config['devstage']

    cfn = boto3.client('cloudformation')
    lmb = boto3.client('lambda')

    try:
        stack = cfn.describe_stacks(StackName=config['name'])['Stacks'][0]
    except botocore.exceptions.ClientError:
        raise RuntimeError('This project has not been deployed yet.')
    function = _get_from_stack(stack, 'Output', 'FunctionArn')

    if dry_run:
        invocation_type = 'DryRun'
    elif async:
        invocation_type = 'Event'
    else:
        invocation_type = 'RequestResponse'

    # parse input arguments
    data = {}
    for arg in args:
        s = arg.split('=', 1)
        if len(s) != 2:
            raise ValueError('Invalid argument ' + arg)
        if s[0][-1] == ':':
            # JSON argument
            data[s[0][:-1]] = json.loads(s[1])
        else:
            # string argument
            data[s[0]] = s[1]

    rv = lmb.invoke(FunctionName=function, InvocationType=invocation_type,
                    Qualifier=stage,
                    Payload=json.dumps({'kwargs': data}, sort_keys=True))
    if rv['StatusCode'] != 200 and rv['StatusCode'] != 202:
        raise RuntimeError('Unexpected error. Status code = {}.'.format(
            rv['StatusCode']))
    if invocation_type == 'RequestResponse':
        payload = json.loads(rv['Payload'].read().decode('utf-8'))
        if 'FunctionError' in rv:
            if 'stackTrace' in payload:
                print('Traceback (most recent call last):')
                for frame in payload['stackTrace']:
                    print('  File "{}", line {}, in {}'.format(
                        frame[0], frame[1], frame[2]))
                    print('    ' + frame[3])
                print('{}: {}'.format(payload['errorType'],
                                      payload['errorMessage']))
            else:
                raise RuntimeError('Unknown error')
        else:
            print(str(payload))
660570
def do_describe(self, line):
        ""
        args = self.getargs(line)

        if '-c' in args:
            create_info = True
            args.remove('-c')
        else:
            create_info = False

        if not args:
            if self.table:
                args = [self.table.name]
            else:
                args = self.tables

        for table in args:
            desc = self.conn.describe_table(table)

            if create_info:
                info = desc['Table']
                schema = info['KeySchema']
                name = info['TableName']

                hkey = schema['HashKeyElement']
                hkey = "%s:%s" % (hkey['AttributeName'], hkey['AttributeType'])

                if 'RangeKeyElement' in schema:
                    rkey = schema['RangeKeyElement']
                    rkey = " %s:%s" % (rkey['AttributeName'], rkey['AttributeType'])
                else:
                    rkey = ''

                prov = info['ProvisionedThroughput']
                prov = "-c %d,%d" % (prov['ReadCapacityUnits'], prov['WriteCapacityUnits'])
                print "create %s %s %s%s" % (name, prov, hkey, rkey)
            else:
                self.pprint(desc, "%s: " % table)
1246875
def do_describe(self, line):
        ""
        args = self.getargs(line)

        if '-c' in args:
            create_info = True
            args.remove('-c')
        else:
            create_info = False

        if not args:
            if self.table:
                args = [ self.table.table_name ]
            else:
                args = self.tables

        for table in args:
            desc = self.conn.describe_table(table)

            if create_info:
                info = desc['Table']
                name = info['TableName']
                attributes = info['AttributeDefinitions']
                schema = info['KeySchema']

                hkey = ''
                rkey = ''

                for k in schema:
                    aname = k['AttributeName']
                    for a in attributes:
                        if a['AttributeName'] == aname:
                            value = "%s:%s" % (a['AttributeName'], a['AttributeType'])
                            break

                    if k['KeyType'] == 'HASH':
                        hkey = value
                    elif k['KeyType'] == 'RANGE':
                        rkey = ' ' + value

                prov = info['ProvisionedThroughput']
                prov = "-c %d,%d" % (prov['ReadCapacityUnits'], prov['WriteCapacityUnits'])
                print "create %s %s %s%s" % (name, prov, hkey, rkey)
            else:
                self.pprint(desc, "%s: " % table)
584151
def describe(self):
        """"""
        if isinstance(self._plugin, list):
            pl = [p.name for p in self._plugin]
        elif isinstance(self._plugin, dict):
            pl = {k: classname(v) for k, v in self._plugin.items()}
        else:
            pl = self._plugin if isinstance(self._plugin, str) else self._plugin.name
        return {
            'name': self._name,
            'container': self._container,
            'plugin': pl,
            'description': self._description,
            'direct_access': self._direct_access,
            'user_parameters': [u.describe() for u in self._user_parameters],
            'metadata': self._metadata,
            'args': self._open_args
        }
790195
function describe(id, callback) {
    if (id == undefined)
      return callback(new TypeError("'id' can't be null or undefined"))

    var mediaObject = objects[id];
    if (mediaObject) return callback(null, mediaObject);

    var params = {
      object: id
    };

    function callback2(error, result) {
      if (error) return callback(error);

      var mediaObject = mediaObjectCreator.createInmediate(result);

      return callback(null, registerObject(mediaObject, id));
    }

    encode('describe', params, callback2);
  }
448523
function jsonDescription(format, description) {
  switch (format) {
    case 'application/openapi+json':
      if (typeof description == object) {
        return description;
      } else {
        throw new Error(`application/openapi+json description ${description} is not an object`);
      }
    case 'application/openapi+yaml':
      return yaml.safeLoad(description);
    default:
      throw new Error(`Unknown format: ${format} for ${description}`);
  }
}
1067697
def call(self, method, *args, **kw):
        
        if args and kw:
            raise ValueError("JSON-RPC method calls allow only either named or positional arguments.")
        if not method:
            raise ValueError("JSON-RPC method call requires a method name.")

        request = self._data_serializer.assemble_request(
            method, args or kw or None
        )

        if self._in_batch_mode:
            self._requests.append(request)
            return request.get('id')
        else:
            return request
1327411
def invoke(ctx, data_file):
    """"""
    click.echo('invoking')
    response = ctx.invoke(data_file.read())
    log_data = base64.b64decode(response['LogResult'])
    click.echo(log_data)
    click.echo('Response:')
    click.echo(response['Payload'].read())
    click.echo('done')
1152762
function define () {
  var args = Array.prototype.slice.call(arguments)
  var i, l

  var name = args.shift()
  if (is.array(name)) {
    name = args.shift()
    for (i = 0, l = name.length; i < l; i++) {
      define.apply(this, [name[i]].concat(args))
    }
    return this
  }

  if (!is.string(name)) throw new Error('Method name is not defined')

  var invoke = is.function(args[args.length - 1]) ? wrapFn(args.pop()) : null
  var pre = args.map(wrapFn)

  // define scope method
  this[name] = function () {
    var args = Array.prototype.slice.call(arguments)
    var self = this
    var callback

    if (is.function(args[args.length - 1])) callback = args.pop()

    // init pipeline
    var pipe = []
    var obj = this

    // prototype chain
    while (obj) {
      if (obj.hasOwnProperty('_hooks') && obj._hooks[name]) {
        pipe.unshift(obj._hooks[name])
      }
      obj = Object.getPrototypeOf(obj)
    }
    // pre middlewares
    pipe.unshift(pre)

    // invoke middleware
    if (invoke) pipe.push(invoke)

    pipe = flatten(pipe)

    // context object and next triggerer
    var ctx = new EventEmitter()
    ctx.method = name
    ctx.args = args
    var index = 0
    var size = pipe.length

    function next (err, res) {
      if (err || index === size) {
        var args = Array.prototype.slice.call(arguments)
        // callback when err or end of pipeline
        if (callback) callback.apply(self, args)
        args.unshift('end')
        ctx.emit.apply(ctx, args)
      } else if (index < size) {
        var fn = pipe[index]
        index++
        var val = fn.call(self, ctx, next)
        if (is.promise(val)) {
          val.then(function (res) {
            next(null, res)
          }, function (err) {
            next(err || new Error())
          })
        } else if (fn.length < 2) {
          // args without next() & not promise, sync func
          next(null, val)
        }
      }
    }

    if (callback) {
      next()
    } else {
      // use promise if no callback
      return new Promise(function (resolve, reject) {
        callback = function (err, result) {
          if (err) return reject(err)
          resolve(result)
        }
        next()
      })
    }
  }
  return this
}
1321587
private Description describe(MethodInvocationTree methodInvocationTree, VisitorState state) {
    // Find the root of the field access chain, i.e. a.intern().trim() ==> a.
    ExpressionTree identifierExpr = ASTHelpers.getRootAssignable(methodInvocationTree);
    String identifierStr = null;
    Type identifierType = null;
    if (identifierExpr != null) {
      identifierStr = state.getSourceForNode(identifierExpr);
      if (identifierExpr instanceof JCIdent) {
        identifierType = ((JCIdent) identifierExpr).sym.type;
      } else if (identifierExpr instanceof JCFieldAccess) {
        identifierType = ((JCFieldAccess) identifierExpr).sym.type;
      } else {
        throw new IllegalStateException("Expected a JCIdent or a JCFieldAccess");
      }
    }

    Type returnType = getReturnType(((JCMethodInvocation) methodInvocationTree).getMethodSelect());

    Fix fix;
    if (identifierStr != null
        && !"this".equals(identifierStr)
        && returnType != null
        && state.getTypes().isAssignable(returnType, identifierType)) {
      // Fix by assigning the assigning the result of the call to the root receiver reference.
      fix = SuggestedFix.prefixWith(methodInvocationTree, identifierStr + " = ");
    } else {
      // Unclear what the programmer intended.  Delete since we don't know what else to do.
      Tree parent = state.getPath().getParentPath().getLeaf();
      fix = SuggestedFix.delete(parent);
    }
    return describeMatch(methodInvocationTree, fix);
  }
654862
private void callHandleMethod(Method method, Object instance, ApiZone apiZone,
            Object userAgent) {
        ReflectMethodUtil.invokeHandleMethod(method, instance, context, apiZone, userAgent);
    }
630678
def _call_method(self, method_name, *args, **kwargs):
        
        if self.use_redfish_only:
            if method_name in SUPPORTED_REDFISH_METHODS:
                the_operation_object = self.redfish
            else:
                raise NotImplementedError()
        else:
            the_operation_object = self.ribcl
            if 'Gen10' in self.model:
                if method_name in SUPPORTED_REDFISH_METHODS:
                    the_operation_object = self.redfish
                else:
                    if (self.is_ribcl_enabled is not None
                            and not self.is_ribcl_enabled):
                        raise NotImplementedError()
            elif ('Gen9' in self.model) and (method_name in
                                             SUPPORTED_RIS_METHODS):
                the_operation_object = self.ris

        method = getattr(the_operation_object, method_name)

        LOG.debug(self._("Using %(class)s for method %(method)s."),
                  {'class': type(the_operation_object).__name__,
                   'method': method_name})

        return method(*args, **kwargs)
927868
public function describe($pUri = null, $pOnlyRoutes = false)
    {
        $definition = array();

        if (!$pOnlyRoutes) {
            $definition['parameters'] = array(
                '_method' => array('description' => 'Can be used as HTTP METHOD if the client does not support HTTP methods.', 'type' => 'string',
                                   'values' => 'GET, POST, PUT, DELETE, HEAD, OPTIONS, PATCH'),
                '_suppress_status_code' => array('description' => 'Suppress the HTTP status code.', 'type' => 'boolean', 'values' => '1, 0'),
                '_format' => array('description' => 'Format of generated data. Can be added as suffix .json .xml', 'type' => 'string', 'values' => 'json, xml'),
            );
        }

        $definition['controller'] = array(
            'entryPoint' => $this->getTriggerUrl()
        );

        foreach ($this->routes as $routeUri => $routeMethods) {

            $matches = array();
            if (!$pUri || ($pUri && preg_match('|^'.$routeUri.'$|', $pUri, $matches))) {

                if ($matches) {
                    array_shift($matches);
                }
                $def = array();
                $def['uri'] = $this->getTriggerUrl().'/'.$routeUri;

                foreach ($routeMethods as $method => $phpMethod) {

                    if (is_string($phpMethod)) {
                        $ref = new \ReflectionClass($this->controller);
                        $refMethod = $ref->getMethod($phpMethod);
                    } else {
                        $refMethod = new \ReflectionFunction($phpMethod);
                    }

                    $def['methods'][strtoupper($method)] = $this->getMethodMetaData($refMethod, $matches);

                }
                $definition['controller']['routes'][$routeUri] = $def;
            }
        }

        if (!$pUri) {
            foreach ($this->controllers as $controller) {
                $definition['subController'][$controller->getTriggerUrl()] = $controller->describe(false, true);
            }
        }

        return $definition;
    }