Documentation ¶
Index ¶
- Constants
- type AI
- type Config
- type Credentials
- type Endpoint
- type ExchangeableCredentials
- type IAMTokenCredentials
- type IoT
- type MDB
- type Marketplace
- type NoCredentials
- type NonExchangeableCredentials
- type Resolver
- type SDK
- func (sdk *SDK) AI() *AI
- func (sdk *SDK) ApiEndpoint() *apiendpoint.APIEndpoint
- func (sdk *SDK) Certificates() *certificatemanager.CertificateManager
- func (sdk *SDK) CertificatesData() *certificatemanagerdata.CertificateManagerData
- func (sdk *SDK) Compute() *compute.Compute
- func (sdk *SDK) ContainerRegistry() *containerregistry.ContainerRegistry
- func (sdk *SDK) CreateIAMToken(ctx context.Context) (*iampb.CreateIamTokenResponse, error)
- func (sdk *SDK) Dataproc() *dataproc.Dataproc
- func (sdk *SDK) Endpoint(endpointName Endpoint) (ep *endpoint.ApiEndpoint, exist bool)
- func (sdk *SDK) IAM() *iam.IAM
- func (sdk *SDK) InitErr() error
- func (sdk *SDK) InstanceGroup() *instancegroup.InstanceGroup
- func (sdk *SDK) IoT() *IoT
- func (sdk *SDK) KMS() *kms.KMS
- func (sdk *SDK) KMSCrypto() *kmscrypto.KMSCrypto
- func (sdk *SDK) KnownServices() []string
- func (sdk *SDK) Kubernetes() *k8s.Kubernetes
- func (sdk *SDK) LoadBalancer() *loadbalancer.LoadBalancer
- func (sdk *SDK) MDB() *MDB
- func (sdk *SDK) Marketplace() *Marketplace
- func (sdk *SDK) Operation() *gen_operation.OperationServiceClient
- func (sdk *SDK) Resolve(ctx context.Context, r ...Resolver) error
- func (sdk *SDK) ResourceManager() *resourcemanager.ResourceManager
- func (sdk *SDK) Serverless() *Serverless
- func (sdk *SDK) Shutdown(ctx context.Context) error
- func (sdk *SDK) VPC() *vpc.VPC
- func (sdk *SDK) WrapOperation(op *operation.Operation, err error) (*sdk_operation.Operation, error)
- type Serverless
Constants ¶
const ( CertificateManagerID = "certificate-manager" CertificateManagerDataID = "certificate-manager-data" )
const ( KMSServiceID = "kms" KMSCryptoServiceID = "kms-crypto" )
const ( DefaultPageSize int64 = 1000 ComputeServiceID Endpoint = "compute" IAMServiceID Endpoint = "iam" OperationServiceID Endpoint = "operation" ResourceManagementServiceID Endpoint = "resource-manager" StorageServiceID Endpoint = "storage" SerialSSHServiceID Endpoint = "serialssh" // revive:disable:var-naming ApiEndpointServiceID Endpoint = "endpoint" // revive:enable:var-naming VpcServiceID Endpoint = "vpc" KubernetesServiceID Endpoint = "managed-kubernetes" )
const DataProcServiceID = "dataproc"
const InstanceMetadataAddr = "169.254.169.254"
InstanceMetadata is address at the metadata server is accessible from inside the virtual machine. See doc for details: https://cloud.yandex.com/docs/compute/operations/vm-info/get-info#inside-instance
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Credentials are used to authenticate the client. See Credentials for more info. Credentials Credentials // DialContextTimeout specifies timeout of dial on API endpoint that // is used when building an SDK instance. DialContextTimeout time.Duration // TLSConfig is optional tls.Config that one can use in order to tune TLS options. TLSConfig *tls.Config // Endpoint is an API endpoint of Yandex.Cloud against which the SDK is used. // Most users won't need to explicitly set it. Endpoint string Plaintext bool }
Config is a config that is used to create SDK instance.
type Credentials ¶
type Credentials interface {
// YandexCloudAPICredentials is a marker method. All compatible Credentials implementations have it
YandexCloudAPICredentials()
}
Credentials is an abstraction of API authorization credentials. See https://cloud.yandex.ru/docs/iam/concepts/authorization/authorization for details. Note that functions that return Credentials may return different Credentials implementation in next SDK version, and this is not considered breaking change.
func OAuthToken ¶
func OAuthToken(token string) Credentials
OAuthToken returns API credentials for user Yandex Passport OAuth token, that can be received on page https://oauth.yandex.ru/authorize?response_type=token&client_id=1a6990aa636648e9b2ef855fa7bec2fb See https://cloud.yandex.ru/docs/iam/concepts/authorization/oauth-token for details.
func ServiceAccountKey ¶
func ServiceAccountKey(key *iamkey.Key) (Credentials, error)
ServiceAccountKey returns credentials for the given IAM Key. The key is used to sign JWT tokens. JWT tokens are exchanged for IAM Tokens used to authorize API calls. This authorization method is not supported for IAM Keys issued for User Accounts.
type Endpoint ¶
type Endpoint string
const (
ContainerRegistryServiceID Endpoint = "container-registry"
)
const InstancegroupServiceID Endpoint = "compute"
const (
IoTDevicesServiceID Endpoint = "iot-devices"
)
const (
LoadBalancerServiceID Endpoint = "load-balancer"
)
const (
MarketplaceMeteringServiceID Endpoint = "marketplace"
)
type ExchangeableCredentials ¶
type ExchangeableCredentials interface { Credentials // IAMTokenRequest returns request for fresh IAM token or error. IAMTokenRequest() (*iampb.CreateIamTokenRequest, error) }
ExchangeableCredentials can be exchanged for IAM Token in IAM Token Service, that can be used to authorize API calls. See https://cloud.yandex.ru/docs/iam/concepts/authorization/iam-token for details.
type IAMTokenCredentials ¶
type IAMTokenCredentials struct {
// contains filtered or unexported fields
}
IAMTokenCredentials implements Credentials with IAM token as-is
func (IAMTokenCredentials) IAMToken ¶
func (creds IAMTokenCredentials) IAMToken(ctx context.Context) (*iampb.CreateIamTokenResponse, error)
func (IAMTokenCredentials) YandexCloudAPICredentials ¶
func (creds IAMTokenCredentials) YandexCloudAPICredentials()
type MDB ¶
type MDB struct {
// contains filtered or unexported fields
}
func (*MDB) Clickhouse ¶
func (m *MDB) Clickhouse() *clickhouse.Clickhouse
func (*MDB) PostgreSQL ¶
func (m *MDB) PostgreSQL() *postgresql.PostgreSQL
type Marketplace ¶
type Marketplace struct {
// contains filtered or unexported fields
}
func (*Marketplace) Metering ¶
func (m *Marketplace) Metering() *metering.Metering
type NoCredentials ¶
type NoCredentials struct{}
NoCredentials implements Credentials, it allows to create unauthenticated connections
func (NoCredentials) IAMToken ¶
func (creds NoCredentials) IAMToken(ctx context.Context) (*iampb.CreateIamTokenResponse, error)
IAMToken always returns gRPC error with status UNAUTHENTICATED
func (NoCredentials) YandexCloudAPICredentials ¶
func (creds NoCredentials) YandexCloudAPICredentials()
type NonExchangeableCredentials ¶
type NonExchangeableCredentials interface { Credentials // IAMToken returns IAM Token. IAMToken(ctx context.Context) (*iampb.CreateIamTokenResponse, error) }
NonExchangeableCredentials allows to get IAM Token without calling IAM Token Service.
func InstanceServiceAccount ¶
func InstanceServiceAccount() NonExchangeableCredentials
InstanceServiceAccount returns credentials for Compute Instance Service Account. That is, for SDK build with InstanceServiceAccount credentials and used on Compute Instance created with yandex.cloud.compute.v1.CreateInstanceRequest.service_account_id, API calls will be authenticated with this ServiceAccount ID. TODO(skipor): doc link
func NewIAMTokenCredentials ¶
func NewIAMTokenCredentials(iamToken string) NonExchangeableCredentials
type SDK ¶
type SDK struct {
// contains filtered or unexported fields
}
SDK is a Yandex.Cloud SDK
func (*SDK) ApiEndpoint ¶
func (sdk *SDK) ApiEndpoint() *apiendpoint.APIEndpoint
ApiEndpoint gets ApiEndpointService client
func (*SDK) Certificates ¶
func (sdk *SDK) Certificates() *certificatemanager.CertificateManager
func (*SDK) CertificatesData ¶
func (sdk *SDK) CertificatesData() *certificatemanagerdata.CertificateManagerData
func (*SDK) Compute ¶
Compute returns Compute object that is used to operate on Yandex Compute Cloud
func (*SDK) ContainerRegistry ¶
func (sdk *SDK) ContainerRegistry() *containerregistry.ContainerRegistry
ContainerRegistry returns ContainerRegistry object that is used to operate on Yandex Container Registry
func (*SDK) CreateIAMToken ¶
func (*SDK) Endpoint ¶
func (sdk *SDK) Endpoint(endpointName Endpoint) (ep *endpoint.ApiEndpoint, exist bool)
func (*SDK) IAM ¶
IAM returns IAM object that is used to operate on Yandex Cloud Identity and Access Manager
func (*SDK) InstanceGroup ¶
func (sdk *SDK) InstanceGroup() *instancegroup.InstanceGroup
InstanceGroup returns InstanceGroup object that is used to operate on Yandex Compute InstanceGroup
func (*SDK) KnownServices ¶
func (*SDK) Kubernetes ¶
func (sdk *SDK) Kubernetes() *k8s.Kubernetes
Kubernetes returns Kubernetes object that is used to operate on Yandex Managed Kubernetes
func (*SDK) LoadBalancer ¶
func (sdk *SDK) LoadBalancer() *loadbalancer.LoadBalancer
LoadBalancer returns LoadBalancer object that is used to operate on load balancers
func (*SDK) Marketplace ¶
func (sdk *SDK) Marketplace() *Marketplace
func (*SDK) Operation ¶
func (sdk *SDK) Operation() *gen_operation.OperationServiceClient
Operation gets OperationService client
func (*SDK) ResourceManager ¶
func (sdk *SDK) ResourceManager() *resourcemanager.ResourceManager
ResourceManager returns ResourceManager object that is used to operate on Folders and Clouds
func (*SDK) Serverless ¶
func (sdk *SDK) Serverless() *Serverless
func (*SDK) WrapOperation ¶
WrapOperation wraps operation proto message to
type Serverless ¶
type Serverless struct {
// contains filtered or unexported fields
}
func (*Serverless) Functions ¶
func (s *Serverless) Functions() *functions.Function
func (*Serverless) Triggers ¶
func (s *Serverless) Triggers() *triggers.Trigger
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
gen
|
|
ai/stt
nolint
|
nolint |
ai/translate
nolint
|
nolint |
ai/vision
nolint
|
nolint |
apiendpoint
nolint
|
nolint |
certificatemanager
nolint
|
nolint |
certificatemanagerdata
nolint
|
nolint |
compute
nolint nolint nolint nolint nolint nolint nolint
|
nolint nolint nolint nolint nolint nolint nolint |
compute/instancegroup
nolint
|
nolint |
containerregistry
nolint nolint nolint nolint
|
nolint nolint nolint nolint |
dataproc
nolint nolint nolint nolint
|
nolint nolint nolint nolint |
functions
nolint
|
nolint |
iam
nolint nolint nolint nolint nolint nolint nolint
|
nolint nolint nolint nolint nolint nolint nolint |
iam/awscompatibility
nolint
|
nolint |
iot/devices
nolint nolint
|
nolint nolint |
kms
nolint
|
nolint |
kmscrypto
nolint
|
nolint |
kubernetes
nolint nolint nolint
|
nolint nolint nolint |
loadbalancer
nolint nolint
|
nolint nolint |
marketplace/metering
nolint
|
nolint |
mdb/clickhouse
nolint nolint nolint nolint nolint nolint nolint nolint
|
nolint nolint nolint nolint nolint nolint nolint nolint |
mdb/mongodb
nolint nolint nolint nolint nolint
|
nolint nolint nolint nolint nolint |
mdb/mysql
nolint nolint nolint nolint nolint
|
nolint nolint nolint nolint nolint |
mdb/postgresql
nolint nolint nolint nolint nolint
|
nolint nolint nolint nolint nolint |
mdb/redis
nolint nolint nolint
|
nolint nolint nolint |
operation
nolint
|
nolint |
resourcemanager
nolint nolint
|
nolint nolint |
triggers
nolint
|
nolint |
vpc
nolint nolint nolint nolint nolint
|
nolint nolint nolint nolint nolint |
pkg
|
|
singleflight
Package singleflight based on github.com/golang/groupcache/singleflight
|
Package singleflight based on github.com/golang/groupcache/singleflight |