Imports {sevenbridges2}R Documentation

R6 Class representing storage imports endpoints

Description

R6 Class representing storage imports resource endpoints.

Super class

sevenbridges2::Resource -> Imports

Public fields

URL

List of URL endpoints for this resource.

Methods

Public methods


Method new()

Create a new Imports object.

Usage
Imports$new(...)
Arguments
...

Other response arguments.


Method query()

This call lists import jobs initiated by particular user. Note that when you import a file from your volume on your cloud storage provider (Amazon Web Services or Google Cloud Storage), you are creating an alias on the Platform which points to the file in your cloud storage bucket. Aliases appear as files on the Platform and can be copied, executed, and modified as such. They refer back to the respective file on the given volume.

Usage
Imports$query(
  volume = NULL,
  project = NULL,
  state = NULL,
  limit = getOption("sevenbridges2")$limit,
  offset = getOption("sevenbridges2")$offset,
  ...
)
Arguments
volume

Volume id or Volume object. List all imports from this particular volume. Optional.

project

Project id or Project object. List all volume imports to this particular project. Optional.

state

The state of the import job. Possible values are:

  • PENDING: the import is queued;

  • RUNNING: the import is running;

  • COMPLETED: the import has completed successfully;

  • FAILED: the import has failed.

Example:

state = c("RUNNING", "FAILED")
limit

The maximum number of collection items to return for a single request. Minimum value is 1. The maximum value is 100 and the default value is 50. This is a pagination-specific attribute.

offset

The zero-based starting index in the entire collection of the first item to return. The default value is 0. This is a pagination-specific attribute.

...

Other arguments that can be passed to core api() function like 'fields', etc.

Returns

Collection of Import objects.

Examples
\dontrun{
 imports_object <- Imports$new(
                    auth = auth
                   )

 # List import job
 imports_object$query()
}


Method get()

This call will return the details of an import job.

Usage
Imports$get(id, ...)
Arguments
id

The import job identifier (id).

...

Other arguments that can be passed to core api() function like 'fields', etc.

Returns

Import object.

Examples
\dontrun{
 imports_object <- Imports$new(
                    auth = auth,
                   )

 # List import job
 imports_object$get(id = id)
}


Method submit_import()

This call lets you queue a job to import a file or folder from a volume into a project on the Platform. Essentially, you are importing an item from your cloud storage provider (Amazon Web Services, Google Cloud Storage, Azure or Ali Cloud) via the volume onto the Platform.
If successful, an alias will be created on the Platform. Aliases appear on the Platform and can be copied, executed, and modified as such. They refer back to the respective item on the given volume.

If you want to import multiple files, the recommended way is to do it in bulk considering the API rate limit (learn more). Bulk operations will be implemented in next releases.

Usage
Imports$submit_import(
  source_volume = NULL,
  source_location,
  destination_project = NULL,
  destination_parent = NULL,
  name = NULL,
  overwrite = FALSE,
  autorename = FALSE,
  preserve_folder_structure = NULL,
  ...
)
Arguments
source_volume

Volume id or Volume object you want to import files or folders from. Required if source_location parameter is provided as a string.

source_location

File/folder location name on the volume or VolumeFile object you would like to import into some project/folder on the platform.

destination_project

Destination project id or Project object. Not required, but either destination_project or destination_parent directory must be provided.

destination_parent

Folder id or File object (with type = 'FOLDER'). Not required, but either destination_project or destination_parent directory must be provided.

name

The name of the alias to create. This name should be unique to the project.
If the name is already in use in the project, you should use the overwrite query parameter in this call to force any item with that name to be deleted before the alias is created. If name is omitted, the alias name will default to the last segment of the complete location (including the prefix) on the volume.

Segments are considered to be separated with forward slashes /. Allowed characters in file names are all alphanumeric and special characters except forward slash /, while folder names can contain alphanumeric and special characters _, - and ..

overwrite

Set to TRUE if you want to overwrite the item if another one with the same name already exists at the destination. Bear in mind that if used with folders import, the folder's content (files with the same name) will be overwritten, not the whole folder.

autorename

Set to TRUE if you want to automatically rename the item (by prefixing its name with an underscore and number) if another one with the same name already exists at the destination. Bear in mind that if used with folders import, the folder content will be renamed, not the whole folder.

preserve_folder_structure

Set to TRUE if you want to keep the exact source folder structure. The default value is TRUE if the item being imported is a folder. Should not be used if you are importing a file. Bear in mind that if you use preserve_folder_structure = FALSE, that the response will be the parent folder object containing imported files alongside with other files if they exist.

...

Other arguments that can be passed to core api() function like 'fields', etc.

Returns

Import object.

Examples
\dontrun{
 imports_object <- Imports$new(
                    auth = auth
                   )

 # Submit new import into a project
 imports_object$submit_import(
  source_location = volume_file_object,
  destination_project = test_project_object,
  autorename = TRUE
 )
}


Method delete()

Deleting import jobs is not possible.

Usage
Imports$delete()

Method clone()

The objects of this class are cloneable with this method.

Usage
Imports$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples


## ------------------------------------------------
## Method `Imports$query`
## ------------------------------------------------

## Not run: 
 imports_object <- Imports$new(
                    auth = auth
                   )

 # List import job
 imports_object$query()

## End(Not run)


## ------------------------------------------------
## Method `Imports$get`
## ------------------------------------------------

## Not run: 
 imports_object <- Imports$new(
                    auth = auth,
                   )

 # List import job
 imports_object$get(id = id)

## End(Not run)


## ------------------------------------------------
## Method `Imports$submit_import`
## ------------------------------------------------

## Not run: 
 imports_object <- Imports$new(
                    auth = auth
                   )

 # Submit new import into a project
 imports_object$submit_import(
  source_location = volume_file_object,
  destination_project = test_project_object,
  autorename = TRUE
 )

## End(Not run)


[Package sevenbridges2 version 0.1.0 Index]