Version: v0.0.0-...-b79cc66 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2021 License: Apache-2.0 Imports: 1 Imported by: 0


View Browser App

This App runs a webserver and exposes two endpoints:



This is to demonstrate how to write an App for Cohesity's App Platform. It also servers as an example for consumption of Cohesity's App and Management Golang SDKs.


In order to successfully build and run Sample App, you are required to have the following setup in your system: Go (Visit for more details on how to install Go)

go get

This will also get all the dependencies including Cohesity App and Management Go SDKs.

Container Environment Parameters

The App Environment Container has the following parameters initialized by Cohesity App Server.

HOST_IP  # The Host IP on which the container is running.
APPS_API_ENDPOINT_IP # Cohesity App Server IP.
APPS_API_ENDPOINT_PORT # Cohesity App Server Port.
APP_AUTHENTICATION_TOKEN # Authetication Token to make Cohesity App API calls. 

We use the above variables in various use cases to initialize and make call to App server.

Using App & Management SDK

The Sample App uses Cohesity provides App and Management SDKs to make it easy to write Apps onto Cohesity Management Platform.

Importing the packages:

import (

Init the App Client:

apiEndpointIp = os.Getenv("APPS_API_ENDPOINT_IP")
apiEndpointPort = os.Getenv("APPS_API_ENDPOINT_PORT")
appAuthenticationToken = os.Getenv("APP_AUTHENTICATION_TOKEN")
appClient = CohesityAppSdk.NewAppSdkClient(appAuthenticationToken,

App Client in action:

appSettings, err := appClient.Settings().GetAppSettings()

Get ManagementAccessToken:

managementTokenResponse, err := appClient.TokenManagement().CreateManagementAccessToken() 
managementAccessToken = managementModels.AccessToken {
  AccessToken: managementTokenResponse.AccessToken,
  TokenType:   managementTokenResponse.TokenType,


managementClient = ManagementSdk.NewCohesityClientWithToken(apiEndpointIp, 

Using Management Client to Cohesity Views:

 viewsResult, err := managementClient.Views().GetViews(viewNames, viewBoxNames,
            matchPartialNames, maxCount, maxViewId, includeInactive, tenantIds,
            allUnderHierarchy, viewBoxIds, jobIds, sortByLogicalUsage, matchAliasNames)

Using Management Client to Mount View:

err := appClient.Mount().CreateMount(&mountOptions)


All the models for Management Structs & Variables are defined here

All the models for App Structs & Variables are defined here

Questions & Feedback

We would love to hear from you. Please send your questions and feedback to:


The Go Gopher

There is no documentation for this package.


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL