ovh

package module
v0.0.0-...-e30e572 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

README

Golang OVH API client

GoDoc

Golang API Client for OVH APi.

Command Line Tool

$ go get -u github.com/crackcomm/ovh/...
$ go install github.com/crackcomm/ovh/ovh
$ ovh
NAME:
   ovh - OVH command line tool

USAGE:
   ovh [global options] command [command options] [arguments...]

VERSION:
   1.0.0

COMMANDS:
   auth		requests authentication
   domains	domains
   ns		domain name servers
   help, h	Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --app-key 		OVH API Application Key [$OVH_APP_KEY]
   --app-secret 	OVH API Application Secret [$OVH_APP_SECRET]
   --consumer-key 	OVH API Consumer Key [$OVH_CONSUMER_KEY]
   --help, -h		show help
   --version, -v	print the version

License

Apache 2.0 License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticateRequest

type AuthenticateRequest struct {
	ValidationURL string `json:"validation_url,omitempty"`
	ConsumerKey   string `json:"consumer_key,omitempty"`
}

AuthenticateRequest - Authentication request.

type Client

type Client struct {
	// User - OVH user info API client.
	*User
	// Domains - OVH domains API client.
	*Domains
	// NameServers - OVH name servers API client.
	*NameServers
	// Options - OVH API client options.
	*Options
}

Client - OVH API Client.

func New

func New(opts *Options) *Client

New - Creates a new OVH client.

func (*Client) Authenticate

func (client *Client) Authenticate(ctx context.Context, callbackURL ...string) (result *AuthenticateRequest, err error)

Authenticate - Requests OVH authentiction. It is ok to use one callback url or none.

type Domain

type Domain struct {
	Name string `json:"name,omitempty"`

	Offer              string `json:"offer,omitempty"`
	WhoisOwner         string `json:"whois_owner,omitempty"`
	LastUpdate         string `json:"last_update,omitempty"`
	NameServerType     string `json:"name_server_type,omitempty"`
	TransferLockStatus string `json:"transfer_lock_status,omitempty"`

	OwoSupported               bool `json:"owo_supported,omitempty"`
	DnssecSupported            bool `json:"dnssec_supported,omitempty"`
	GlueRecordIpv6Supported    bool `json:"glue_record_ipv6_supported,omitempty"`
	GlueRecordMultiIPSupported bool `json:"glue_record_multi_ip_supported,omitempty"`

	NameServers []*NameServer `json:"name_servers,omitempty"`
}

Domain - Domain structure.

type DomainPatch

type DomainPatch struct {
	NameServerType     string `json:"name_server_type,omitempty"`
	TransferLockStatus string `json:"transfer_lock_status,omitempty"`
}

DomainPatch - Domain patch request.

type Domains

type Domains struct {
	// Options - Client options.
	*Options
}

Domains - OVH Domains API Client.

func (*Domains) Details

func (domains *Domains) Details(ctx context.Context, domain string) (result *Domain, err error)

Details - Gets domain details by domain name.

func (*Domains) List

func (domains *Domains) List(ctx context.Context) (result []string, err error)

List - Lists domains.

func (*Domains) Patch

func (domains *Domains) Patch(ctx context.Context, domain string, p *DomainPatch) (err error)

Patch - Patches a domain details by domain name in domain.Name.

type NameServer

type NameServer struct {
	ID       string `json:"id,omitempty"`
	Host     string `json:"host,omitempty"`
	ToDelete bool   `json:"to_delete,omitempty"`
	IsUsed   bool   `json:"is_used,omitempty"`
}

NameServer - Name Server structure.

type NameServers

type NameServers struct {
	// Options - Client options.
	*Options
}

NameServers - OVH Domains Name Servers API Client.

func (*NameServers) Delete

func (nameservers *NameServers) Delete(ctx context.Context, domain, id string) (err error)

Delete - Deletes domain nameserver by domain name and name server ID.

func (*NameServers) Details

func (nameservers *NameServers) Details(ctx context.Context, domain, id string) (result *NameServer, err error)

Details - Gets domain nameserver info by domain name and name server ID.

func (*NameServers) Insert

func (nameservers *NameServers) Insert(ctx context.Context, domain string, nameserver ...string) (err error)

Insert - Inserts domain nameservers to domain.

func (*NameServers) List

func (nameservers *NameServers) List(ctx context.Context, domain string) (result []*NameServer, err error)

List - Gets domain nameservers info by domain name.

type Options

type Options struct {
	AppKey      string
	AppSecret   string
	ConsumerKey string
}

Options - OVH API Client Options.

type User

type User struct {
	// Options - Client options.
	*Options
}

User - OVH User info API Client.

func (*User) Info

func (user *User) Info(ctx context.Context) (result *UserInfo, err error)

Info - Gets information about authenticated consumer.

type UserInfo

type UserInfo struct {
	Name      string `json:"name,omitempty"`
	Email     string `json:"email,omitempty"`
	FirstName string `json:"first_name,omitempty"`
	LastName  string `json:"last_name,omitempty"`
}

UserInfo - User info structure.

Directories

Path Synopsis
ovh
cmd
Package cmd implements OVH cli commands.
Package cmd implements OVH cli commands.

Jump to

Keyboard shortcuts

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