modoki_api
v1.0.1
Published
ERROR_UNKNOWN
Downloads
4
Readme
modoki_api
ModokiApi - JavaScript client for modoki_api No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) This SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
Installation
For Node.js
npm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install modoki_api --save
Local development
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing
into the directory containing package.json
(and this README). Let's call this JAVASCRIPT_CLIENT_DIR
. Then run:
npm install
Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR
:
npm link
Finally, switch to the directory you want to use your modoki_api from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
You should now be able to require('modoki_api')
in javascript files from the directory you ran the last
command above from.
git
If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --save
For browser
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, that's to say your javascript file where you actually
use this library):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Webpack Configuration
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
}
}
]
}
Getting Started
Please follow the installation instruction and execute the following JS code:
var ModokiApi = require('modoki_api');
var defaultClient = ModokiApi.ApiClient.instance;
// Configure API key authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//jwt.apiKeyPrefix['Authorization'] = "Token"
var api = new ModokiApi.ContainerApi()
var image = "image_example"; // {String} Name of image
var name = "name_example"; // {String} Name of container and subdomain
var opts = {
'command': ["inner_example"], // {[String]} Command to run specified as a string or an array of strings.
'entrypoint': ["inner_example"], // {[String]} The entry point for the container as a string or an array of strings
'env': ["inner_example"], // {[String]} Environment variables
'sslRedirect': true, // {Boolean} Whether HTTP is redirected to HTTPS
'volumes': ["inner_example"], // {[String]} Path to volumes in a container
'workingDir': "workingDir_example" // {String} Current directory (PWD) in the command will be launched
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.containerCreate(image, name, opts, callback);
Documentation for API Endpoints
All URIs are relative to http://localhost:4434/api/v2
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- ModokiApi.ContainerApi | containerCreate | GET /container/create | create container ModokiApi.ContainerApi | containerDownload | GET /container/{id}/download | download container ModokiApi.ContainerApi | containerDownload1 | HEAD /container/download | download container ModokiApi.ContainerApi | containerExec | GET /container/{id}/exec | exec container ModokiApi.ContainerApi | containerGetConfig | GET /container/{id}/config | getConfig container ModokiApi.ContainerApi | containerInspect | GET /container/{id}/inspect | inspect container ModokiApi.ContainerApi | containerList | GET /container/list | list container ModokiApi.ContainerApi | containerLogs | GET /container/{id}/logs | logs container ModokiApi.ContainerApi | containerRemove | GET /container/{id}/remove | remove container ModokiApi.ContainerApi | containerSetConfig | POST /container/{id}/config | setConfig container ModokiApi.ContainerApi | containerStart | GET /container/{id}/start | start container ModokiApi.ContainerApi | containerStop | GET /container/{id}/stop | stop container ModokiApi.ContainerApi | containerUpload | POST /container/{id}/upload | upload container ModokiApi.UserApi | userAddAuthorizedKeys | PUT /user/config/authorizedKeys | addAuthorizedKeys user ModokiApi.UserApi | userGetConfig | GET /user/config | getConfig user ModokiApi.UserApi | userGetDefaultShell | GET /user/config/defaultShell | getDefaultShell user ModokiApi.UserApi | userListAuthorizedKeys | GET /user/config/authorizedKeys | listAuthorizedKeys user ModokiApi.UserApi | userRemoveAuthorizedKeys | DELETE /user/config/authorizedKeys | removeAuthorizedKeys user ModokiApi.UserApi | userSetAuthorizedKeys | POST /user/config/authorizedKeys | setAuthorizedKeys user ModokiApi.UserApi | userSetDefaultShell | POST /user/config/defaultShell | setDefaultShell user
Documentation for Models
- ModokiApi.ContainerConfig
- ModokiApi.Error
- ModokiApi.GoaContainerConfig
- ModokiApi.GoaContainerCreateResults
- ModokiApi.GoaContainerInspect
- ModokiApi.GoaContainerInspectRawState
- ModokiApi.GoaContainerListEach
- ModokiApi.GoaContainerListEachCollection
- ModokiApi.GoaUserAuthorizedkey
- ModokiApi.GoaUserAuthorizedkeyCollection
- ModokiApi.GoaUserConfig
- ModokiApi.GoaUserDefaultshell
- ModokiApi.SetAuthorizedKeysUserPayload
- ModokiApi.UserAuthorizedKey
Documentation for Authorization
jwt
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header