Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Use keptn/go-utils to access Keptn APIs #754

Closed
arthurpitman opened this issue Mar 24, 2022 · 0 comments · Fixed by #767
Closed

Use keptn/go-utils to access Keptn APIs #754

arthurpitman opened this issue Mar 24, 2022 · 0 comments · Fixed by #767
Assignees
Labels
story Issue is considered a story and should be resolvable within one sprint

Comments

@arthurpitman
Copy link
Collaborator

Currently the dynatrace-service contains some implementations for accessing for some Keptn APIs.

Instead, it should use the clients provided by keptn/go-utils

e.g. func (a *APIHandler) CreateService(project string, service models.CreateService) (string, *models.Error)

should be used to provide the implementation in

func (c *ServiceClient) CreateServiceInProject(project string, service string) error {
serviceModel := &apimodels.CreateService{
ServiceName: &service,
}
reqBody, err := json.Marshal(serviceModel)
if err != nil {
return fmt.Errorf("could not marshal service payload: %s", err.Error())
}
_, err = c.apiClient.Post(getServicePathFor(project), reqBody)
return err
}

@arthurpitman arthurpitman added the story Issue is considered a story and should be resolvable within one sprint label Mar 24, 2022
@arthurpitman arthurpitman self-assigned this Mar 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
story Issue is considered a story and should be resolvable within one sprint
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant