-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle Service Bindings in SM client and get Service Instances in API (…
…#735) * wip * wip * wip * Rebase and sort imports * wip * Fix fetching structs fields * Fix ServiceBinding struct * GET Service Instances in API * CRUD Service Bindings * GET Service Plan by ID in SM client * GET Service Instance by ID in API * Revert temp changes --------- Co-authored-by: Marcin Szwed <[email protected]> Co-authored-by: Ksawery Zietara <[email protected]>
- Loading branch information
1 parent
1578c07
commit 6cec48e
Showing
14 changed files
with
849 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package requests | ||
|
||
import ( | ||
"github.com/kyma-project/btp-manager/internal/service-manager/types/requests" | ||
) | ||
|
||
func CreateServiceBindingVM(request CreateServiceBinding) requests.CreateServiceBindingRequestPayload { | ||
payload := requests.CreateServiceBindingRequestPayload{ | ||
Name: request.Name, | ||
ServiceInstanceID: request.ServiceInstanceId, | ||
Parameters: []byte(request.Parameters), | ||
Labels: map[string][]string{}, | ||
} | ||
payload.Labels["_clusterid"] = append(payload.Labels["_clusterid"], payload.Name) | ||
payload.Labels["_namespace"] = append(payload.Labels["_namespace"], request.Namespace) | ||
payload.Labels["_k8sname"] = append(payload.Labels["_k8sname"], request.Name) | ||
return payload | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package requests | ||
|
||
type CreateServiceBinding struct { | ||
Name string `json:"name"` | ||
Namespace string `json:"namespace"` | ||
ServiceInstanceId string `json:"serviceInstanceId"` | ||
Parameters string `json:"parameters"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.