kappa_sdk.Connection#
- class kappa_sdk.Connection(server_address, proxies=None, headers={}, verify_ssl=True, client_id=None, client_secret=None)[source]#
Connection to the KAPPA Automate instance.
Use this class to establish a connection to the KAPPA Automate instance.
- Parameters:
server_address (str) – URL of the KAPPA Automate instance. This is the same URL that you use to access the web interface of your KAPPA Automate instance.
verify_ssl (bool) – Set this to False if you need to disable SSL certificate verification (True by default).
proxies (Dict[Any, Any] | None)
headers (Dict[str, str])
client_id (str | None)
client_secret (str | None)
Attributes
Get the Global Data Types catalog object of the
Field.Gets the event bus.
Gets the REST API gateway.
Gets the unit converter API results.
Get the Global Well Properties catalog object of the
Field.Methods
Connection.create_field(name, country, ...)Creates a new field with the specified parameters.
Connection.get_field_by_id(field_id)Gets a field by id.
Lists all fields.
Migrate user task items using a definition to another user task definition.
Connection.run_kw_script(field_id, well_id, ...)Runs a KW script.
- __init__(server_address, proxies=None, headers={}, verify_ssl=True, client_id=None, client_secret=None)[source]#
- Parameters:
server_address (str)
proxies (Dict[Any, Any] | None)
headers (Dict[str, str])
verify_ssl (bool)
client_id (str | None)
client_secret (str | None)
- property unit_converter: UnitConverter#
Gets the unit converter API results.
- property data_types_catalog: FieldDataTypesCatalog#
Get the Global Data Types catalog object of the
Field.- Returns:
FieldDataTypesCatalog– The Global Data Types catalog object.
- property well_properties_catalog: FieldWellPropertiesCatalog#
Get the Global Well Properties catalog object of the
Field.- Returns:
FieldWellPropertiesCatalog– The Global Well Properties catalog object.
- get_fields()[source]#
Lists all fields.
- Returns:
List[Field]– A list of all fields.- Return type:
List[Field]
- run_kw_script(field_id, well_id, module, script, additional_content=None, name='Custom KW script', time_to_live=0.0001)[source]#
Runs a KW script.
- Parameters:
field_id (str) – The id of the field
well_id (str) – The id of the well
module (KWModuleEnum) – Type of the KW module that should execute the script.
script (str) – The KW script to execute.
time_to_live (float) – Life duration of the script in days
additional_content (str | None) – Additional content that is supplied with the script (optional).
name (str | None) – The name of the script (optional).
- Return type:
- create_field(name, country, field_timezone, unit_system_name, coordinate_system=CoordinateSystemEnum.wsg_84, reference_date=None, asset='', latitude=None, longitude=None, datum=None, comment='')[source]#
Creates a new field with the specified parameters.
- Parameters:
name (
str) – The name of the field.country (
CountryEnum) – The country where the field is located.field_timezone (
TimezoneEnum) – The timezone of the field.unit_system_name (
str) – The name of the unit system.coordinate_system (
CoordinateSystemEnum, optional) – The coordinate system used (default is CoordinateSystemEnum.wsg_84).reference_date (
Optional[datetime], optional) – The reference date for the field (default is None).asset (
str, optional) – The asset associated with the field (default is an empty string).latitude (
Optional[float], optional) – The latitude of the field (default is None).longitude (
Optional[float], optional) – The longitude of the field (default is None).datum (
Optional[float], optional) – The datum of the field (default is None).comment (
str, optional) – Additional comments about the field (default is an empty string).
- Returns:
Field– The created field.- Return type:
- migrate_user_tasks(initial_user_task_definition_name, new_user_task_definition_name, field_name, well_name)[source]#
Migrate user task items using a definition to another user task definition.
- Parameters:
initial_user_task_definition_name (str) – The name of the initial user task definition
new_user_task_definition_name (str) – The name of the new user task definition
field_name (str | None) – (Optional) Specify this to apply the migration to a specific field
well_name (str | None) – (Optional) Specify this to apply the migration to a specific well. Note that the field name must be specified if this parameter is used.
- Return type:
None