Skip to content

Commit

Permalink
Commit from m3o/m3o action
Browse files Browse the repository at this point in the history
  • Loading branch information
m3o-actions committed Aug 30, 2023
1 parent a5b9037 commit f135dfe
Show file tree
Hide file tree
Showing 23 changed files with 1,086 additions and 1,086 deletions.
116 changes: 58 additions & 58 deletions examples/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,117 +4,120 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/App/api](https

Endpoints:

## Update
## Get

Update the app. The latest source code will be downloaded, built and deployed.
Get an app by name


[https://m3o.com/app/api#Update](https://m3o.com/app/api#Update)
[https://m3o.com/app/api#Get](https://m3o.com/app/api#Get)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Update the app. The latest source code will be downloaded, built and deployed.
async function updateAnApp() {
const rsp = await appService.update({
// Get an app by name
async function getAnApp() {
const rsp = await appService.get({
"name": "helloworld"
})
console.log(rsp)

}

updateAnApp()
getAnApp()
```
## Logs
## List

Get the logs for an app
List all the apps


[https://m3o.com/app/api#Logs](https://m3o.com/app/api#Logs)
[https://m3o.com/app/api#List](https://m3o.com/app/api#List)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Get the logs for an app
async function retrieveBuildLogsForAnApp() {
const rsp = await appService.logs({
"logs_type": "build",
"name": "helloworld"
})
// List all the apps
async function listTheApps() {
const rsp = await appService.list({})
console.log(rsp)

}

retrieveBuildLogsForAnApp()
listTheApps()
```
## Get
## Run

Get an app by name
Run an app from source


[https://m3o.com/app/api#Get](https://m3o.com/app/api#Get)
[https://m3o.com/app/api#Run](https://m3o.com/app/api#Run)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Get an app by name
async function getAnApp() {
const rsp = await appService.get({
"name": "helloworld"
// Run an app from source
async function runAnApp() {
const rsp = await appService.run({
"branch": "master",
"name": "helloworld",
"port": 8080,
"region": "europe-west1",
"repo": "github.com/asim/helloworld"
})
console.log(rsp)

}

getAnApp()
runAnApp()
```
## List
## Regions

List all the apps
Return the support regions


[https://m3o.com/app/api#List](https://m3o.com/app/api#List)
[https://m3o.com/app/api#Regions](https://m3o.com/app/api#Regions)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// List all the apps
async function listTheApps() {
const rsp = await appService.list({})
// Return the support regions
async function listRegions() {
const rsp = await appService.regions({})
console.log(rsp)

}

listTheApps()
listRegions()
```
## Regions
## Status

Return the support regions
Get the status of an app


[https://m3o.com/app/api#Regions](https://m3o.com/app/api#Regions)
[https://m3o.com/app/api#Status](https://m3o.com/app/api#Status)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Return the support regions
async function listRegions() {
const rsp = await appService.regions({})
// Get the status of an app
async function getTheStatusOfAnApp() {
const rsp = await appService.status({
"name": "helloworld"
})
console.log(rsp)

}

listRegions()
getTheStatusOfAnApp()
```
## Resolve

Expand Down Expand Up @@ -185,53 +188,50 @@ async function reserveAppName() {

reserveAppName()
```
## Run
## Update

Run an app from source
Update the app. The latest source code will be downloaded, built and deployed.


[https://m3o.com/app/api#Run](https://m3o.com/app/api#Run)
[https://m3o.com/app/api#Update](https://m3o.com/app/api#Update)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Run an app from source
async function runAnApp() {
const rsp = await appService.run({
"branch": "master",
"name": "helloworld",
"port": 8080,
"region": "europe-west1",
"repo": "github.com/asim/helloworld"
// Update the app. The latest source code will be downloaded, built and deployed.
async function updateAnApp() {
const rsp = await appService.update({
"name": "helloworld"
})
console.log(rsp)

}

runAnApp()
updateAnApp()
```
## Status
## Logs

Get the status of an app
Get the logs for an app


[https://m3o.com/app/api#Status](https://m3o.com/app/api#Status)
[https://m3o.com/app/api#Logs](https://m3o.com/app/api#Logs)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Get the status of an app
async function getTheStatusOfAnApp() {
const rsp = await appService.status({
// Get the logs for an app
async function retrieveBuildLogsForAnApp() {
const rsp = await appService.logs({
"logs_type": "build",
"name": "helloworld"
})
console.log(rsp)

}

getTheStatusOfAnApp()
retrieveBuildLogsForAnApp()
```
90 changes: 45 additions & 45 deletions examples/cache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,51 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Cache/api](htt

Endpoints:

## Decrement

Decrement a value (if it's a number). If key not found it is equivalent to set.


[https://m3o.com/cache/api#Decrement](https://m3o.com/cache/api#Decrement)

```js
const { CacheService } = require('m3o/cache');

const cacheService = new CacheService(process.env.M3O_API_TOKEN)

// Decrement a value (if it's a number). If key not found it is equivalent to set.
async function decrementAvalue() {
const rsp = await cacheService.decrement({
"key": "counter",
"value": 2
})
console.log(rsp)

}

decrementAvalue()
```
## ListKeys

List all the available keys


[https://m3o.com/cache/api#ListKeys](https://m3o.com/cache/api#ListKeys)

```js
const { CacheService } = require('m3o/cache');

const cacheService = new CacheService(process.env.M3O_API_TOKEN)

// List all the available keys
async function listTheKeys() {
const rsp = await cacheService.listKeys({})
console.log(rsp)

}

listTheKeys()
```
## Set

Set an item in the cache. Overwrites any existing value already set.
Expand Down Expand Up @@ -98,48 +143,3 @@ async function incrementAvalue() {

incrementAvalue()
```
## Decrement

Decrement a value (if it's a number). If key not found it is equivalent to set.


[https://m3o.com/cache/api#Decrement](https://m3o.com/cache/api#Decrement)

```js
const { CacheService } = require('m3o/cache');

const cacheService = new CacheService(process.env.M3O_API_TOKEN)

// Decrement a value (if it's a number). If key not found it is equivalent to set.
async function decrementAvalue() {
const rsp = await cacheService.decrement({
"key": "counter",
"value": 2
})
console.log(rsp)

}

decrementAvalue()
```
## ListKeys

List all the available keys


[https://m3o.com/cache/api#ListKeys](https://m3o.com/cache/api#ListKeys)

```js
const { CacheService } = require('m3o/cache');

const cacheService = new CacheService(process.env.M3O_API_TOKEN)

// List all the available keys
async function listTheKeys() {
const rsp = await cacheService.listKeys({})
console.log(rsp)

}

listTheKeys()
```
Loading

0 comments on commit f135dfe

Please sign in to comment.