internal

package
v4.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultIdentityEndpoint = "https://iam.eu-de.otc.t-systems.com:443/v3/auth/tokens"

DefaultIdentityEndpoint the default API identity endpoint.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Identity Identity `json:"identity"`
	Scope    Scope    `json:"scope"`
}

type Catalog

type Catalog struct {
	ID        string     `json:"id,omitempty"`
	Type      string     `json:"type,omitempty"`
	Name      string     `json:"name,omitempty"`
	Endpoints []Endpoint `json:"endpoints,omitempty"`
}

type Client

type Client struct {
	IdentityEndpoint string

	HTTPClient *http.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(username string, password string, domainName string, projectName string) *Client

func (*Client) DeleteRecordSet

func (c *Client) DeleteRecordSet(ctx context.Context, zoneID, recordID string) error

DeleteRecordSet delete a record set. https://docs.otc.t-systems.com/domain-name-service/api-ref/apis/record_set_management/deleting_a_record_set.html

func (*Client) GetRecordSetID

func (c *Client) GetRecordSetID(ctx context.Context, zoneID, fqdn string) (string, error)

func (*Client) GetZoneID

func (c *Client) GetZoneID(ctx context.Context, zone string) (string, error)

func (*Client) Login

func (c *Client) Login(ctx context.Context) error

Login Starts a new OTC API Session. Authenticates using userName, password and receives a token to be used in for subsequent requests.

type DNSServerMock

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

DNSServerMock mock.

func NewDNSServerMock

func NewDNSServerMock(t *testing.T) *DNSServerMock

NewDNSServerMock create a new DNSServerMock.

func (*DNSServerMock) GetServerURL

func (m *DNSServerMock) GetServerURL() string

func (*DNSServerMock) HandleAuthSuccessfully

func (m *DNSServerMock) HandleAuthSuccessfully()

HandleAuthSuccessfully Handle auth successfully.

func (*DNSServerMock) HandleDeleteRecordsetsSuccessfully

func (m *DNSServerMock) HandleDeleteRecordsetsSuccessfully()

HandleDeleteRecordsetsSuccessfully Handle delete recordsets successfully.

func (*DNSServerMock) HandleListRecordsetsEmpty

func (m *DNSServerMock) HandleListRecordsetsEmpty()

HandleListRecordsetsEmpty Handle list recordsets empty.

func (*DNSServerMock) HandleListRecordsetsSuccessfully

func (m *DNSServerMock) HandleListRecordsetsSuccessfully()

HandleListRecordsetsSuccessfully Handle list recordsets successfully.

func (*DNSServerMock) HandleListZonesEmpty

func (m *DNSServerMock) HandleListZonesEmpty()

HandleListZonesEmpty Handle list zones empty.

func (*DNSServerMock) HandleListZonesSuccessfully

func (m *DNSServerMock) HandleListZonesSuccessfully()

HandleListZonesSuccessfully Handle list zones successfully.

func (*DNSServerMock) ShutdownServer

func (m *DNSServerMock) ShutdownServer()

ShutdownServer creates the mock server.

type Domain

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

type Endpoint

type Endpoint struct {
	ID        string `json:"id,omitempty"`
	URL       string `json:"url,omitempty"`
	Region    string `json:"region,omitempty"`
	RegionID  string `json:"region_id,omitempty"`
	Interface string `json:"interface,omitempty"`
}

type Identity

type Identity struct {
	Methods  []string `json:"methods"`
	Password Password `json:"password"`
}
type Links struct {
	Self string `json:"self,omitempty"`
	Next string `json:"next,omitempty"`
}

type LoginRequest

type LoginRequest struct {
	Auth Auth `json:"auth"`
}

type Metadata

type Metadata struct {
	TotalCount int `json:"total_count,omitempty"`
}

type Password

type Password struct {
	User User `json:"user"`
}

type Project

type Project struct {
	Name string `json:"name"`
}

type RecordSets

type RecordSets struct {
	ID          string   `json:"id,omitempty"`
	Name        string   `json:"name,omitempty"`
	Description string   `json:"description,omitempty"`
	Type        string   `json:"type,omitempty"`
	TTL         int      `json:"ttl,omitempty"`
	Records     []string `json:"records,omitempty"`

	Status    string `json:"status,omitempty"`
	Links     *Links `json:"links,omitempty"`
	ZoneID    string `json:"zone_id,omitempty"`
	ZoneName  string `json:"zone_name,omitempty"`
	CreateAt  string `json:"create_at,omitempty"`
	UpdateAt  string `json:"update_at,omitempty"`
	Default   bool   `json:"default,omitempty"`
	ProjectID string `json:"project_id,omitempty"`
}

type RecordSetsResponse

type RecordSetsResponse struct {
	Links      Links        `json:"links"`
	RecordSets []RecordSets `json:"recordsets"`
	Metadata   Metadata     `json:"metadata"`
}

type Role

type Role struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

type Scope

type Scope struct {
	Project Project `json:"project"`
}

type Token

type Token struct {
	User      UserR     `json:"user,omitempty"`
	Domain    Domain    `json:"domain,omitempty"`
	Catalog   []Catalog `json:"catalog,omitempty"`
	Methods   []string  `json:"methods,omitempty"`
	Roles     []Role    `json:"roles,omitempty"`
	ExpiresAt string    `json:"expires_at,omitempty"`
	IssuedAt  string    `json:"issued_at,omitempty"`
}

type TokenResponse

type TokenResponse struct {
	Token Token `json:"token"`
}

type User

type User struct {
	Name     string `json:"name"`
	Password string `json:"password"`
	Domain   Domain `json:"domain"`
}

type UserR

type UserR struct {
	ID                string `json:"id,omitempty"`
	Domain            Domain `json:"domain,omitempty"`
	Name              string `json:"name,omitempty"`
	PasswordExpiresAt string `json:"password_expires_at,omitempty"`
}

type Zone

type Zone struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Email       string `json:"email,omitempty"`
	TTL         int    `json:"ttl,omitempty"`
	Serial      int    `json:"serial,omitempty"`
	Status      string `json:"status,omitempty"`
	Links       *Links `json:"links,omitempty"`
	PoolID      string `json:"pool_id,omitempty"`
	ProjectID   string `json:"project_id,omitempty"`
	ZoneType    string `json:"zone_type,omitempty"`
	CreatedAt   string `json:"created_at,omitempty"`
	UpdatedAt   string `json:"updated_at,omitempty"`
	RecordNum   int    `json:"record_num,omitempty"`
}

type ZonesResponse

type ZonesResponse struct {
	Links    Links    `json:"links,omitempty"`
	Zones    []Zone   `json:"zones"`
	Metadata Metadata `json:"metadata"`
}

Jump to

Keyboard shortcuts

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