Documentation ¶
Index ¶
- type CloudMap
- func (sd *CloudMap) Connect(parentSegment ...*xray.XRayParentSegment) (err error)
- func (sd *CloudMap) CreateHttpNamespace(name string, creatorRequestId string, description string, ...) (operationId string, err error)
- func (sd *CloudMap) CreatePrivateDnsNamespace(name string, creatorRequestId string, vpc string, description string, ...) (operationId string, err error)
- func (sd *CloudMap) CreatePublicDnsNamespace(name string, creatorRequestId string, description string, ...) (operationId string, err error)
- func (sd *CloudMap) CreateService(name string, creatorRequestId string, namespaceId string, dnsConf *DnsConf, ...) (service *servicediscovery.Service, err error)
- func (sd *CloudMap) DeleteNamespace(namespaceId string, timeOutDuration ...time.Duration) (operationId string, err error)
- func (sd *CloudMap) DeleteService(serviceId string, timeOutDuration ...time.Duration) (err error)
- func (sd *CloudMap) DeregisterInstance(instanceId string, serviceId string, timeOutDuration ...time.Duration) (operationId string, err error)
- func (sd *CloudMap) Disconnect()
- func (sd *CloudMap) DiscoverInstances(namespaceName string, serviceName string, isHealthy bool, ...) (instances []*servicediscovery.HttpInstanceSummary, err error)
- func (sd *CloudMap) GetInstance(instanceId string, serviceId string, timeOutDuration ...time.Duration) (instance *servicediscovery.Instance, err error)
- func (sd *CloudMap) GetInstancesHealthStatus(serviceId string, instanceIds []string, maxResults *int64, nextToken *string, ...) (status map[string]string, moreNextToken string, err error)
- func (sd *CloudMap) GetInstancesHealthStatusPages(serviceId string, instanceIds []string, maxResults *int64, nextToken *string, ...) (status map[string]string, moreNextToken string, err error)
- func (sd *CloudMap) GetNamespace(namespaceId string, timeOutDuration ...time.Duration) (namespace *servicediscovery.Namespace, err error)
- func (sd *CloudMap) GetOperation(operationId string, timeOutDuration ...time.Duration) (operation *servicediscovery.Operation, err error)
- func (sd *CloudMap) GetService(serviceId string, timeOutDuration ...time.Duration) (service *servicediscovery.Service, err error)
- func (sd *CloudMap) ListInstances(serviceId string, maxResults *int64, nextToken *string, ...) (instances []*servicediscovery.InstanceSummary, moreNextToken string, err error)
- func (sd *CloudMap) ListInstancesPages(serviceId string, maxResults *int64, nextToken *string, ...) (instances []*servicediscovery.InstanceSummary, moreNextToken string, err error)
- func (sd *CloudMap) ListNamespaces(filter *sdnamespacefilter.SdNamespaceFilter, maxResults *int64, ...) (namespaces []*servicediscovery.NamespaceSummary, moreNextToken string, ...)
- func (sd *CloudMap) ListNamespacesPages(filter *sdnamespacefilter.SdNamespaceFilter, maxResults *int64, ...) (namespaces []*servicediscovery.NamespaceSummary, moreNextToken string, ...)
- func (sd *CloudMap) ListOperations(filter map[sdoperationfilter.SdOperationFilter][]string, maxResults *int64, ...) (operations []*servicediscovery.OperationSummary, moreNextToken string, ...)
- func (sd *CloudMap) ListOperationsPages(filter map[sdoperationfilter.SdOperationFilter][]string, maxResults *int64, ...) (operations []*servicediscovery.OperationSummary, moreNextToken string, ...)
- func (sd *CloudMap) ListServices(filter []string, maxResults *int64, nextToken *string, ...) (services []*servicediscovery.ServiceSummary, moreNextToken string, err error)
- func (sd *CloudMap) ListServicesPages(filter []string, maxResults *int64, nextToken *string, ...) (services []*servicediscovery.ServiceSummary, moreNextToken string, err error)
- func (sd *CloudMap) RegisterInstance(serviceId string, instanceId string, creatorRequestId string, ...) (operationId string, err error)
- func (sd *CloudMap) UpdateInstanceCustomHealthStatus(instanceId string, serviceId string, isHealthy bool, ...) (err error)
- func (sd *CloudMap) UpdateParentSegment(parentSegment *xray.XRayParentSegment)
- func (sd *CloudMap) UpdateService(serviceId string, dnsConfUpdate *DnsConf, ...) (operationId string, err error)
- type DnsConf
- type HealthCheckConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudMap ¶
type CloudMap struct { // define the AWS region that KMS is located at AwsRegion awsregion.AWSRegion // custom http2 client options HttpOptions *awshttp2.HttpClientSettings // contains filtered or unexported fields }
CloudMap struct encapsulates the AWS CloudMap access functionality
func (*CloudMap) Connect ¶
func (sd *CloudMap) Connect(parentSegment ...*xray.XRayParentSegment) (err error)
Connect will establish a connection to the CloudMap service
func (*CloudMap) CreateHttpNamespace ¶
func (sd *CloudMap) CreateHttpNamespace(name string, creatorRequestId string, description string, tags map[string]string, timeOutDuration ...time.Duration) (operationId string, err error)
CreateHttpNamespace creates an http namespace for AWS cloud map
Service instances registered to http namespace can be discovered using DiscoverInstances(),
however, service instances cannot be discovered via dns
Parameters:
- name = (required) name of the http namespace to create
- creatorRequestId = (required) random and unique string to identify this create namespace action (such as uuid)
- description = (optional) http namespace description
- tags = (optional) one or more key value pairs to store as namespace tags
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- operationId = string representing the identifier to be used to check on operation status at a later time
- err = contains error info if error was encountered
func (*CloudMap) CreatePrivateDnsNamespace ¶
func (sd *CloudMap) CreatePrivateDnsNamespace(name string, creatorRequestId string, vpc string, description string, tags map[string]string, timeOutDuration ...time.Duration) (operationId string, err error)
CreatePrivateDnsNamespace creates a private dns based namespace, visible only inside a specified aws vpc,
this namespace defines service naming scheme, for example: if namespace is named as 'example.com', and service is named as 'xyz-service', the resulting dns name for the service will be 'xyz-service.example.com'
Parameters:
- name = (required) name of the private dns namespace to create
- creatorRequestId = (required) random and unique string to identify this create namespace action (such as uuid)
- vpc = (required) aws vpc id that this private dns associated with
- description = (optional) private dns namespace description
- tags = (optional) one or more key value pairs to store as namespace tags
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- operationId = string representing the identifier to be used to check on operation status at a later time
- err = contains error info if error was encountered
func (*CloudMap) CreatePublicDnsNamespace ¶
func (sd *CloudMap) CreatePublicDnsNamespace(name string, creatorRequestId string, description string, tags map[string]string, timeOutDuration ...time.Duration) (operationId string, err error)
CreatePublicDnsNamespace creates a public dns based namespace, accessible via the public internet,
this namespace defines service naming scheme, for example: if namespace is named as 'example.com', and service is named as 'xyz-service', the resulting dns name for the service will be 'xyz-service.example.com'
Parameters:
- name = (required) name of the public dns namespace to create
- creatorRequestId = (required) random and unique string to identify this create namespace action (such as uuid)
- description = (optional) public dns namespace description
- tags = (optional) one or more key value pairs to store as namespace tags
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- operationId = string representing the identifier to be used to check on operation status at a later time
- err = contains error info if error was encountered
func (*CloudMap) CreateService ¶
func (sd *CloudMap) CreateService(name string, creatorRequestId string, namespaceId string, dnsConf *DnsConf, healthCheckConf *HealthCheckConf, description string, tags map[string]string, timeOutDuration ...time.Duration) (service *servicediscovery.Service, err error)
CreateService creates a service under a specific namespace
After service is created, use RegisterInstance() to register an instance for the given service ¶
Parameters:
- name = (required) name of the service to create, under the given namespaceId
- creatorRequestId = (required) random and unique string to identify this create service action (such as uuid)
- namespaceId = (required) namespace that this service be created under
- dnsConf = (conditional) required for public and private dns namespaces, configures the dns parameters for this service
- healthCheckConf = (optional) nil will not set health check, otherwise sets a health check condition for this services' instances
- description = (optional) public dns namespace description
- tags = (optional) one or more key value pairs to store as namespace tags
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- service = service object that was created
- err = contains error info if error was encountered
func (*CloudMap) DeleteNamespace ¶
func (sd *CloudMap) DeleteNamespace(namespaceId string, timeOutDuration ...time.Duration) (operationId string, err error)
DeleteNamespace deletes an existing namespace, however if namespace still has attached services, then action will fail
Parameters:
- namespaceId = (required) namespace id to delete
Return Values:
- operationId = represents the operation to be used for status check on this action via GetOperation()
- err = error info if any
func (*CloudMap) DeleteService ¶
DeleteService deletes the specified service,
if the service still contains one or more registered instances, the delete action will fail
Parameters:
- serviceId = (required) service to be deleted via the specified service id
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- err = nil indicates success; contains error info if error was encountered
func (*CloudMap) DeregisterInstance ¶
func (sd *CloudMap) DeregisterInstance(instanceId string, serviceId string, timeOutDuration ...time.Duration) (operationId string, err error)
DeregisterInstance deletes the route 53 dns record and health check (if any),
that was created by cloud map for the specified instance
Parameters:
- instanceId = (required) instance to deregister
- serviceId = (required) the associated service
Return Values:
- operationId = operation identifier to be used with GetOperation for action completion status check
- err = error info if any
func (*CloudMap) DiscoverInstances ¶
func (sd *CloudMap) DiscoverInstances(namespaceName string, serviceName string, isHealthy bool, queryParameters map[string]string, maxResults *int64, timeOutDuration ...time.Duration) (instances []*servicediscovery.HttpInstanceSummary, err error)
DiscoverInstances discovers registered instances for a specified namespace and service
Notes:
- Used to discover instances for any type of namespace (http, private dns, public dns)
- For public and private dns namespaces, may also use dns queries to discover distances instead
Parameters:
- namespaceName = (required) name of the namespace to be discovered
- serviceName = (required) name of the service to be discovered
- isHealthy = (required) discover healthy or unhealthy instances
- queryParameters = (optional) map of key value pairs, containing custom attributes registered during RegisterInstance, if custom attributes is specified, all attributes in the queryParameters must match for the instance to discover
- maxResults = (optional) max count of discovered instances to return, if not specified, up to 100 is returned
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- instances = slice of discovered instance objects
- err = error info if any
func (*CloudMap) GetInstance ¶
func (sd *CloudMap) GetInstance(instanceId string, serviceId string, timeOutDuration ...time.Duration) (instance *servicediscovery.Instance, err error)
GetInstance gets information about a specified instance
Parameters:
- instanceId = (required) instance to get
- serviceId = (required) the associated service
Return Values:
- instance = instance object retrieved
- err = error info if any
func (*CloudMap) GetInstancesHealthStatus ¶
func (sd *CloudMap) GetInstancesHealthStatus(serviceId string, instanceIds []string, maxResults *int64, nextToken *string, timeOutDuration ...time.Duration) (status map[string]string, moreNextToken string, err error)
GetInstancesHealthStatus gets the current health status (healthy, unhealthy, unknown) of one or more instances,
that are associated with a specified service
There is a brief delay between register an instance and when the health status for the instance is available ¶
Parameters:
- serviceId = (required) service id assciated with the instances being checked
- instanceIds = (optional) list of instance ids to check health status on, if omitted, then all instances of given service is checked
- maxResults = (optional) specifies maximum count to return
- nextToken = (optional) if initial action, leave blank; if this is a subsequent action to get more, input the moreNextToken returned from a prior action
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- status = map of instance status (key = instance id, value = health status 'healthy', 'unhealthy', 'unknown')
- moreNextToken = if more data exists, this token can be used in a subsequent action via nextToken parameter
- err = error info if any
func (*CloudMap) GetInstancesHealthStatusPages ¶
func (sd *CloudMap) GetInstancesHealthStatusPages(serviceId string, instanceIds []string, maxResults *int64, nextToken *string, timeOutDuration ...time.Duration) (status map[string]string, moreNextToken string, err error)
GetInstancesHealthStatusPages gets the current health status (healthy, unhealthy, unknown) of one or more instances,
that are associated with a specified service (issues multiple page requests until max results is met or all data is retrieved)
There is a brief delay between register an instance and when the health status for the instance is available ¶
Parameters:
- serviceId = (required) service id assciated with the instances being checked
- instanceIds = (optional) list of instance ids to check health status on, if omitted, then all instances of given service is checked
- maxResults = (optional) specifies maximum count to return
- nextToken = (optional) if initial action, leave blank; if this is a subsequent action to get more, input the moreNextToken returned from a prior action
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- status = map of instance status (key = instance id, value = health status 'healthy', 'unhealthy', 'unknown')
- moreNextToken = if more data exists, this token can be used in a subsequent action via nextToken parameter
- err = error info if any
func (*CloudMap) GetNamespace ¶
func (sd *CloudMap) GetNamespace(namespaceId string, timeOutDuration ...time.Duration) (namespace *servicediscovery.Namespace, err error)
GetNamespace gets the information about a specific namespace
Parameters:
- namespaceId = (required) namespace id used for search
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- namespace = sd namespace object found
- err = error info if any
func (*CloudMap) GetOperation ¶
func (sd *CloudMap) GetOperation(operationId string, timeOutDuration ...time.Duration) (operation *servicediscovery.Operation, err error)
GetOperation gets information about any operation that returned an operationId in the response,
such as CreateHttpNamespace(), CreateService(), etc
Parameters:
- operationId = (required) the operation to retrieve, operationId is obtained during Create, and other related actions
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- operation = operation object retrieved a) Targets = evaluate Targets to retrieve namespaceId, serviceId, InstanceId etc, using NAMESPACE, SERVICE, INSTANCE key names
- err = error info any
func (*CloudMap) GetService ¶
func (sd *CloudMap) GetService(serviceId string, timeOutDuration ...time.Duration) (service *servicediscovery.Service, err error)
GetService gets a specified service's settings
Parameters:
- serviceId = (required) get service based on this service id
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- service = service object found based on the provided serviceId
- err = contains error info if error was encountered
func (*CloudMap) ListInstances ¶
func (sd *CloudMap) ListInstances(serviceId string, maxResults *int64, nextToken *string, timeOutDuration ...time.Duration) (instances []*servicediscovery.InstanceSummary, moreNextToken string, err error)
ListInstances lists summary information about the instances registered using a specified service
Parameters:
- serviceId = (required) service id assciated with the instances being checked
- maxResults = (optional) specifies maximum count to return
- nextToken = (optional) if initial action, leave blank; if this is a subsequent action to get more, input the moreNextToken returned from a prior action
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- instances = slice of sd instance summary objects
- moreNextToken = if more data exists, this token can be used in a subsequent action via nextToken parameter
- err = error info if any
func (*CloudMap) ListInstancesPages ¶
func (sd *CloudMap) ListInstancesPages(serviceId string, maxResults *int64, nextToken *string, timeOutDuration ...time.Duration) (instances []*servicediscovery.InstanceSummary, moreNextToken string, err error)
ListInstancesPages lists summary information about the instances registered using a specified service (issues multiple page requests until max results is met or all data is retrieved)
Parameters:
- serviceId = (required) service id assciated with the instances being checked
- maxResults = (optional) specifies maximum count to return
- nextToken = (optional) if initial action, leave blank; if this is a subsequent action to get more, input the moreNextToken returned from a prior action
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- instances = slice of sd instance summary objects
- moreNextToken = if more data exists, this token can be used in a subsequent action via nextToken parameter
- err = error info if any
func (*CloudMap) ListNamespaces ¶
func (sd *CloudMap) ListNamespaces(filter *sdnamespacefilter.SdNamespaceFilter, maxResults *int64, nextToken *string, timeOutDuration ...time.Duration) (namespaces []*servicediscovery.NamespaceSummary, moreNextToken string, err error)
ListNamespaces gets summary information about namespaces created already
Parameters:
- filter = (optional) specifies namespace filter options
- maxResults = (optional) specifies maximum count to return
- nextToken = (optional) if initial action, leave blank; if this is a subsequent action to get more, input the moreNextToken returned from a prior action
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- namespaces = slice of sd namespace summary objects
- moreNextToken = if more data exists, this token can be used in a subsequent action via nextToken parameter
- err = error info if any
func (*CloudMap) ListNamespacesPages ¶
func (sd *CloudMap) ListNamespacesPages(filter *sdnamespacefilter.SdNamespaceFilter, maxResults *int64, nextToken *string, timeOutDuration ...time.Duration) (namespaces []*servicediscovery.NamespaceSummary, moreNextToken string, err error)
ListNamespacesPages gets summary information about namespaces created already (issues multiple page requests until max results is met or all data is retrieved)
Parameters:
- filter = (optional) specifies namespace filter options
- maxResults = (optional) specifies maximum count to return
- nextToken = (optional) if initial action, leave blank; if this is a subsequent action to get more, input the moreNextToken returned from a prior action
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- namespaces = slice of sd namespace summary objects
- moreNextToken = if more data exists, this token can be used in a subsequent action via nextToken parameter
- err = error info if any
func (*CloudMap) ListOperations ¶
func (sd *CloudMap) ListOperations(filter map[sdoperationfilter.SdOperationFilter][]string, maxResults *int64, nextToken *string, timeOutDuration ...time.Duration) (operations []*servicediscovery.OperationSummary, moreNextToken string, err error)
ListOperations lists operations that match the criteria specified in parameters
Parameters:
- filter = (optional) map of filter operations (EQ_ filters allow single value per key) a) EQ_Status / IN_Status = Valid Values: SUBMITTED, PENDING, SUCCEED, FAIL b) EQ_Type / IN_Type = Valid Values: CREATE_NAMESPACE, DELETE_NAMESPACE, UPDATE_SERVICE, REGISTER_INSTANCE, DEREGISTER_INSTANCE c) BETWEEN_UpdateDate = begin and end in Unix DateTime in UTC
- maxResults = (optional) specifies maximum count to return
- nextToken = (optional) if initial action, leave blank; if this is a subsequent action to get more, input the moreNextToken returned from a prior action
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- operations = slice of sd operation summary objects a) Targets = evaluate Targets to retrieve namespaceId, serviceId, InstanceId etc, using NAMESPACE, SERVICE, INSTANCE key names
- moreNextToken = if more data exists, this token can be used in a subsequent action via nextToken parameter
- err = error info if any
func (*CloudMap) ListOperationsPages ¶
func (sd *CloudMap) ListOperationsPages(filter map[sdoperationfilter.SdOperationFilter][]string, maxResults *int64, nextToken *string, timeOutDuration ...time.Duration) (operations []*servicediscovery.OperationSummary, moreNextToken string, err error)
ListOperationsPages lists operations that match the criteria specified in parameters (issues multiple page requests until max results is met or all data is retrieved)
Parameters:
- filter = (optional) map of filter operations (EQ_ filters allow single value per key) a) EQ_Status / IN_Status = Valid Values: SUBMITTED, PENDING, SUCCEED, FAIL b) EQ_Type / IN_Type = Valid Values: CREATE_NAMESPACE, DELETE_NAMESPACE, UPDATE_SERVICE, REGISTER_INSTANCE, DEREGISTER_INSTANCE c) BETWEEN_UpdateDate = begin and end in Unix DateTime in UTC
- maxResults = (optional) specifies maximum count to return
- nextToken = (optional) if initial action, leave blank; if this is a subsequent action to get more, input the moreNextToken returned from a prior action
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- operations = slice of sd operation summary objects a) Targets = evaluate Targets to retrieve namespaceId, serviceId, InstanceId etc, using NAMESPACE, SERVICE, INSTANCE key names
- moreNextToken = if more data exists, this token can be used in a subsequent action via nextToken parameter
- err = error info if any
func (*CloudMap) ListServices ¶
func (sd *CloudMap) ListServices(filter []string, maxResults *int64, nextToken *string, timeOutDuration ...time.Duration) (services []*servicediscovery.ServiceSummary, moreNextToken string, err error)
ListServices lists summary information about all the services associated with one or more namespaces
Parameters:
- filter = (optional) filter by namespace(s) as specified, slice of namespaceId to filter
- maxResults = (optional) specifies maximum count to return
- nextToken = (optional) if initial action, leave blank; if this is a subsequent action to get more, input the moreNextToken returned from a prior action
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- services = slice of sd service summary objects
- moreNextToken = if more data exists, this token can be used in a subsequent action via nextToken parameter
- err = error info if any
func (*CloudMap) ListServicesPages ¶
func (sd *CloudMap) ListServicesPages(filter []string, maxResults *int64, nextToken *string, timeOutDuration ...time.Duration) (services []*servicediscovery.ServiceSummary, moreNextToken string, err error)
ListServicesPages lists summary information about all the services associated with one or more namespaces (issues multiple page requests until max results is met or all data is retrieved)
Parameters:
- filter = (optional) filter by namespace(s) as specified, slice of namespaceId to filter
- maxResults = (optional) specifies maximum count to return
- nextToken = (optional) if initial action, leave blank; if this is a subsequent action to get more, input the moreNextToken returned from a prior action
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- namespaces = slice of sd service summary objects
- moreNextToken = if more data exists, this token can be used in a subsequent action via nextToken parameter
- err = error info if any
func (*CloudMap) RegisterInstance ¶
func (sd *CloudMap) RegisterInstance(serviceId string, instanceId string, creatorRequestId string, attributes map[string]string, timeOutDuration ...time.Duration) (operationId string, err error)
RegisterInstance creates or updates one or more records,
and optionally creates a health check based on settings from the specified service
When RegisterInstance() request is submitted:
- for each dns record defined in the service as specified by ServiceId, a record is created or updated in the hosted zone that is associated with the corresponding namespace
- if the service includes HealthCheckConfig, a health check is created based on the settings in the health check configuration
- the health check is associated with each of the new or updated records (if applicable)
One RegisterInstance() request must complete before another is submitted ¶
When AWS cloud map receives a dns query for the specified dns name,
- if the health check is healthy, all records returned
- if the health check is unhealthy, applicable value for the last healthy instance is returned
- if health check configuration wasn't specified, then all records are returned regardless healthy or otherwise
Parameters:
- serviceId = (required) register instance to this serviceId
- instanceId = (required) unique value for this instance, if instanceId already exists, this action will update instead of new
- creatorRequestId = (required) unique request id to use in case of a failure (during fail-retry, use the same creatorRequestId
- attributes = (required) map of attributes to register for this instance with the given serviceId, keys are as follows: a) AWS_ALIAS_DNS_NAME = instruct cloud map to create route 53 alias record to route traffic to an ELB, set the dns name associated with the load balancer to this key, the associated service RoutingPolicy must be WEIGHTED, when this key is set, DO NOT set values to any other AWS_INSTANCE attributes b) AWS_EC2_INSTANCE_ID = for http namespace only, sets this instance's EC2 instance ID, when this key is set, ONLY OTHER key allowed is AWS_INIT_HEALTH_STATUS, when this key is set, the AWS_INSTANCE_IPV4 attribute will be filled with the primary private IPv4 address c) AWS_INIT_HEALTH_STATUS = if associated service includes HealthCheckCustomConfig, then this key may be optionally set to specify the initial status of custom health check: HEALTHY or UNHEALTHY, if this key is not set, then initial status is HEALTHY d) AWS_INSTANCE_IPV4 = if associated service dns record type is A, then set the IPv4 address to this key, this key is required for service dns record type A e) AWS_INSTANCE_PORT = if associated service includes HealthCheckConfig, set the port for this endpoint that route 53 will send health check request to, this key is required for service having HealthCheckConfig set f) Custom Attributes = up to 30 custom attribute key value pairs, key must not exceed 255 chars, value must not exceed 1024 chars, total of all custom attribute key value pairs combined cannot exceed 5000 chars
Return Values:
- operationId = identifier to be used with GetOperation for status check (to verify completion of action)
- err = contains error info if any
func (*CloudMap) UpdateInstanceCustomHealthStatus ¶
func (sd *CloudMap) UpdateInstanceCustomHealthStatus(instanceId string, serviceId string, isHealthy bool, timeOutDuration ...time.Duration) (err error)
UpdateInstanceCustomHealthStatus submits a request to change the health status of a custom health check,
to healthy or unhealthy
This action works only with configuration of Custom Health Checks,
which was defined using HealthCheckCustomConfig when creating a service
This action cannot be used to change the status of a route 53 health check,
which was defined using HealthCheckConfig when creating a service
Parameters:
- instanceId = (required) update healthy status to this instanceId
- serviceId = (required) the associated service
- isHealthy = specify the health status during this update action
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- err = nil indicates success; otherwise error info is included
func (*CloudMap) UpdateParentSegment ¶ added in v1.1.4
func (sd *CloudMap) UpdateParentSegment(parentSegment *xray.XRayParentSegment)
UpdateParentSegment updates this struct's xray parent segment, if no parent segment, set nil
func (*CloudMap) UpdateService ¶
func (sd *CloudMap) UpdateService(serviceId string, dnsConfUpdate *DnsConf, healthCheckConfUpdate *HealthCheckConf, descriptionUpdate *string, timeOutDuration ...time.Duration) (operationId string, err error)
UpdateService submits request for the following operations:
- update the TTL for existing dnsRecords configurations
- add, update, or delete HealthCheckConfig for a specified service, HealthCheckCustomConfig cannot be added, updated or deleted via UpdateService action
Notes:
- public and private dns namespaces, a) if any existing dnsRecords or healthCheckConfig configurations are omitted from the UpdateService request, those omitted configurations ARE deleted from the service b) if any existing HealthCheckCustomConfig configurations are omitted from the UpdateService request, the omitted configurations ARE NOT deleted from the service
- when settings are updated for a service, aws cloud map also updates the corresponding settings in all the records and health checks, that were created by the given service
Parameters:
- serviceId = (required) service to update
- dnsConfUpdate = (required) update dns config to this value, if nil, existing dns configuration will be removed from service
- healthCheckConf = (optional) update health check config to this value, if nil, existing health check config will be removed from service
- descriptionUpdate = (optional) service description to update, if nil, existing description will be removed from service
- timeOutDuration = (optional) maximum time before timeout via context
Return Values:
- operationId = this action's operation id to be used in GetOperation for status check
- err = contains error info if error was encountered
type DnsConf ¶
DnsConf represents a dns config option to be used by CreateService for this project we will only use:
- ipv4 - dns record type A
- srv
TTL = dns record time to live in seconds MultiValue = true: route 53 returns up to 8 healthy targets if health check is enabled (otherwise, all targets assumed healthy)
false: route 53 uses WEIGHTED to return a random healthy target if health check is enabled (if no healthy target found, then any random target is used)
SRV = true: dns use SRV; false: dns use A
type HealthCheckConf ¶
type HealthCheckConf struct { Custom bool FailureThreshold int64 PubDns_HealthCheck_Type sdhealthchecktype.SdHealthCheckType PubDns_HealthCheck_Path string }
HealthCheckConf represents target health check configuration
Custom = true: use HealthCheckCustomConfig (for Http, Public Dns, Private Dns namespaces)
false: use HealthCheckConfig (for Public Dns namespace only)
FailureThreshold = if Custom is true:
*) number of 30-second intervals that cloud map waits after UpdateInstanceCustomHealthStatus is executed, before changing the target health status if Custom is false: *) number of consecutive times health checks of target must pass or fail for route 53 to consider healthy or unhealthy
PubDns_HealthCheck_Type = for public dns namespace only: the endpoint protocol type used for health check PubDns_HealthCheck_Path = for public dns namespace only: (Http and Https type ONLY),
path to service that responds to health check, that returns http status 2xx or 3xx as healthy