@@ -19,8 +19,8 @@ var privateLinkCommands = &cli.Command{
1919 Name : "create" ,
2020 Usage : "Create a private link" ,
2121 Description : "Creates a private link to a customer endpoint.\n \n " +
22- "Currently expects an AWS VPC Endpoint Service Name for --endpoint.\n " +
23- "Example: com.amazonaws.vpce.us-east-1.vpce-svc-123123a1c43abc123 " ,
22+ "Supports Azure Private Link Service aliases for --endpoint.\n " +
23+ "Azure example: my-pls.12345678-abcd-1234-abcd-1234567890ab.eastus.azure.privatelinkservice " ,
2424 Before : createAgentClient ,
2525 Action : createPrivateLink ,
2626 Flags : []cli.Flag {
@@ -105,15 +105,19 @@ func buildPrivateLinkListRows(links []*lkproto.PrivateLink, healthByID map[strin
105105
106106 status := lkproto .PrivateLinkStatus_PRIVATE_LINK_STATUS_UNKNOWN .String ()
107107 updatedAt := "-"
108+ reason := "-"
108109
109110 if err , ok := healthErrByID [link .PrivateLinkId ]; ok && err != nil {
110111 status = "ERROR"
111- updatedAt = err .Error ()
112+ reason = err .Error ()
112113 } else if health , ok := healthByID [link .PrivateLinkId ]; ok && health != nil {
113114 status = health .Status .String ()
114115 if health .UpdatedAt != nil {
115116 updatedAt = health .UpdatedAt .AsTime ().UTC ().Format ("2006-01-02T15:04:05Z07:00" )
116117 }
118+ if health .Reason != "" {
119+ reason = health .Reason
120+ }
117121 }
118122 dns := link .Endpoint
119123 if dns == "" {
@@ -128,6 +132,7 @@ func buildPrivateLinkListRows(links []*lkproto.PrivateLink, healthByID map[strin
128132 dns ,
129133 status ,
130134 updatedAt ,
135+ reason ,
131136 })
132137 }
133138 return rows
@@ -218,7 +223,7 @@ func listPrivateLinks(ctx context.Context, cmd *cli.Command) error {
218223 }
219224
220225 rows := buildPrivateLinkListRows (resp .Items , healthByID , healthErrByID )
221- table := util .CreateTable ().Headers ("ID" , "Name" , "Region" , "Port" , "DNS" , "Health" , "Updated At" ).Rows (rows ... )
226+ table := util .CreateTable ().Headers ("ID" , "Name" , "Region" , "Port" , "DNS" , "Health" , "Updated At" , "Reason" ).Rows (rows ... )
222227 fmt .Println (table )
223228 return nil
224229}
@@ -259,9 +264,13 @@ func getPrivateLinkHealthStatus(ctx context.Context, cmd *cli.Command) error {
259264 if resp .Value .UpdatedAt != nil {
260265 updatedAt = resp .Value .UpdatedAt .AsTime ().UTC ().Format ("2006-01-02T15:04:05Z07:00" )
261266 }
267+ reason := "-"
268+ if resp .Value .Reason != "" {
269+ reason = resp .Value .Reason
270+ }
262271 table := util .CreateTable ().
263- Headers ("ID" , "Health" , "Updated At" ).
264- Row (privateLinkID , resp .Value .Status .String (), updatedAt )
272+ Headers ("ID" , "Health" , "Updated At" , "Reason" ).
273+ Row (privateLinkID , resp .Value .Status .String (), updatedAt , reason )
265274 fmt .Println (table )
266275 return nil
267276}
0 commit comments