MCPcopy Create free account
hub / github.com/temporalio/temporal / AdminDescribeTaskQueuePartition

Function AdminDescribeTaskQueuePartition

tools/tdbg/task_queue_commands.go:95–183  ·  view source on GitHub ↗

AdminDescribeTaskQueuePartition displays task queue partition information

(c *cli.Context, clientFactory ClientFactory)

Source from the content-addressed store, hash-verified

93
94// AdminDescribeTaskQueuePartition displays task queue partition information
95func AdminDescribeTaskQueuePartition(c *cli.Context, clientFactory ClientFactory) error {
96 // extracting the namespace
97 namespace, err := getRequiredOption(c, FlagNamespace)
98 if err != nil {
99 return err
100 }
101
102 // extracting the task queue name
103 tqName, err := getRequiredOption(c, FlagTaskQueue)
104 if err != nil {
105 return err
106 }
107
108 // extracting the task queue type
109 tqTypeString, err := getRequiredOption(c, FlagTaskQueueType)
110 if err != nil {
111 return err
112 }
113
114 tlTypeInt, err := StringToEnum(tqTypeString, enumspb.TaskQueueType_value)
115 if err != nil {
116 return fmt.Errorf("invalid task queue type: %w", err)
117 }
118 tqType := enumspb.TaskQueueType(tlTypeInt)
119 if tqType == enumspb.TASK_QUEUE_TYPE_UNSPECIFIED {
120 return errors.New("invalid task queue type") // nolint
121 }
122
123 // extracting the task queue partition id
124 partitionID := 0
125 if c.IsSet(FlagPartitionID) {
126 partitionID = c.Int(FlagPartitionID)
127 }
128
129 // extracting the task queue partition sticky name
130 stickyName := ""
131 if c.IsSet(FlagStickyName) {
132 stickyName = c.String(FlagStickyName)
133 }
134
135 // extracting the task queue partition buildId's
136 buildIDs := make([]string, 0)
137 if c.IsSet(FlagBuildIDs) {
138 buildIDs = c.StringSlice(FlagBuildIDs)
139 }
140
141 // extracting the unversioned flag
142 unversioned := true
143 if c.IsSet(FlagUnversioned) {
144 unversioned = c.Bool(FlagUnversioned)
145 }
146
147 // extracting the allActive flag
148 allActive := true
149 if c.IsSet(FlagAllActive) {
150 allActive = c.Bool(FlagAllActive)
151 }
152

Callers 1

Calls 11

getRequiredOptionFunction · 0.85
StringToEnumFunction · 0.85
prettyPrintJSONObjectFunction · 0.85
IntMethod · 0.80
newContextFunction · 0.70
NewMethod · 0.65
StringMethod · 0.65
BoolMethod · 0.65
AdminClientMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected