MCPcopy Create free account
hub / github.com/clouditor/clouditor / getControls

Function getControls

cli/session.go:407–432  ·  view source on GitHub ↗
(catalogID string, categoryName string, _ string)

Source from the content-addressed store, hash-verified

405}
406
407func getControls(catalogID string, categoryName string, _ string) []string {
408 var (
409 err error
410 session *Session
411 client orchestrator.OrchestratorClient
412 res *orchestrator.Category
413 )
414
415 if session, err = ContinueSession(); err != nil {
416 fmt.Printf("Error while retrieving the session. Please re-authenticate.\n")
417 return nil
418 }
419
420 client = orchestrator.NewOrchestratorClient(session)
421
422 if res, err = client.GetCategory(context.Background(), &orchestrator.GetCategoryRequest{CatalogId: catalogID, CategoryName: categoryName}); err != nil {
423 return []string{}
424 }
425
426 var output []string
427 for _, v := range res.Controls {
428 output = append(output, fmt.Sprintf("%s\t%s: %s", v.Id, v.Name, v.Description))
429 }
430
431 return output
432}
433
434func getCertificationTargets(_ string) []string {
435 var (

Callers 1

ValidArgsGetControlsFunction · 0.85

Calls 3

NewOrchestratorClientFunction · 0.92
ContinueSessionFunction · 0.85
GetCategoryMethod · 0.65

Tested by

no test coverage detected