Skip to contents

Provides access to PetroVisor item related functionalities.

Details

A new instance of this class will be created by the ServiceProvider automatically.

Super class

Myrconn.PetroVisor.Client::ApiRequests -> RepositoryService

Methods


Method new()

Create a new RepositoryService instance. This is done by the ServiceProvider automatically.

Usage

RepositoryService$new(url, token_type, token)

Arguments

url

the URL for the API calls.

token_type

the type of the issued token.

token

the issued token.


Method load_names()

Get the names of all items of the given type available in PetroVisor.

Usage

RepositoryService$load_names(type)

Arguments

type

The type of the item.

Returns

A character array containing the names of the items.


Method delete()

Delete an item by name.

Usage

RepositoryService$delete(type, name)

Arguments

type

The type of the item.

name

Name of the item to delete.


Method load()

Get an item by name.

Usage

RepositoryService$load(type, name)

Arguments

type

The type of the item.

name

Name of the item to retrieve.

Returns

An object of the specified type class.


Method save()

Usage

RepositoryService$save(type, item)

Arguments

type

The type of the item.

item

Item to add or edit. Has to be an object of the respective class.

Details

Add or edit an item.


Method clone()

The objects of this class are cloneable with this method.

Usage

RepositoryService$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { # \dontrun{
# create a new instance of the service provider
sp <- ServiceProvider$new("Host", 8095, "WorkspaceA", "UserX", "Password")

# get the names of all available entities
entityNames <- sp$items$load_names("Entity")

# delete an item (delete the hierarchy with the name "test")
sp$items$delete("Hierarchy", "test")

# get an item by name
well01 <- sp$items$load("Well", "Well01")

# add or edit an item
entity <- Entity$new(
  name = "TestWell01",
  entityTypeName = "Well",
  alias = "TestAlias01"
)
sp$items$save("Entity", entity)
} # }