Invokes the /workflow-xxxx/describe API method.

    For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Workflows-and-Analyses#API-method%3A-%2Fworkflow-xxxx%2Fdescribe
13418
def workflow_describe(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/describe' % object_id, input_params, always_retry=always_retry, **kwargs)
683549
def job_describe(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/describe' % object_id, input_params, always_retry=always_retry, **kwargs)
1123399
def _api_call(self, endpoint, model=None, method=None, data=None, filters=None):
        
        if not self.token:
            raise RuntimeError("You do not have an API token!")

        if not method:
            raise ValueError("Method is required for API calls!")

        if model:
            endpoint = endpoint.format(**vars(model))
        url = '{}{}'.format(self.base_url, endpoint)
        headers = {
            'Authorization': "Bearer {}".format(self.token),
            'Content-Type': 'application/json',
            'User-Agent': self._user_agent,
        }

        if filters:
            headers['X-Filter'] = json.dumps(filters)

        body = None
        if data is not None:
            body = json.dumps(data)

        response = method(url, headers=headers, data=body)

        warning = response.headers.get('Warning', None)
        if warning:
            logger.warning('Received warning from server: {}'.format(warning))

        if 399 < response.status_code < 600:
            j = None
            error_msg = '{}: '.format(response.status_code)
            try:
                j = response.json()
                if 'errors' in j.keys():
                    for e in j['errors']:
                        error_msg += '{}; '.format(e['reason']) \
                                if 'reason' in e.keys() else ''
            except:
                pass
            raise ApiError(error_msg, status=response.status_code, json=j)

        if response.status_code != 204:
            j = response.json()
        else:
            j = None # handle no response body

        return j
520499
def call_workflow_event(instance, event, after=True):
    
    if not event.transition:
        return False

    portal_type = instance.portal_type
    wf_module = _load_wf_module('{}.events'.format(portal_type.lower()))
    if not wf_module:
        return False

    # Inspect if event_<transition_id> function exists in the module
    prefix = after and "after" or "before"
    func_name = "{}_{}".format(prefix, event.transition.id)
    func = getattr(wf_module, func_name, False)
    if not func:
        return False

    logger.info('WF event: {0}.events.{1}'
                .format(portal_type.lower(), func_name))
    func(instance)
    return True
834655
def applet_describe(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/describe' % object_id, input_params, always_retry=always_retry, **kwargs)
1220469
def call_api(self, table, column, value, **kwargs):
        """"""
        try:
            output_format = kwargs.pop('output_format')
        except KeyError:
            output_format = self.output_format
        url_list = [self.base_url, table, column,
                    quote(value), 'rows']
        rows_count = self._number_of_rows(**kwargs)
        url_list.append(rows_count)
        url_string = '/'.join(url_list)
        xml_data = urlopen(url_string).read()
        data = self._format_data(output_format, xml_data)
        return data
337617
def create_async_api_call_func(api, verb):
    

    # Scopes some local context in which we can build
    # request functions with reflection that primed with
    # some static parameters.
    def api_call_func(self, **kwargs):

        def _async_call_handler():
            api_method = getattr(self, api_method_name(verb, api))
            return api_method(**kwargs)

        return self._executor.submit(_async_call_handler)

    method_name = async_api_method_name(verb, api)

    api_call_func.__name__ = method_name
    api_call_func.__doc__ = "{}\nParameters:\n  {}".format(
        method_name, '\n  '.join(api.request_classes[verb]().keys()))

    return api_call_func
196770
def describe_cluster(jobflow_id)
      params = {
        :operation => 'DescribeCluster',
        :cluster_id => jobflow_id,
      }
      aws_result = @aws_request.submit(params)
      yield aws_result if block_given?
      JSON.parse(aws_result)
    end
1072011
def describe(self, model_name):
    
    model_yaml = yaml.safe_dump(self.get_model_details(model_name), default_flow_style=False)
    print(model_yaml)
662961
def call( methodName, args )
      args = (args || {}) #.keys_to_sym!

      # Get Binding
      binding = @wsdl.bindings.getBindingForOperationName( @binding, methodName )
      if binding.size == 0
        raise SOAP::LCNoMethodError, "Undefined method `#{methodName}'"
      elsif binding.size > 1
        raise SOAP::LCError, "Ambigous method name `#{methodName}', please, specify a binding name"
      else
        binding = binding[0]
        @binding = binding.name
      end

      # Get Binding Operation
      binding_operation = binding.operations[methodName]

      # Get PortType
      portType = @wsdl.portTypes[binding.type.nns]
      portType_operation = portType.operations[methodName]

      # Get message for input operation
      input_message = @wsdl.messages[portType_operation[:input][:message].nns]

      # Create method
      soap_method = "<#{methodName} xmlns=\"#{@wsdl.targetNamespace}\">\n"
      input_message.parts.each do |_, attrs|
        case attrs[:mode]
          when :type
            if SOAP::XSD::ANY_SIMPLE_TYPE.include?( attrs[attrs[:mode]].nns )
              # Part refer to a builtin SimpleType
              soap_method << SOAP::XSD.displayBuiltinType( attrs[:name], args, 1, 1 )
            else
              # Part refer to an XSD simpleType or complexType defined in types
              element = @wsdl.types[attrs[attrs[:mode]].nns][:value]
              case element[:type]
                when :simpleType
                  soap_method << "<#{attrs[:name]}>\n#{element.display( @wsdl.types, args )}\n</#{attrs[:name]}>\n" # MAYBE ########## 
                when :complexType
                  soap_method << "<#{attrs[:name]}>\n#{element.display( @wsdl.types, args )}\n</#{attrs[:name]}>\n" # MAYBE ########## 
                else
                  raise SOAP::LCWSDLError, "Malformated part #{attrs[:name]}"
              end
            end
          when :element
            # Part refer to an XSD element
            element = @wsdl.types[attrs[attrs[:mode]].nns][:value]
            case element[:type]
              when :simpleType
                soap_method << element[element[:type]].display( @wsdl.types, args )
              when :complexType
                soap_method << element[element[:type]].display( @wsdl.types, args )
              else
                raise SOAL::LCWSDLError, "Malformated element `#{attrs[attrs[:mode]]}'"
            end
        
            ## TODO ---------- USE element[:key]
          else 
            raise SOAP::LCWSDLError, "Malformated part #{attrs[:name]}"
        end
      end
      soap_method += "</#{methodName}>\n"

      # Create SOAP Envelope
      envelope = soap_envelop do 
        soap_header + soap_body( soap_method )
      end

      # Create headers
      headers = Hash.new
      # Add SOAPAction to headers (if exist)
      action = begin
        binding_operation[:soapAction]
      rescue
        nil
      end
      headers['SOAPAction'] = action unless action.nil? or action.length == 0

      # Search URI
      service_port = @wsdl.services.getServicePortForBindingName( binding.name )
      address = service_port[:address]

      # Complete request
      @request = {
        :headers  => make_header( envelope, headers ),
        :envelope => envelope,
        :uri      => address,
        :wsdl     => @wsdl,
        :response => @wsdl.messages[portType_operation[:output][:message].nns].name,
        :binding  => @binding,
        :method   => methodName
      }
      
      return self
    end
164763
def call(self, callname, arguments=None):
        """"""
        # See if a method override exists
        action = getattr(self.api, callname, None)
        if action is None:
            try:
                action = self.api.ENDPOINT_OVERRIDES.get(callname, None)
            except AttributeError:
                action = callname

        if not callable(action):
            request = self._generate_request(action, arguments)
            if action is None:
                return self._generate_result(
                    callname, self.api.call(*call_args(callname, arguments)))
            return self._generate_result(
                callname, self.api.call(*call_args(action, arguments)))

        request = self._generate_request(callname, arguments)
        return self._generate_result(callname, action(request))
1323368
def _build_regular_workflow(json_spec):
    
    workflow_id = dxpy.api.workflow_new(json_spec)["id"]
    dxpy.api.workflow_close(workflow_id)
    return workflow_id
1049029
def _do_api_call(self, call_type=u'', id = None):
        
        endpoint = None
        url = None
        # print "call_type %s" % (call_type)
        if call_type == u'load':
            endpoint = self.get_endpoint("self")
            if id is None:
                raise APIException("LOAD_IDNOTSET", "could not load object")
        elif call_type == u'delete' or (call_type == u"destroy"):
            endpoint = self.get_endpoint("destroy")
            if id is None:
                raise APIException("DELETE_IDNOTSET", "could not delete object")
        elif call_type == u'update':
            endpoint = self.get_endpoint("update")
            if id is None:
                raise APIException("UPDATE_IDNOTSET", "could not load object")
        elif call_type == u'create':
            endpoint = self.get_endpoint("create")
            url = u"%s%s%s" % (self.__api__.base_url, API_BASE_PATH, endpoint['href'])
            # post?
        elif call_type == u'schema':
            # add schema gethering functionality 
            # hackisch
            endpoint = self.get_endpoint("create")
            url = u"%s%s%s/schema" % (self.__api__.base_url, API_BASE_PATH, endpoint['href'])
            endpoint['method'] = u'GET'    
        if id is not None:
            url = u"%s%s%s" % (self.__api__.base_url, API_BASE_PATH, endpoint['href'].replace(u"{id}",id))
        ## excecute the api request
        payload = self.to_json()
        if u'method' in endpoint.keys():
            method = endpoint['method']
        else:
            method = u'GET'
        # request raises exceptions if something goes wrong
        obj = None
        try:
            # dbg
            msg = u"url: %s method:%s p: %s" % (url, method, payload)
            #print msg
            response = self.__api__.request(url, method, data=payload)
            #load update create success
            if ((response.status_code == 200 and 
                 call_type in ['load', 'update']) or
            (response.status_code == 201 and call_type == 'create')):
                msg = "call_type: %s successfully completed" % call_type
                log.info(msg)
                return self.to_instance(response)
            elif (response.status_code == 200 and call_type in ['delete', 'destroy']):
            #delete success
                msg ="call_type: %s successfully completed" % call_type
                log.info(msg)
                return self._try_to_serialize(response)
            elif 200 <= response.status_code <= 299:
                return self._try_to_serialize(response)
        except Exception as e:
            msg = "Exception occoured %s url: %s" % (e, url)
            log.error(msg)
            raise e
1104763
def describe(self, **kwargs):
        
        response = self._new_response()
        description = {
            'cruddy_version': __version__,
            'table_name': self.table_name,
            'supported_operations': copy.copy(self.supported_ops),
            'prototype': copy.deepcopy(self.prototype),
            'operations': {}
        }
        for name, method in inspect.getmembers(self, inspect.ismethod):
            if not name.startswith('_'):
                argspec = inspect.getargspec(method)
                if argspec.defaults is None:
                    defaults = None
                else:
                    defaults = list(argspec.defaults)
                method_info = {
                    'docs': inspect.getdoc(method),
                    'argspec': {
                        'args': argspec.args,
                        'varargs': argspec.varargs,
                        'keywords': argspec.keywords,
                        'defaults': defaults
                    }
                }
                description['operations'][name] = method_info
        response.data = description
        return response
627977
def execute_workflow(id, parameter_json)
      path = "/workflows/#{id}/executions/"
      response = @session.post(path, parameter_json)
      # Execution ID is the final component in the Location header URL, so
      # chop off the front, then pull off any trailing /
      response.headers[:location].gsub(%r{^.*/executions/}, '').gsub(%r{\/$}, '')
    end
1233972
def system_describe_executions(input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/system/describeExecutions', input_params, always_retry=always_retry, **kwargs)
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)