Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AttributesCmd = &cobra.Command{ Use: "attributes", Aliases: []string{"attrs"}, Short: "Manage API Product Attributes", Long: "Manage API Product Attributes", }
AttributesCmd to manage tracing of apis
View Source
var Cmd = &cobra.Command{ Use: "products", Aliases: []string{"prods"}, Short: "Manage Apigee API products", Long: "Manage Apigee API products and Rate Plans for Monetization", }
Cmd to manage products
View Source
var CreateCmd = &cobra.Command{ Use: "create", Short: "Create an API product", Long: "Create an API product", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) (err error) { p := products.Product{} p.Name = name p.DisplayName = displayName p.ApprovalType = approval p.Description = description p.Quota = quota p.QuotaInterval = quotaInterval p.QuotaTimeUnit = quotaUnit p.Environments = environments p.Proxies = proxies p.Scopes = scopes p.OperationGroup, err = getOperationGroup(operationGroupFile) if err != nil { return err } p.GraphQLOperationGroup, err = getGqlOperationGroup(gqlOperationGroupFile) if err != nil { return nil } p.Attributes = getAttributes(attrs) _, err = products.Create(p) return }, }
Cmd to create a new product
View Source
var CreateRateplanCmd = &cobra.Command{ Use: "create", Short: "Create a rate plan for an API product", Long: "Create a rate plan for an API product", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) (err error) { if rateplanData, err = ioutil.ReadFile(rateplanFile); err != nil { clilog.Info.Println(err) return } _, err = products.CreateRatePlan(apiproduct, rateplanData) return }, }
Cmd to create a rate plane for an api product
View Source
var DelAttrCmd = &cobra.Command{ Use: "delete", Short: "Deletes an attribute from an API product", Long: "Deletes an attribute from an API product", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) (err error) { _, err = products.DeleteAttribute(name, attrName) return }, }
DelAttrCmd to delete product attribute
View Source
var DelCmd = &cobra.Command{ Use: "delete", Short: "Deletes an API product from an organization", Long: "Deletes an API product from an organization", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) (err error) { _, err = products.Delete(name) return }, }
Cmd to delete products
View Source
var DelRatePlanCmd = &cobra.Command{ Use: "delete", Short: "Delete rate plan associated with the API Product", Long: "Delete rate plan associated with the API Product", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) (err error) { _, err = products.DeleteRatePlan(name, rateplan) return }, }
DelRatePlanCmd to list envs
View Source
var ExpCmd = &cobra.Command{ Use: "export", Short: "Export API products to a file", Long: "Export API products to a file", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) (err error) { const exportFileName = "products.json" payload, err := products.Export(conn) if err != nil { return } return apiclient.WriteArrayByteArrayToFile(exportFileName, false, payload) }, }
ExpCmd to export products
View Source
var ExpRateplanCmd = &cobra.Command{ Use: "export", Short: "Export the rate plans of an API product to a file", Long: "Export the rate plans of an API product to a file", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) (err error) { var exportFileName = "rateplan_" + name + ".json" respBody, err := products.ExportRateplan(name) if err != nil { return } return apiclient.WriteByteArrayToFile(exportFileName, false, respBody) }, }
ExpRateplanCmd to export products
View Source
var GetAttrCmd = &cobra.Command{ Use: "get", Short: "Get an attribute of an API product", Long: "Get an attribute of an API product", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) (err error) { _, err = products.GetAttribute(name, attrName) return }, }
GetAttrCmd to delete product attribute
View Source
var GetCmd = &cobra.Command{ Use: "get", Short: "Gets an API product from an organization", Long: "Gets an API product from an organization", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) (err error) { _, err = products.Get(name) return }, }
GetCmd to get products
View Source
var GetRatePlanCmd = &cobra.Command{ Use: "get", Short: "Get a rate plan associated with an API Product", Long: "Get a rate plan associated with an API Product", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) (err error) { _, err = products.GetRatePlan(name, rateplan) return }, }
GetRatePlanCmd to list envs
View Source
var ImpCmd = &cobra.Command{ Use: "import", Short: "Import a file containing API products", Long: "Import a file containing API products", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) error { return products.Import(conn, filePath, upsert) }, }
Cmd to import products
View Source
var ListAttrCmd = &cobra.Command{ Use: "list", Short: "List attributes of an API product", Long: "List attributes of an API product", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) (err error) { _, err = products.ListAttributes(name) return }, }
ListAttrCmd to delete product attribute
View Source
var ListCmd = &cobra.Command{ Use: "list", Short: "Returns a list of API products", Long: "Returns a list of API products with a filter by attribute names and values if provided", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) (err error) { _, err = products.List(count, expand) return }, }
Cmd to list products
View Source
var ListRatePlanCmd = &cobra.Command{ Use: "list", Short: "List rate plans associated with an API Product", Long: "List rate plans associated with an API Product", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) (err error) { _, err = products.ListRatePlan(name) return }, }
ListRatePlanCmd to list envs
View Source
var RatePlanCmd = &cobra.Command{
Use: "rateplans",
Short: "Manage rateplans for an API Product",
Long: "Manage rateplans for an API Product",
}
RatePlanCmd to manage rateplans of api products
View Source
var UpdAttrCmd = &cobra.Command{ Use: "update", Short: "Update an attribute of an API product", Long: "Update an attribute of an API product", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) (err error) { _, err = products.UpdateAttribute(name, attrName, attrValue) return }, }
UpdAttrCmd to delete product attribute
View Source
var UpdateCmd = &cobra.Command{ Use: "update", Short: "Update an API product", Long: "Update an API product", Args: func(cmd *cobra.Command, args []string) (err error) { return apiclient.SetApigeeOrg(org) }, RunE: func(cmd *cobra.Command, args []string) (err error) { p := products.Product{} p.Name = name p.DisplayName = displayName p.ApprovalType = approval p.Description = description p.Quota = quota p.QuotaInterval = quotaInterval p.QuotaTimeUnit = quotaUnit p.Environments = environments p.Proxies = proxies p.Scopes = scopes p.OperationGroup, err = getOperationGroup(operationGroupFile) if err != nil { return err } p.GraphQLOperationGroup, err = getGqlOperationGroup(gqlOperationGroupFile) if err != nil { return nil } p.Attributes = getAttributes(attrs) _, err = products.Update(p) return }, }
Cmd to update a product
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.