AdminDescribeTaskQueuePartition displays task queue partition information
(c *cli.Context, clientFactory ClientFactory)
| 93 | |
| 94 | // AdminDescribeTaskQueuePartition displays task queue partition information |
| 95 | func 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 |
no test coverage detected