Skip to content

Latest commit

 

History

History
1102 lines (666 loc) · 35.2 KB

AppApi.md

File metadata and controls

1102 lines (666 loc) · 35.2 KB

\AppApi

All URIs are relative to http://localhost

Method HTTP request Description
AppBuild Post /1.5/apps/{app}/build
AppCnameAdd Post /1.0/apps/{app}/cname
AppCnameDelete Delete /1.0/apps/{app}/cname
AppCreate Post /1.0/apps
AppDelete Delete /1.0/apps/{app}
AppDeploy Post /1.0/apps/{app}/deploy
AppGet Get /1.0/apps/{app}
AppGetCertificates Get /1.24/apps/{app}/certificate
AppList Get /1.0/apps
AppQuotaChange Put /1.0/apps/{app}/quota
AppQuotaGet Get /1.0/apps/{app}/quota
AppRestart Post /1.0/apps/{app}/restart
AppRouterAdd Post /1.5/apps/{app}/routers
AppRouterDelete Delete /1.5/apps/{app}/routers/{router}
AppRouterList Get /1.5/apps/{app}/routers
AppRouterUpdate Put /1.5/apps/{app}/routers/{router}
AppRun Post /1.0/apps/{app}/run
AppSetCertIssuer Put /1.24/apps/{app}/certissuer
AppSetRoutable Post /1.8/apps/{app}/routable
AppStart Post /1.0/apps/{app}/start
AppStop Post /1.0/apps/{app}/stop
AppTeamGrant Put /1.0/apps/{app}/teams/{team}
AppTeamRevoke Delete /1.0/apps/{app}/teams/{team}
AppUnsetCertIssuer Delete /1.24/apps/{app}/certissuer
AppUpdate Put /1.0/apps/{app}
AutoScaleAdd Post /1.9/apps/{app}/units/autoscale
AutoScaleInfo Get /1.9/apps/{app}/units/autoscale
AutoScaleRemove Delete /1.9/apps/{app}/units/autoscale
CertificatUnset Delete /1.0/apps/{app}/certificate
CertificateSet Put /1.0/apps/{app}/certificate
EnvGet Get /1.0/apps/{app}/env
EnvSet Post /1.0/apps/{app}/env
EnvUnset Delete /1.0/apps/{app}/env
UnitsAdd Put /1.0/apps/{app}/units
UnitsRemove Delete /1.0/apps/{app}/units

AppBuild

AppBuild(ctx, app, tag, optional)

Build a Tsuru app image (a regular container image) following the deploy's workflow but don't roll it out to the provisioner. That ends up with a container image that can be pulled by the user or used to deploy the app later.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string Application name
tag string Container image's tag reference. It must be a valid tag reference according to container image's name specification. Examples: `staging`, `feature-abc`, `42.1.0`
optional *AppBuildOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a AppBuildOpts struct

Name Type Description Notes

file | *optional.Interface of os.File***optional.os.File| App's source files (tarball compressed with gzip). NOTE 1: When `dockerfile` field is set, this field contains the container build context files. NOTE 2: Cannot be presented mutually with `archive-url` or `image`. | archiveUrl | optional.String| HTTP URL to app's source files. NOTE 1: Tsuru API must be able to download the file over HTTP and the downloaded file must be a tarball compressed with gzip. NOTE 2: Cannot be presented mutually with `dockerfile`, `file` or `image`. Example: `https://my-org.example.com/my-app/v42.tar.gz`. | image | optional.String| Container image name. It must be a valid container image name according to container image's name specification. NOTE: Cannot be presented mutually with `archive-url`, `dockerfile` or `file`. Example: `registry.example.com/my-org/my-app:v42` | dockerfile | optional.String| Content of container file (Dockerfile). It must be a valid file according to Dockerfile reference. NOTE: Cannot be presented mutually with `archive-url` or `image`. Example: ``` FROM alpine:3.16 RUN set -x \\ apk add --update --no-cache curl ca-certificates COPY ./app.sh ./tsuru.yaml /var/my-app/ WORKDIR /var/my-app EXPOSE 8888/tcp ENTRYPOINT [\"/var/my-app/app.sh\"] CMD [\"--port\", \"8888\"] ``` |

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: text/plain

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppCnameAdd

AppCnameAdd(ctx, app, appCName)

adds a cname to app

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
appCName AppCName

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppCnameDelete

AppCnameDelete(ctx, app, appCName)

remove cname from app

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
appCName AppCName

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppCreate

AppCreateResponse AppCreate(ctx, inputApp)

Create a new app.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
inputApp InputApp

Return type

AppCreateResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppDelete

AppDelete(ctx, app)

Delete a tsuru app.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/x-json-stream

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppDeploy

AppDeploy(ctx, app, optional)

Build a new Tsuru app image and roll it out to the provisioner.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string Application name
optional *AppDeployOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a AppDeployOpts struct

Name Type Description Notes

