DagsHubApi - JavaScript client for dags_hub_api This API provides a way to retrive & interact with data about DagsHub repositories, users, issues, webhooks and more. The API is also used by the DagsHub Direct Data Access streaming client to stream content from a repository for easier and faster training. This SDK is automatically generated by the Swagger Codegen project:
- API version: 1.0.2
- Package version: 1.0.2
- Build package: io.swagger.codegen.v3.generators.javascript.JavaScriptClientCodegen
For Node.js
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install dags_hub_api --save
If the library is hosted at a git repository, e.g. https://github.com/DagsHub/api-clients then install it via:
npm install DagsHub/api-clients --save
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Please follow the installation instruction and execute the following JS code:
var DagsHubApi = require('dags_hub_api');
var defaultClient = DagsHubApi.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME'
basicAuth.password = 'YOUR PASSWORD'
// Configure API key authorization: tokenAuth
var tokenAuth = defaultClient.authentications['tokenAuth'];
tokenAuth.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//tokenAuth.apiKeyPrefix['token'] = "Token"
var api = new DagsHubApi.BranchesApi()
var owner = "owner_example"; // {String} owner of the repository
var repo = "repo_example"; // {String} name of the repository
var branch = "branch_example"; // {String} branch of the repository
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.getBranch(owner, repo, branch, callback);
All URIs are relative to https://dagshub.com/api/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DagsHubApi.BranchesApi | getBranch | GET /repos/{owner}/{repo}/branches/{branch} | Get Branch |
| DagsHubApi.BranchesApi | listBranches | GET /repos/{owner}/{repo}/branches | List Branches |
| DagsHubApi.CollaboratorsApi | addCollaborator | PUT /repos/{owner}/{repo}/collaborators/{collaborator} | Add user as a collaborator |
| DagsHubApi.CollaboratorsApi | getCollaborators | GET /repos/{owner}/{repo}/collaborators | Get collaborators |
| DagsHubApi.CollaboratorsApi | removeCollaborator | DELETE /repos/{owner}/{repo}/collaborators/{collaborator} | Delete collaborator |
| DagsHubApi.CommitsApi | getCommit | GET /repos/{owner}/{repo}/commits/{sha} | Get a single commit |
| DagsHubApi.ContentApi | getArchive | GET /repos/{owner}/{repo}/archive/{ref}{format} | Download archive |
| DagsHubApi.ContentApi | getContent | GET /repos/{owner}/{repo}/content/{branch}/{path} | List data in a repository folder |
| DagsHubApi.ContentApi | getRaw | GET /repos/{owner}/{repo}/raw/{ref}/{path} | Download raw content |
| DagsHubApi.ContentApi | uploadContent | PUT /repos/{owner}/{repo}/content/{branch}/{path} | Upload data to a repository |
| DagsHubApi.ExperimentsApi | addExperimentLabel | POST /repos/{owner}/{repo}/experiments/experiment/{experimentKey}/labels/{experimentLabel} | Add label to experiment |
| DagsHubApi.ExperimentsApi | deleteExperiment | DELETE /repos/{owner}/{repo}/experiments/experiment/{experimentKey} | Delete experiment |
| DagsHubApi.ExperimentsApi | deleteExperimentLabel | DELETE /repos/{owner}/{repo}/experiments/experiment/{experimentKey}/labels/{experimentLabel} | Delete experiment label |
| DagsHubApi.ExperimentsApi | editExperiment | POST /repos/{owner}/{repo}/experiments/experiment/{experimentKey} | Edit experiment info |
| DagsHubApi.ExperimentsApi | getExperimentMetrics | POST /repos/{owner}/{repo}/experiments/metricsForExperiments | Get experiment metrics for experiment |
| DagsHubApi.ExperimentsApi | getExperiments | GET /repos/{owner}/{repo}/experiments | List Experiments |
| DagsHubApi.IssuesApi | createIssue | POST /repos/{owner}/{repo}/issues | Create an issue |
| DagsHubApi.IssuesApi | editIssue | PATCH /repos/{owner}/{repo}/issues | Edit an issue |
| DagsHubApi.IssuesApi | getIssue | GET /repos/{owner}/{repo}/issues/{index} | Get a single issue |
| DagsHubApi.IssuesApi | listRepoIssues | GET /repos/{owner}/{repo}/issues | List issues for a repository |
| DagsHubApi.ReleasesApi | listReleases | GET /repos/{owner}/{repo}/releases | List Releases |
| DagsHubApi.RepositoryApi | createOrgRepo | POST /org/{orgname}/repos | Create in organization |
| DagsHubApi.RepositoryApi | createRepo | POST /user/repos | Create |
| DagsHubApi.RepositoryApi | getRepo | GET /repos/{owner}/{repo} | Get repository information |
| DagsHubApi.RepositoryApi | listMyRepos | GET /user/repos | List your repositories |
| DagsHubApi.RepositoryApi | listOrgRepos | GET /orgs/{orgname}/repos | List organization repositories |
| DagsHubApi.RepositoryApi | listUserRepos | GET /users/{username}/repos | List user repositories |
| DagsHubApi.RepositoryApi | migrateRepo | POST /repos/migrate | Migrate repository |
| DagsHubApi.RepositoryApi | search | GET /repos/search | Search repositories |
| DagsHubApi.StorageIntegrationsApi | getBucketContent | GET /repos/{owner}/{repo}/storage/content/{protocol}/{bucket}/{path} | List contents in the path |
| DagsHubApi.StorageIntegrationsApi | getBucketFile | GET /repos/{owner}/{repo}/storage/raw/{protocol}/{bucket}/{path} | Get file in the bucket |
| DagsHubApi.StorageIntegrationsApi | getBuckets | GET /repos/{owner}/{repo}/storage | List integrated storages in the repository |
| DagsHubApi.UserApi | getAuthenticatedUser | GET /user | Get authenticated user information |
| DagsHubApi.UserApi | getUser | GET /users/{username} | Get information about a user |
| DagsHubApi.WebhooksApi | createHook | POST /repos/{owner}/{repo}/hooks | Create a hook |
| DagsHubApi.WebhooksApi | deleteHook | DELETE /repos/{owner}/{repo}/hooks/{id} | Delete a hook |
| DagsHubApi.WebhooksApi | editHook | PATCH /repos/{owner}/{repo}/hooks/{id} | Edit a hook |
| DagsHubApi.WebhooksApi | listHooks | GET /repos/{owner}/{repo}/hooks | List hooks |
- DagsHubApi.Assignee
- DagsHubApi.Body
- DagsHubApi.Closed
- DagsHubApi.CollaboratorsCollaboratorBody
- DagsHubApi.CreateRepo
- DagsHubApi.EditExperimentPost
- DagsHubApi.ExperimentKeys
- DagsHubApi.File
- DagsHubApi.Files
- DagsHubApi.Files1
- DagsHubApi.HooksIdBody
- DagsHubApi.Integration
- DagsHubApi.IntegrationInner
- DagsHubApi.Issue
- DagsHubApi.IssueAssignee
- DagsHubApi.IssueLabels
- DagsHubApi.IssueMilestone
- DagsHubApi.Issues
- DagsHubApi.Labels
- DagsHubApi.MigrateRepo
- DagsHubApi.Milestone
- DagsHubApi.PatchIssue
- DagsHubApi.PostIssue
- DagsHubApi.PutFile
- DagsHubApi.RepoHooksBody
- DagsHubApi.State
- DagsHubApi.Title
- DagsHubApi.User
- DagsHubApi.WebhookConfig
- DagsHubApi.WebhookEvents
- Type: HTTP basic authentication
- Type: API key
- API key parameter name: token
- Location: URL query string