Skip to content

Import

After initial setup, publicly available content (e.g., service offerings) can be imported into your instance of the Service Lifecycle Management or resources can be imported into the Resource Management.

Service Management

To import content into the Service Registry of the Service Lifecycle Management local directories or git repositories can be used. See the two sections below for more information how to configure import from local directories or git repositories. The import can be started using this command:

docker-compose up --force-recreate service-registry-init

Local Directories

Update in the .env file in the compose directory the variable SERVICE_REGISTRY_INITIALIZATION_LOCAL_DIRECTORIES with your directories. Multiple directories must be seperated by comma. The defined directories must be added as volumes to the service-registry-init service in the docker-compose.yml.

Example of .env:

SERVICE_REGISTRY_INITIALIZATION_LOCAL_DIRECTORIES=/my/local/dir1,/my/local/dir2

Example of docker-compose.yml:

...
  service-registry-init:
    ...
    volumes:
    ...
    - "/my/local/dir1:/my/local/dir1"
    - "/my/local/dir2:/my/local/dir2"
...

Git Repositories

Update in the .env file in the compose directory the variable SERVICE_REGISTRY_INITIALIZATION_GIT_REPOS with your git repositories. Default value is the public service registry content repository. Multiple git repositories must be seperated by comma. Authentication for a git repository can be defined in the form {Username}:{PasswordOrAccessToken}@{RepoUrl}.

Example:

SERVICE_REGISTRY_INITIALIZATION_GIT_REPOS=https://github.com/FabOS-AI/fabos-slm-service-registry-content.git,myGitUser:myGitUserPassword@https://my-private-git-repo.git

Resource Management

Resources and capabilities can be imported directly via the Resource Management importer API.

text
https://<<your-slm-host>>/resource-management/importer

Use devices.xlsx as example input file for the import. The importer reads the Devices sheet and expects the following columns:

columntypeoptionaldescription
NamestringnoDevice display name in the Excel file
HostnamestringnoHostname of the resource.
IP AddressstringnoIP address of the resource.
Is ResourcestringnoImport flag. Use yes to import the row as resource.
Resource IDUUID (string)noUnique resource identifier.
Connection TypestringyesRemote access connection type (e.g., ssh).
Connection PortnumberyesRemote access port (e.g., 22).
UsernamestringyesRemote access username.
PasswordstringyesRemote access password.
Location IDUUID (string)yesID of the location from the Locations sheet.
Asset IDstringyesAsset identifier of the resource.
Firmware VersionstringyesFirmware version value for the resource.
CapabilitiesJSON array of stringsyesCapability names from the Capabilities sheet, e.g. ["BaseConfig", "Docker:skip"]. The suffix :skip marks a capability as linked but not installed.

Import resources from Excel Sheet

Endpoint:

text
POST /importer/resources

Request parts:

  • file: Multipart file (e.g., devices.xlsx)
  • fullPathOwnerGroupId: Full path group ID of the owner of the imported resources (e.g., /users/266a635c-cbeb-426d-b833-dfab1f8364ba)

Example:

sh
curl --request POST \
  --url https://<<your-slm-host>>/resource-management/importer/resources \
  --header 'Authorization: Bearer <<access_token>>' \
  --form 'file=@devices.xlsx' \
  --form 'fullPathOwnerGroupId=/users/266a635c-cbeb-426d-b833-dfab1f8364ba'

Import capabilities from Excel Sheet

Endpoint:

text
POST /importer/capabilities

Request parts:

  • file: Multipart file (e.g., devices.xlsx)
  • fullPathOwnerGroupId: Full path group ID of the owner of the imported resources (e.g., /users/266a635c-cbeb-426d-b833-dfab1f8364ba)
  • forceInstall: If true the installation will be forced for all capabilities, even if they are already linked to the resource. This can be used to update the capabilities of a resource. Default value is false.

Example:

sh
curl --request POST \
  --url https://<<your-slm-host>>/resource-management/importer/capabilities \
  --header 'Authorization: Bearer <<access_token>>' \
  --form 'file=@devices.xlsx' \
  --form 'fullPathOwnerGroupId=/users/266a635c-cbeb-426d-b833-dfab1f8364ba' \
  --form 'forceInstall=true'