Auth-class {sevenbridges} | R Documentation

## Class Auth

### Description

Auth object

### Details

Every object could be requested from this Auth object and any action could start from this object using cascading style. Please check `vignette("api")` for more information.

### Fields

`from`

  [character] Authentication method. Could be `"direct"` (pass the credential information to the arguments directly), `"env"` (read from pre-set system environment variables), or `"file"` (read configurations from a credentials file). Default is `"direct"`.

`platform`

  [character] Which platform you want to use, if platform and url are both not specified, the default is `"cgc"` (Cancer Genomics Cloud). Possible values include `"cgc"`, `"aws-us"`, `"aws-eu"`, `"gcp"`, and `"cavatica"`.

`url`

  [character] Base URL for API. Please only use this when you want to specify a platform that is not in the `platform` list above, and also leaving `platform` unspecified.

`token`

  [character] Your authentication token.

`sysenv_url`

  Name of the system environment variable storing the API base URL. By default: `"SB_API_ENDPOINT"`.

`sysenv_token`

  Name of the system environment variable storing the auth token. By default: `"SB_AUTH_TOKEN"`.

`config_file`

  [character] Location of the user configuration file. By default: `"~/.sevenbridges/credentials"`.

`profile_name`

  [character] Profile name in the user configuration file. The default value is `"default"`.

`fs`

  FS object, for mount and unmount file system.

### Methods

`api(..., limit = getOption("sevenbridges")$limit, offset = getOption("sevenbridges")$offset, fields = NULL, complete = FALSE)`

  This call returns all API paths, and pass arguments to api() function and input token and url automatically

`billing(id = NULL, breakdown = FALSE, ...)`

  If no id provided, This call returns a list of paths used to access billing information via the API. else, This call lists all your billing groups, including groups that are pending or have been disabled. if breakdown = TRUE, This call returns a breakdown of spending per-project for the billing group specified by billing_group. For each project that the billing group is associated with, information is shown on the tasks run, including their initiating user (the runner), start and end times, and cost.

`file(name = NULL, id = NULL, project = NULL, exact = FALSE, detail = FALSE, metadata = list(), origin.task = NULL, tag = NULL, complete = FALSE, search.engine = c("server", "brute"), ...)`

  This call returns a list of all files in a specified project that you can access. For each file, the call returns: 1) Its ID 2) Its filename The project is specified as a query parameter in the call.

`invoice(id = NULL, ...)`

  If no id provided, This call returns a list of invoices, with information about each, including whether or not the invoice is pending and the billing period it covers.

  The call returns information about all your available invoices, unless you use the query parameter bg_id to specify the ID of a particular billing group, in which case it will return the invoice incurred by that billing group only.

  If id was provided, This call retrieves information about a selected invoice, including the costs for analysis and storage, and the invoice period.

`project(name = NULL, id = NULL, index = NULL, ignore.case = TRUE, exact = FALSE, owner = NULL, detail = FALSE, ...)`

  If no id or name provided, this call returns a list of all projects you are a member of. Each project's project_id and URL on the CGC will be returned. If name or id provided, we did a match search the list

`project_new(name = NULL, billing_group_id = NULL, description = name, tags = list(), type = "v2", ...)`

  Create new projects, required parameters: name, billing_group_id, optional parameteres: tags and description, type.

`project_owner(owner = NULL, ...)`

  List the projects owned by and accessible to a particular user. Each project's ID and URL will be returned.

`rate_limit(...)`

  This call returns information about your current rate limit. This is the number of API calls you can make in one hour.

`user(username = NULL, ...)`

  This call returns a list of the resources, such as projects, billing groups, and organizations, that are accessible to you.

  If you are not an administrator, this call will only return a successful response if username is replaced with your own username. If you are an administrator, you can replace username with the username of any CGC user, to return information on their resources.

`volume(name = NULL, id = NULL, index = NULL, ignore.case = TRUE, exact = FALSE, detail = FALSE, ...)`

  If no id or name provided, this call returns a list of all volumes you are a member of. If name or id provided, we did a match search the list

### Examples

    # Direct authentication (default)
    # replace with your auth token
    token <- "aef7e9e3f6c54fb1b338ac4ecddf1a56"
    a <- Auth(platform = "cgc", token = token)

    ## Not run:
    # Authentication with environment variables
    # This will read system environments variables
    # `SB_API_ENDPOINT` and `SB_AUTH_TOKEN` by default
    a <- Auth(from = "env")

    # Authentication with user configuration file
    # This will load profile `default` from config
    # file `~/.sevenbridges/credentials` by default
    a <- Auth(from = "file")
    ## End(Not run)

[Package sevenbridges version 1.8.1 Index]