-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(catalog): implement delete entity
- Loading branch information
Showing
3 changed files
with
66 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package catalog | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"net/url" | ||
) | ||
|
||
// DeleteEntityByUIDRequest is the request to the [Client.DeleteEntityByUID] method. | ||
type DeleteEntityByUIDRequest struct { | ||
// UID of the entity to get. | ||
UID string | ||
} | ||
|
||
// DeleteEntityByUID gets an entity by its kind, namespace and name. | ||
// | ||
// See: https://backstage.io/docs/features/software-catalog/software-catalog-api/#get-entitiesby-uiduid | ||
func (c *Client) DeleteEntityByUID(ctx context.Context, request *DeleteEntityByUIDRequest) error { | ||
const pathTemplate = "/api/catalog/entities/by-uid/%s" | ||
return c.delete(ctx, fmt.Sprintf(pathTemplate, url.PathEscape(request.UID))) | ||
} |
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