admin

package
v1.4.0-rc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2020 License: AGPL-3.0 Imports: 18 Imported by: 0

README

satellite/admin

Satellite Admin package provides API endpoints for administrative tasks.

Requires setting Authorization header for requests.

GET /api/user/{user-email}

This endpoint returns information about user and their projects.

A successful response:

{
    "user":{
        "id": "12345678-1234-1234-1234-123456789abc",
        "fullName": "Alice Bob",
        "email":"alice@example.test"
    },
    "projects":[
        {
            "id": "abcabcab-1234-abcd-abcd-abecdefedcab",
            "name": "Project",
            "description": "Project to store data.",
            "ownerId": "12345678-1234-1234-1234-123456789abc"
        }
    ]
}

GET /api/project/{project-id}/limit

This endpoint returns information about project limits.

A successful response:

{
    "usage": {
        "amount":"0 B",
        "bytes":0
    },
    "rate":{
        "rps":0
    }
}

POST /api/project/{project-id}/limit?usage={value}

Updates usage limit for a project.

POST /api/project/{project-id}/limit?rate={value}

Updates rate limit for a project.

Documentation

Overview

Package admin implements administrative endpoints for satellite.

Index

Constants

This section is empty.

Variables

View Source
var Error = errs.Class("admin")

Error is default error class for admin package.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address string `help:"admin peer http listening address" releaseDefault:"" devDefault:""`

	AuthorizationToken string `internal:"true"`
}

Config defines configuration for debug server.

type DB added in v0.34.1

type DB interface {
	// ProjectAccounting returns database for storing information about project data use
	ProjectAccounting() accounting.ProjectAccounting
	// Console returns database for satellite console
	Console() console.DB
}

DB is databases needed for the admin server.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server provides endpoints for debugging.

func NewServer

func NewServer(log *zap.Logger, listener net.Listener, db DB, config Config) *Server

NewServer returns a new debug.Server.

func (*Server) Close

func (server *Server) Close() error

Close closes server and underlying listener.

func (*Server) Run

func (server *Server) Run(ctx context.Context) error

Run starts the debug endpoint.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL