Returns the Linode Plan ID.

    label
        The label, or name, of the plan to get the ID from.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f get_plan_id linode label="Linode 1024"
175461
def get_plan_id(kwargs=None, call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudException(
            'The show_instance action must be called with -f or --function.'
        )

    if kwargs is None:
        kwargs = {}

    label = kwargs.get('label', None)
    if label is None:
        raise SaltCloudException(
            'The get_plan_id function requires a \'label\'.'
        )

    label = _decode_linode_plan_label(label)

    return label
1305619
def get_vm_id(kwargs=None, call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The get_vm_id function must be called with -f or --function.'
        )

    if kwargs is None:
        kwargs = {}

    name = kwargs.get('name', None)
    if name is None:
        raise SaltCloudSystemExit(
            'The get_vm_id function requires a name.'
        )

    try:
        ret = list_nodes()[name]['id']
    except KeyError:
        raise SaltCloudSystemExit(
            'The VM \'{0}\' could not be found.'.format(name)
        )

    return ret
367454
def _get_entity_id_if_container_metric(self, labels):
        
        if CadvisorPrometheusScraperMixin._is_container_metric(labels):
            pod = self._get_pod_by_metric_label(labels)
            if is_static_pending_pod(pod):
                # If the pod is static, ContainerStatus is unavailable.
                # Return the pod UID so that we can collect metrics from it later on.
                return self._get_pod_uid(labels)
            return self._get_container_id(labels)
948944
def get_call_name(self, node):
        
        if isinstance(node.func, ast.Attribute):
            return node.func.attr
        elif isinstance(node.func, ast.Name):
            return node.func.id
858675
def details(label_id)
      details_url = File.join(LABEL_URL, "#{label_id}.json")
      response = connection.get details_url
      details = response.parsed.tap {|d| d.delete('success')}
      OpenStruct.new(details)
    end
982698
def get(self, id): # pylint: disable=invalid-name,redefined-builtin
        
        schema = PackageSchema()
        resp = self.service.get_id(self.base, id)
        return self.service.decode(schema, resp)
416311
def get_label_idx(self, label):
        
        for i in range(len(self)):
            if self.mem[i].is_label and self.mem[i].inst == label:
                return i

        return None
1375058
def get_id(self):
        
        if self._id is None:
            self._id = graceful_get(self.inspect(refresh=True), "ID")
        return self._id
637223
def id_(reset=False):
    '''
    
    '''
    if reset:
        id_pattern = re.compile(r'Monit id (?P<id>[^ ]+)')
        cmd = 'echo y|monit -r'
        out = __salt__['cmd.run_all'](cmd, python_shell=True)
        ret = id_pattern.search(out['stdout']).group('id')
        return ret if ret else False
    else:
        cmd = 'monit -i'
        out = __salt__['cmd.run'](cmd)
        ret = out.split(':')[-1].strip()
    return ret
86280
def get_project_id():
    
    if os.name == 'nt':
        command = _CLOUD_SDK_WINDOWS_COMMAND
    else:
        command = _CLOUD_SDK_POSIX_COMMAND

    try:
        output = subprocess.check_output(
            (command,) + _CLOUD_SDK_CONFIG_COMMAND,
            stderr=subprocess.STDOUT)
    except (subprocess.CalledProcessError, OSError, IOError):
        return None

    try:
        configuration = json.loads(output.decode('utf-8'))
    except ValueError:
        return None

    try:
        return configuration['configuration']['properties']['core']['project']
    except KeyError:
        return None
880061
public String getPackageId() throws ProposalException {
        if (Status.SUCCESS != getStatus()) {
            throw new ProposalException(format("Status of install proposal did not ret ok for %s, %s ", getPeer(), getStatus()));
        }
        ByteString payload = getProposalResponse().getResponse().getPayload();
        Lifecycle.InstallChaincodeResult installChaincodeResult = null;
        try {
            installChaincodeResult = Lifecycle.InstallChaincodeResult.parseFrom(payload);
        } catch (InvalidProtocolBufferException e) {
            throw new ProposalException(format("Bad protobuf received for install proposal %s", getPeer()));
        }
        return installChaincodeResult.getPackageId();
    }
850355
def get_node_label(self, model):
        
        if model.is_proxy:
            label = "(P) %s" % (model.name.title())
        else:
            label = "%s" % (model.name.title())

        line = ""
        new_label = []
        for w in label.split(" "):
            if len(line + w) > 15:
                new_label.append(line)
                line = w
            else:
                line += " "
                line += w
        new_label.append(line)

        return "\n".join(new_label)
1086079
def get_labels(node=None, apiserver_url=None):
    '''
    

    '''
    # Get salt minion ID
    node = _guess_node_id(node)
    # Try to get kubernetes master
    apiserver_url = _guess_apiserver(apiserver_url)
    if apiserver_url is None:
        return False

    # Get data
    ret = _get_labels(node, apiserver_url)

    return {"labels": ret}
1220326
def get_log_id(cls, id):
        
        conn = Qubole.agent()
        r = conn.get_raw(cls.element_path(id) + "/logs")
        return r.text
1187861
def lat_id(self, line):
        ''' 
        '''
        if self.grid == 'WAC':
            lat = ((1 + self.LINE_PROJECTION_OFFSET - line) *
                   self.MAP_SCALE * 1e-3 / self.A_AXIS_RADIUS)
            return lat * 180 / np.pi
        else:
            lat = float(self.CENTER_LATITUDE) - \
                (line - float(self.LINE_PROJECTION_OFFSET) - 1)\
                / float(self.MAP_RESOLUTION)
            return lat
671124
def get_provider_id(self):
        
        if 'providerId' not in self._my_map or not self._my_map['providerId']:
            raise errors.IllegalState('this sourceable object has no provider set')
        return Id(self._my_map['providerId'])
511019
def id(self): # pylint: disable=invalid-name,too-many-branches,too-many-return-statements
        """"""
        # There are some times we want to trick the platform detection
        # say if a raspberry pi doesn't have the right ID, or for testing
        try:
            return os.environ['BLINKA_FORCECHIP']
        except KeyError: # no forced chip, continue with testing!
            pass

        # Special case, if we have an environment var set, we could use FT232H
        try:
            if os.environ['BLINKA_FT232H']:
                # we can't have ftdi1 as a dependency cause its wierd
                # to install, sigh.
                import ftdi1 as ftdi # pylint: disable=import-error
                try:
                    ctx = None
                    ctx = ftdi.new()  # Create a libftdi context.
                    # Enumerate FTDI devices.
                    count, _ = ftdi.usb_find_all(ctx, 0, 0)
                    if count < 0:
                        raise RuntimeError('ftdi_usb_find_all returned error %d : %s' %
                                           count, ftdi.get_error_string(self._ctx))
                    if count == 0:
                        raise RuntimeError('BLINKA_FT232H environment variable' + \
                                           'set, but no FT232H device found')
                finally:
                    # Make sure to clean up list and context when done.
                    if ctx is not None:
                        ftdi.free(ctx)
            return FT232H
        except KeyError: # no FT232H environment var
            pass

        platform = sys.platform
        if platform == "linux" or platform == "linux2":
            return self._linux_id()
        if platform == "esp8266":
            return ESP8266
        if platform == "samd21":
            return SAMD21
        if platform == "pyboard":
            return STM32
        # nothing found!
        return None