newVersion | optional.Bool| Whether should create a new version while preserving the old ones in the provisioner. | [default to false] overrideVersions | optional.Bool| Whether should replace all versions in the provisioner by this new one. | [default to false] message | optional.String| Message to describe the deploy. Example: `Updating the driver connector of MongoDB (vX.Y.Z)` | origin | optional.String| The type of client who originates the deploy. | file | *optional.Interface of os.File***optional.os.File| App's source files (tarball compressed with gzip). NOTE 1: When `dockerfile` field is set, this field contains the container build context files. NOTE 2: Cannot be presented mutually with `archive-url` or `image`. | archiveUrl | optional.String| HTTP URL to app's source files. NOTE 1: Tsuru API must be able to download the file over HTTP and the downloaded file must be a tarball compressed with gzip. NOTE 2: Cannot be presented mutually with `dockerfile`, `file` or `image`. Example: `https://my-org.example.com/my-app/v42.tar.gz`. | image | optional.String| Container image name. It must be a valid container image name according to container image's name specification. NOTE: Cannot be presented mutually with `archive-url`, `dockerfile` or `file`. Example: `registry.example.com/my-org/my-app:v42` | dockerfile | optional.String| Content of container file (Dockerfile). It must be a valid file according to Dockerfile reference. NOTE: Cannot be presented mutually with `archive-url` or `image`. Example: ``` FROM alpine:3.16 RUN set -x \\ apk add --update --no-cache curl ca-certificates COPY ./app.sh ./tsuru.yaml /var/my-app/ WORKDIR /var/my-app EXPOSE 8888/tcp ENTRYPOINT [\"/var/my-app/app.sh\"] CMD [\"--port\", \"8888\"] ``` |

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: text/plain

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppGet

App AppGet(ctx, app)

Get info about a tsuru app.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.

Return type

App

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppGetCertificates

AppCertificates AppGetCertificates(ctx, app)

Get the certificate for the app.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string Application name

Return type

AppCertificates

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppList

[]MiniApp AppList(ctx, optional)

List apps.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional *AppListOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a AppListOpts struct

Name Type Description Notes
locked optional.Bool Filter applications by lock status.
name optional.String Filter applications by name.
owner optional.String Filter applications by owner.
platform optional.String Filter applications by platform.
pool optional.String Filter applications by pool.
status optional.String Filter applications by unit status.
tag optional.Interface of []string Filter applications by tag.
teamOwner optional.String Filter applications by team owner.
simplified optional.Bool Returns applications without units list.

Return type

[]MiniApp

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppQuotaChange

AppQuotaChange(ctx, app, limit)

Changes the maximum limit of units allowed for use.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
limit float32 Number of units allowed for use by the current app. Negative number indicates unlimited.

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppQuotaGet

Quota AppQuotaGet(ctx, app)

Shows app usage info and its quota limit.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.

Return type

Quota

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppRestart

AppRestart(ctx, app, appStartStop)

Restart App.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
appStartStop AppStartStop

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/x-json-stream

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppRouterAdd

AppRouterAdd(ctx, app, appRouter)

adds a router to app

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
appRouter AppRouter

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppRouterDelete

AppRouterDelete(ctx, app, router)

Delete a tsuru app.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
router string Router name

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppRouterList

[]AppRouter AppRouterList(ctx, app)

list routers from an app

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.

Return type

[]AppRouter

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppRouterUpdate

AppRouterUpdate(ctx, app, router, appRouter)

update a router

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
router string Router name
appRouter AppRouter

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppRun

AppRun(ctx, app, appRunOpts)

run commands inside an app

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
appRunOpts AppRunOpts Options to run commands inside an app

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/x-json-stream

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppSetCertIssuer

AppSetCertIssuer(ctx, app, certIssuerSetData)

Set the certificate issuer for the app.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string Application name
certIssuerSetData CertIssuerSetData

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppSetRoutable

AppSetRoutable(ctx, app, setRoutableArgs)

Sets a version as routable.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
setRoutableArgs SetRoutableArgs

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppStart

AppStart(ctx, app, appStartStop)

Start App.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
appStartStop AppStartStop

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/x-json-stream

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppStop

AppStop(ctx, app, appStartStop)

Stop App.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
appStartStop AppStartStop

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/x-json-stream

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppTeamGrant

AppTeamGrant(ctx, app, team)

grant access to a team

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
team string Team name

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppTeamRevoke

AppTeamRevoke(ctx, app, team)

grant access to a team

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
team string Team name

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppUnsetCertIssuer

AppUnsetCertIssuer(ctx, app, cname)

Unset the certificate issuer for the app.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string Application name
cname string Certificate CNAME

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AppUpdate

AppUpdate(ctx, app, updateApp)

Update a tsuru app.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
updateApp UpdateApp

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/x-json-stream

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AutoScaleAdd

AutoScaleAdd(ctx, app, autoScaleSpec)

Add new unit autoscale spec.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
autoScaleSpec AutoScaleSpec

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AutoScaleInfo

[]AutoScaleSpec AutoScaleInfo(ctx, app)

List autoscales for app.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.

Return type

[]AutoScaleSpec

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AutoScaleRemove

AutoScaleRemove(ctx, app, process)

Remove unit autoscale spec.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
process string

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CertificatUnset

CertificatUnset(ctx, app)

Unset app certificate.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CertificateSet

CertificateSet(ctx, app, certificateSetData)

Create a certificate

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
certificateSetData CertificateSetData

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

EnvGet

[]EnvVar EnvGet(ctx, app, optional)

Get app environment variables.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
optional *EnvGetOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a EnvGetOpts struct

Name Type Description Notes

env | optional.String| Environment variable name. |

Return type

[]EnvVar

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

EnvSet

EnvSet(ctx, app, envSetData)

Set new environment variable.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
envSetData EnvSetData Environment variables.

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/x-json-stream

[Back to top] [Back to API list] [Back to Model list] [Back to README]

EnvUnset

EnvUnset(ctx, app, env, norestart)

Unset app environment variables.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
env []string
norestart bool

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/x-json-stream

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UnitsAdd

UnitsAdd(ctx, app, unitsDelta)

Add units to app

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
unitsDelta UnitsDelta number of units to add

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/x-json-stream

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UnitsRemove

UnitsRemove(ctx, app, unitsDelta)

Remove units from app

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
app string App name.
unitsDelta UnitsDelta number of units to remove

Return type

(empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/x-json-stream

[Back to top] [Back to API list] [Back to Model list] [Back to README]