ai_core_sdk.credentials
index
/home/jenkins/agent/workspace/AI-Foundation_ai-core-sdk_master/ai_core_sdk/credentials.py

 
Modules
       
json
os
pathlib

 
Classes
       
builtins.object
CredentialsValue
Service
VCAPEnvironment

 
class CredentialsValue(builtins.object)
    CredentialsValue(name: 'str', vcap_key: 'Optional[Tuple[str, ...]]' = None, default: 'Optional[str]' = None, transform_fn: 'Optional[Callable]' = None) -> None
 
CredentialsValue(name: 'str', vcap_key: 'Optional[Tuple[str, ...]]' = None, default: 'Optional[str]' = None, transform_fn: 'Optional[Callable]' = None)
 
  Methods defined here:
__eq__(self, other)
Return self==value.
__init__(self, name: 'str', vcap_key: 'Optional[Tuple[str, ...]]' = None, default: 'Optional[str]' = None, transform_fn: 'Optional[Callable]' = None) -> None
Initialize self.  See help(type(self)) for accurate signature.
__repr__(self)
Return repr(self).

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
__annotations__ = {'default': 'Optional[str]', 'name': 'str', 'transform_fn': 'Optional[Callable]', 'vcap_key': 'Optional[Tuple[str, ...]]'}
__dataclass_fields__ = {'default': Field(name='default',type='Optional[str]',defaul...appingproxy({}),kw_only=False,_field_type=_FIELD), 'name': Field(name='name',type='str',default=<dataclasse...appingproxy({}),kw_only=False,_field_type=_FIELD), 'transform_fn': Field(name='transform_fn',type='Optional[Callabl...appingproxy({}),kw_only=False,_field_type=_FIELD), 'vcap_key': Field(name='vcap_key',type='Optional[Tuple[str, ...appingproxy({}),kw_only=False,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False)
__hash__ = None
__match_args__ = ('name', 'vcap_key', 'default', 'transform_fn')
default = None
transform_fn = None
vcap_key = None

 
class Service(builtins.object)
    Service(env: 'Dict[str, Any]')
 

 
  Methods defined here:
__getitem__(self, key)
__init__(self, env: 'Dict[str, Any]')
Initialize self.  See help(type(self)) for accurate signature.
get(self, key, default=<object object at 0x7fadc590d790>)

Readonly properties defined here:
label
name

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class VCAPEnvironment(builtins.object)
    VCAPEnvironment(services: 'List[Service]') -&gt; None
 
VCAPEnvironment(services: 'List[Service]')
 
  Methods defined here:
__eq__(self, other)
Return self==value.
__getitem__(self, name) -> 'Service'
__init__(self, services: 'List[Service]') -> None
Initialize self.  See help(type(self)) for accurate signature.
__repr__(self)
Return repr(self).
get_service(self, label, exactly_one: 'bool' = True) -> 'Service'
get_service_by_name(self, name, exactly_one: 'bool' = True) -> 'Service'

Class methods defined here:
from_dict(env: 'Dict[str, Any]') from builtins.type
from_env(env_var: 'Optional[str]' = None) from builtins.type

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
__annotations__ = {'services': 'List[Service]'}
__dataclass_fields__ = {'services': Field(name='services',type='List[Service]',defau...appingproxy({}),kw_only=False,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False)
__hash__ = None
__match_args__ = ('services',)

 
Functions
       
fetch_credentials(profile: 'str' = None, **kwargs) -> 'Dict[str, str]'
get_nested_value(data_dict, keys: 'List[str]')
Retrieve a nested value from a dictionary using a list of strings.
 
:param data_dict: The dictionary to search.
:param keys: A list of strings representing nested keys.
:return: The value associated with the nested keys, or None if not found.
init_conf(profile: 'str' = None)
resolve_params(config, cred_value, vcap_service, **kwargs)
Resolves the parameter value by checking multiple sources in order:
kwargs, environment variables, config, VCAP services, and defaults.
Logs the source of the resolved value.

 
Data
        AI_CORE_PREFIX = 'AICORE'
AUTH_ENDPOINT_SUFFIX = '/oauth/token'
Any = typing.Any
CONFIG_FILE_ENV_VAR = 'AICORE_CONFIG'
CREDENTIAL_VALUES = [CredentialsValue(name='client_id', vcap_key=('cr...s', 'clientid'), default=None, transform_fn=None), CredentialsValue(name='client_secret', vcap_key=...'clientsecret'), default=None, transform_fn=None), CredentialsValue(name='auth_url', vcap_key=('cre...ansform_fn=<function <lambda> at 0x7fadc40fd120>), CredentialsValue(name='base_url', vcap_key=('cre...ansform_fn=<function <lambda> at 0x7fadc40fdc60>), CredentialsValue(name='resource_group', vcap_key=None, default=None, transform_fn=None), CredentialsValue(name='cert_url', vcap_key=('cre...ansform_fn=<function <lambda> at 0x7fadc40fdd80>), CredentialsValue(name='cert_file_path', vcap_key=None, default=None, transform_fn=None), CredentialsValue(name='key_file_path', vcap_key=None, default=None, transform_fn=None), CredentialsValue(name='cert_str', vcap_key=('cre...ansform_fn=<function <lambda> at 0x7fadc40fde10>), CredentialsValue(name='key_str', vcap_key=('cred...ansform_fn=<function <lambda> at 0x7fadc40fdea0>)]
Callable = typing.Callable
Dict = typing.Dict
Final = typing.Final
List = typing.List
NoDefault = <object object>
Optional = typing.Optional
PROFILE_ENV_VAR = 'AICORE_PROFILE'
Tuple = typing.Tuple
Union = typing.Union
VCAP_AICORE_SERVICE_NAME = 'aicore'
VCAP_SERVICES_ENV_VAR = 'VCAP_SERVICES'
__annotations__ = {'CREDENTIAL_VALUES': 'Final[List[CredentialsValue]]'}
annotations = _Feature((3, 7, 0, 'beta', 1), (3, 11, 0, 'alpha', 0), 16777216)
logger = <Logger ai_core_sdk (INFO)>