localDns

package
v0.9.205 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

* Copyright 2022 Baidu, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language governing permissions * and limitations under the License.

* Copyright 2022 Baidu, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language governing permissions * and limitations under the License.

Index

Constants

View Source
const (
	DEFAULT_SERVICE_DOMAIN = "http://privatezone.baidubce.com"
	DEFAULT_MAX_PARALLEL   = 10
	MULTIPART_ALIGN        = 1 << 20        // 1MB
	MIN_MULTIPART_SIZE     = 1 << 20        // 1MB
	DEFAULT_MULTIPART_SIZE = 12 * (1 << 20) // 12MB
	MAX_PART_NUMBER        = 10000
)

Variables

This section is empty.

Functions

func BindVpc

func BindVpc(cli bce.Client, zoneId string, body *BindVpcRequest, clientToken string) error

BindVpc -

PARAMS:

  • cli: the client agent which can perform sending request
  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串
  • body:

RETURNS:

  • error: the return error if any occurs

func DeletePrivateZone

func DeletePrivateZone(cli bce.Client, zoneId string, clientToken string) error

DeletePrivateZone -

PARAMS:

  • cli: the client agent which can perform sending request
  • zoneId: zone的id
  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串
  • body:

RETURNS:

  • error: the return error if any occurs

func DeleteRecord

func DeleteRecord(cli bce.Client, recordId string, clientToken string) error

DeleteRecord -

PARAMS:

  • cli: the client agent which can perform sending request
  • recordId: 解析记录ID
  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串
  • body:

RETURNS:

  • error: the return error if any occurs

func DisableRecord

func DisableRecord(cli bce.Client, recordId string, clientToken string) error

DisableRecord -

PARAMS:

  • cli: the client agent which can perform sending request
  • recordId: 解析记录ID
  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串

RETURNS:

  • error: the return error if any occurs

func EnableRecord

func EnableRecord(cli bce.Client, recordId string, clientToken string) error

EnableRecord -

PARAMS:

  • cli: the client agent which can perform sending request
  • recordId: 解析记录ID
  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串

RETURNS:

  • error: the return error if any occurs

func UnbindVpc

func UnbindVpc(cli bce.Client, zoneId string, body *UnbindVpcRequest, clientToken string) error

UnbindVpc -

PARAMS:

  • cli: the client agent which can perform sending request
  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串
  • body:

RETURNS:

  • error: the return error if any occurs

func UpdateRecord

func UpdateRecord(cli bce.Client, recordId string, body *UpdateRecordRequest, clientToken string) error

UpdateRecord -

PARAMS:

  • cli: the client agent which can perform sending request
  • recordId: 解析记录的ID
  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串
  • body:

RETURNS:

  • error: the return error if any occurs

Types

type AddRecordRequest

type AddRecordRequest struct {
	ClientToken string `json:"-"`
	Rr          string `json:"rr"`
	Value       string `json:"value"`
	Type        string `json:"type"`
	Ttl         int32  `json:"ttl,omitempty"`
	Priority    int32  `json:"priority,omitempty"`
	Description string `json:"description,omitempty"`
}

type AddRecordResponse

type AddRecordResponse struct {
	RecordId string `json:"recordId"`
}

func AddRecord

func AddRecord(cli bce.Client, zoneId string, body *AddRecordRequest, clientToken string) (
	*AddRecordResponse, error)

AddRecord -

PARAMS:

  • cli: the client agent which can perform sending request
  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串
  • body:

RETURNS:

  • *api.AddRecordResponse:
  • error: the return error if any occurs

type BindVpcRequest

type BindVpcRequest struct {
	ClientToken string   `json:"-"`
	Region      string   `json:"region"`
	VpcIds      []string `json:"vpcIds"`
}

type BindVpcRequestVpcIds

type BindVpcRequestVpcIds struct {
}

type Client

type Client struct {
	*bce.BceClient

	// Fileds that used in parallel operation for BOS service
	MaxParallel   int64
	MultipartSize int64
}

Client of bcd service is a kind of BceClient, so derived from BceClient

func NewClient

func NewClient(ak, sk, endpoint string) (*Client, error)

NewClient make the bcd service client with default configuration. Use `cli.Config.xxx` to access the config or change it to non-default value.

func (*Client) AddRecord

func (c *Client) AddRecord(zoneId string, body *AddRecordRequest) (
	*AddRecordResponse, error)

AddRecord -

PARAMS:

  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串
  • body: body参数

RETURNS:

  • *api.AddRecordResponse:
  • error: the return error if any occurs

func (*Client) BindVpc

func (c *Client) BindVpc(zoneId string, body *BindVpcRequest) error

BindVpc -

PARAMS:

  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串
  • body: body参数

RETURNS:

  • error: the return error if any occurs

func (*Client) CreatePrivateZone

func (c *Client) CreatePrivateZone(body *CreatePrivateZoneRequest) (
	*CreatePrivateZoneResponse, error)

CreatePrivateZone -

PARAMS:

  • body: body参数

RETURNS:

  • *api.CreatePrivateZoneResponse:
  • error: the return error if any occurs

func (*Client) DeletePrivateZone

func (c *Client) DeletePrivateZone(zoneId string, clientToken string) error

DeletePrivateZone -

PARAMS:

  • zoneId: zone的id
  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串

RETURNS:

  • error: the return error if any occurs

func (*Client) DeleteRecord

func (c *Client) DeleteRecord(recordId string, clientToken string) error

DeleteRecord -

PARAMS:

  • recordId: 解析记录ID
  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串
  • body: body参数

RETURNS:

  • error: the return error if any occurs

func (*Client) DisableRecord

func (c *Client) DisableRecord(recordId string, clientToken string) error

DisableRecord -

PARAMS:

  • recordId: 解析记录ID
  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串

RETURNS:

  • error: the return error if any occurs

func (*Client) EnableRecord

func (c *Client) EnableRecord(recordId string, clientToken string) error

EnableRecord -

PARAMS:

  • recordId: 解析记录ID
  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串

RETURNS:

  • error: the return error if any occurs

func (*Client) GetPrivateZone

func (c *Client) GetPrivateZone(zoneId string) (*GetPrivateZoneResponse, error)

GetPrivateZone -

PARAMS:

  • zoneId: zone的ID

RETURNS:

  • *api.GetPrivateZoneResponse:
  • error: the return error if any occurs

func (*Client) ListPrivateZone

func (c *Client) ListPrivateZone(request *ListPrivateZoneRequest) (
	*ListPrivateZoneResponse, error)

ListPrivateZone -

PARAMS:

  • request: 获取privateZone列表的入参

RETURNS:

  • *api.ListPrivateZoneResponse:
  • error: the return error if any occurs

func (*Client) ListRecord

func (c *Client) ListRecord(zoneId string, request *ListRecordRequest) (*ListRecordResponse, error)

ListRecord -

PARAMS:

  • zoneId: Zone的ID
  • request: 获取解析记录列表的入参,包含分页数maxKeys和起始标记marker等

RETURNS:

  • *api.ListRecordResponse:
  • error: the return error if any occurs

func (*Client) UnbindVpc

func (c *Client) UnbindVpc(zoneId string, body *UnbindVpcRequest) error

UnbindVpc -

PARAMS:

  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串
  • body: body参数

RETURNS:

  • error: the return error if any occurs

func (*Client) UpdateRecord

func (c *Client) UpdateRecord(recordId string, body *UpdateRecordRequest) error

UpdateRecord -

PARAMS:

  • recordId: 解析记录的ID
  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串
  • body: body参数

RETURNS:

  • error: the return error if any occurs

type CreatePrivateZoneRequest

type CreatePrivateZoneRequest struct {
	ClientToken string `json:"-"`
	ZoneName    string `json:"zoneName"`
}

type CreatePrivateZoneResponse

type CreatePrivateZoneResponse struct {
	ZoneId string `json:"zoneId"`
}

func CreatePrivateZone

func CreatePrivateZone(cli bce.Client, body *CreatePrivateZoneRequest, clientToken string) (
	*CreatePrivateZoneResponse, error)

CreatePrivateZone -

PARAMS:

  • cli: the client agent which can perform sending request
  • clientToken: 幂等性Token,是一个长度不超过64位的ASCII字符串
  • body:

RETURNS:

  • *api.CreatePrivateZoneResponse:
  • error: the return error if any occurs

type DeletePrivateZoneRequest

type DeletePrivateZoneRequest struct {
	ZoneName string `json:"zoneName"`
}

type DeleteRecordRequest

type DeleteRecordRequest struct {
	RecordId    string  `json:"recordId"`
	Rr          string  `json:"rr"`
	Value       string  `json:"value"`
	Type        string  `json:"type"`
	Ttl         *int32  `json:"ttl"`
	Priority    *int32  `json:"priority"`
	Description *string `json:"description"`
}

type GetPrivateZoneResponse

