Xiaomi Galaxy Talos Book

TalosAdmin API & Conf


TalosAdmin is mainly used to perform some Topic DDL-related operations: create/modify/delete/inquire/authority control, among others

TalosAdmin API

createTopic(CreateTopicRequest request)

Parameter: CreateTopicRequest, the user needs to construct a CreateTopicRequest. Generally speaking, the number of partitions of the Topic needs to be specified. For specific code examples, see examples of topic creation in Demo

Return value: CreateTopicResponse describes the created Topic information, including TopicInfo, through which you can obtain TopicTalosResourceName to do subsequent operations, including message reading and writing

Exception:

  • As for the TException and thrift exception, we look at the stack information, and almost all interfaces may throw this exception. It will not be repeated below;

  • As for GalaxyTalosException, the specific error type needs to be adjudged by ErrorCode: e.getErrorCode() == ErrorCode.TOPIC_EXIST. The probably cause is: TopicExistException,OperationFailedException,InvalidTopicNameException, among which one should pay attention to TopicName cannot have a symbol #, this is an occupant in Talos

describeTopic(DescribeTopicRequest request)

Parameter: DescribeTopicRequest is mainly for setting TopicName

Return value: Topic, including TopicInfo and TopicAttribute

Exception: GalaxyTalosException, specifically look at through ErrorCode, probable cause includes: TopicNotExistException,OperationFailedException

deleteTopic(DeleteTopicRequest request)

Parameter: DeleteTopicRequest is mainly for setting TopicTalosResourceName

Return value: void

Externality: GalaxyTalosException, specifically looked at through ErrorCode; probably cause includes: TopicNotExistException,OperationFailedException

changeTopicAttribute(ChangeTopicAttributeRequest request)

Parameter: ChangeTopicAttributeRequest needs to set TopicTalosResourceName, updated TopicAttribute

Return value: void

Exception: GalaxyTalosException, specifically look at through ErrorCode, probable cause includes: TopicNotExistException,OperationFailedException

setPermission(SetPermissionRequest request)

Parameter: SetPermissionRequest needs to set TopicTalosResourceName, identity to be authorized is Grantee, permission granted is Permission

Return value: void

Externality: GalaxyTalosException, specifically looked at through ErrorCode; probably cause includes: TopicNotExistException,OperationFailedException,PermissionDeniedException, among which the last Exception indicates that the login identity does not have permission to do setPermission operation;

Remark: When you do a Permission operation, be aware of the Grantee setting; explanation is visible in the Permission operation, and the default validity period of the Permission operation is 3 minutes;

revokePermission(RevokePermissionRequest request)

Parameter: SetPermissionRequest needs to set TopicTalosResourceName, identity to be unauthorized is Grantee;

Return value: void

Externality: GalaxyTalosException, specifically looked at through ErrorCode; probably cause includes: TopicNotExistException,OperationFailedException,PermissionDeniedException

queryPermission(GetPermissionRequest request)

Parameter: GetPermissionRequest needs to set TopicTalosResourceName, identity to be unauthorized is Grantee;

Return value: int

Externality: GalaxyTalosException, specifically looked at through ErrorCode; probably cause includes: TopicNotExistException,OperationFailedException,PermissionDeniedException

getDeveloperId()

Parameter: No parameter required, but the Credential that needs to invoke the interface corresponds to the identity of the Developer

Return value: string

Externality: GalaxyTalosException, specifically looked at through ErrorCode; probably cause includes: OperationFailedException, PermissionDeniedException

addSubResourceName(AddSubResourceNameRequest request)

Parameter: AddSubResourceNameRequest needs to set TopicTalosResourceName, target to migrate to is Orgld, Admin privilege TeamId must be granted

Return value: void

Externality: GalaxyTalosException, specifically looked at through ErrorCode; probably cause includes: PermissionDeniedException,InvalidTopicParamsException,OperationFailedException

Note: This interface is for users to smoothly migrate "Topic created using developer account" to the converged cloud authentication system, so that the user can directly manage the old Topic using the converged cloud UI; therefore, the program that invokes this interface must use the developer account to build Credential; in addition, invoking this interface has a default validity period of 3 minutes;

TalosAdmin Configs

Talosadmin configuration requires only and must be configured with the following parameters

Name Description Default
galaxy.talos.service.endpoint Specifies the URI of Talos Server, can be configured with http and https, for the corresponding URI of the related cluster, see Cluster information --