admin

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: AGPL-3.0 Imports: 19 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.

POST /api/project

Adds a project for specific user.

A successful request:

{
    "ownerId": "ca7aa0fb-442a-4d4e-aa36-a49abddae837",
    "projectName": "2af8dc53-cadf-4ced-9b5c-e554afdadb51",
}

A successful response:

{
    "projectId": "ca7aa0fb-442a-4d4e-aa36-a49abddae837",
}

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