type GetPrivateZoneResponse struct {
	ZoneId      string `json:"zoneId"`
	ZoneName    string `json:"zoneName"`
	RecordCount int32  `json:"recordCount"`
	CreateTime  string `json:"createTime"`
	UpdateTime  string `json:"updateTime"`
	BindVpcs    []Vpc  `json:"bindVpcs"`
}

func GetPrivateZone

func GetPrivateZone(cli bce.Client, zoneId string) (*GetPrivateZoneResponse, error)

GetPrivateZone -

PARAMS:

  • cli: the client agent which can perform sending request
  • zoneId: zone的ID

RETURNS:

  • *api.GetPrivateZoneResponse:
  • error: the return error if any occurs

type GetPrivateZoneResponseBindVpcs

type GetPrivateZoneResponseBindVpcs struct {
}

type ListPrivateZoneRequest

type ListPrivateZoneRequest struct {
	Marker  string
	MaxKeys int
}

type ListPrivateZoneResponse

type ListPrivateZoneResponse struct {
	Marker      string `json:"marker"`
	IsTruncated bool   `json:"isTruncated"`
	NextMarker  string `json:"nextMarker"`
	MaxKeys     int32  `json:"maxKeys"`
	Zones       []Zone `json:"zones"`
}

func ListPrivateZone

func ListPrivateZone(cli bce.Client, marker string, maxKeys int) (
	*ListPrivateZoneResponse, error)

ListPrivateZone -

PARAMS:

  • cli: the client agent which can perform sending request
  • marker: 批量获取列表的查询的起始位置,是一个由系统生成的字符串
  • maxKeys: 每页包含的最大数量,最大数量通常不超过1000。缺省值为1000

RETURNS:

  • *api.ListPrivateZoneResponse:
  • error: the return error if any occurs

type ListPrivateZoneResponseZones

type ListPrivateZoneResponseZones struct {
}

type ListRecordRequest added in v0.9.176

type ListRecordRequest struct {
	SourceType string
	Marker     string
	MaxKeys    int
}

type ListRecordResponse

type ListRecordResponse struct {
	Marker      string   `json:"marker"`
	IsTruncated bool     `json:"isTruncated"`
	NextMarker  string   `json:"nextMarker"`
	MaxKeys     int32    `json:"maxKeys"`
	Records     []Record `json:"records"`
}

func ListRecord

func ListRecord(cli bce.Client, zoneId string, marker string, maxKeys int,
	sourceType string) (*ListRecordResponse, error)

ListRecord -

PARAMS:

  • cli: the client agent which can perform sending request
  • zoneId: Zone的ID
  • marker: 批量获取列表的查询的起始位置,是一个由系统生成的字符串
  • maxKeys: 每页包含的最大数量,最大数量通常不超过1000。缺省值为1000
  • sourceType: 记录类型,可选值

RETURNS:

  • *api.ListRecordResponse:
  • error: the return error if any occurs

type ListRecordResponseRecords

type ListRecordResponseRecords struct {
}

type Record

type Record struct {
	RecordId    string `json:"recordId"`
	Rr          string `json:"rr"`
	Value       string `json:"value"`
	Status      string `json:"status"`
	Type        string `json:"type"`
	Ttl         int32  `json:"ttl"`
	Priority    int32  `json:"priority"`
	Description string `json:"description"`
}

type UnbindVpcRequest

type UnbindVpcRequest struct {
	ClientToken string   `json:"-"`
	Region      string   `json:"region"`
	VpcIds      []string `json:"vpcIds"`
}

type UnbindVpcRequestVpcIds

type UnbindVpcRequestVpcIds struct {
}

type UpdateRecordRequest

type UpdateRecordRequest struct {
	ClientToken string `json:"-"`
	Rr          string `json:"rr"`
	Value       string `json:"value"`
	Type        string `json:"type"`
	Ttl         int32  `json:"ttl,omitempty"`
	Priority    int32  `json:"priority,omitempty"`
	Description string `json:"description,omitempty"`
}

type Vpc

type Vpc struct {
	VpcId     string `json:"vpcId"`
	VpcName   string `json:"vpcName"`
	VpcRegion string `json:"vpcRegion"`
}

type Zone

type Zone struct {
	ZoneId      string `json:"zoneId"`
	ZoneName    string `json:"zoneName"`
	RecordCount int32  `json:"recordCount"`
	CreateTime  string `json:"createTime"`
	UpdateTime  string `json:"updateTime"`
}

Jump to

Keyboard shortcuts

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