Skip to content

Commit

Permalink
fix: Cannot create API Hub deployment #456 (#457)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtkanaskie authored May 5, 2024
1 parent fda280e commit e189244
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions internal/client/registry/apis/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ import (

// CreateDeployment
func CreateDeployment(apiDeploymentID string, name string, displayName string, description string,
apiSpecRevsion string, endpointURI string, externalChannelURI string, intendedAudience string,
apiSpecRevision string, endpointURI string, externalChannelURI string, intendedAudience string,
accessGuidance string, labels map[string]string, annotations map[string]string,
) (respBody []byte, err error) {
u, _ := url.Parse(apiclient.GetApigeeRegistryURL())
u.Path = path.Join(u.Path, "apis", apiDeploymentID, "deployment")
u.Path = path.Join(u.Path, "apis", apiDeploymentID, "deployments")
q := u.Query()
q.Set("apiDeploymentId", name)
u.RawQuery = q.Encode()
apiDeployment := []string{}
apiDeployment = append(apiDeployment, "\"name\":"+"\""+name+"\"")
if displayName != "" {
Expand All @@ -38,8 +41,8 @@ func CreateDeployment(apiDeploymentID string, name string, displayName string, d
if description != "" {
apiDeployment = append(apiDeployment, "\"description\":"+"\""+description+"\"")
}
if apiSpecRevsion != "" {
apiDeployment = append(apiDeployment, "\"apiSpecRevsion\":"+"\""+apiSpecRevsion+"\"")
if apiSpecRevision != "" {
apiDeployment = append(apiDeployment, "\"apiSpecRevision\":"+"\""+apiSpecRevision+"\"")
}
if endpointURI != "" {
apiDeployment = append(apiDeployment, "\"endpointUri\":"+"\""+endpointURI+"\"")
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/registry/apis/deployments/crtdeploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ func init() {
"", "API Spec Revision")
CreateDeployCmd.Flags().StringVarP(&endpointURI, "endpoint-uri", "",
"", "Endpoint URI for the API")
CreateDeployCmd.Flags().StringVarP(&apiSpecRevision, "external-channel-uri", "",
CreateDeployCmd.Flags().StringVarP(&externalChannelURI, "external-channel-uri", "",
"", "External Channle URI")
CreateDeployCmd.Flags().StringVarP(&apiSpecRevision, "intended-audience", "",
CreateDeployCmd.Flags().StringVarP(&intendedAudience, "intended-audience", "",
"", "Intended Audience for the API")
CreateDeployCmd.Flags().StringVarP(&accessGuidance, "access-guidance", "",
"", "Guidance for accessing the API")
Expand Down

0 comments on commit e189244

Please sign in to comment.