Unable to remove single project or tag from a tenant

Hi, I’ve been trying to remove a single project or tag from a tenant but all I could see was the below under the tenant members

TypeName: Octopus.Client.Model.TenantResource
ClearProjects                   Method     Octopus.Client.Model.TenantResource ClearProjects()
ClearTags                       Method     Octopus.Client.Model.TenantResource ClearTags()
ConnectToProjectAndEnvironments Method     Octopus.Client.Model.TenantResource ConnectToProjectAndEnvironments(Octopus…
Equals                          Method     bool Equals(System.Object obj)
GetHashCode                     Method     int GetHashCode()
GetType                         Method     type GetType()
HasLink                         Method     bool HasLink(string name)
Link                            Method     string Link(string name)
ToString                        Method     string ToString()
WithTag                         Method     Octopus.Client.Model.TenantResource WithTag(Octopus.Client.Model.TagResourc…
ClonedFromTenantId              Property   string ClonedFromTenantId {get;set;}
Description                     Property   string Description {get;set;}
Id                              Property   string Id {get;set;}
LastModifiedBy                  Property   string LastModifiedBy {get;set;}
LastModifiedOn                  Property   System.Nullable[System.DateTimeOffset] LastModifiedOn {get;set;}
Links                           Property   Octopus.Client.Extensibility.LinkCollection Links {get;set;}
Name                            Property   string Name {get;set;}
ProjectEnvironments             Property   System.Collections.Generic.IDictionary[string,Octopus.Client.Model.Referenc…
SpaceId                         Property   string SpaceId {get;set;}
TenantTags                      Property   Octopus.Client.Model.ReferenceCollection TenantTags {get;set;}

Nothing seems to hint to a function that would remove a single tag or project. Any ideas on how to achieve this?

The above is when using the octopus DLL. I couldn’t find anything under swagger either.

Hi @giulio.dalix,

Thank you for contacting Octopus Support.

We do not have functions for removing individual items within a Tenant. To remove a Tenant Tag from a Tenant, you would need to GET the current list of TenantTags, remove the one you want from the list, then PUT the modified list back. You’ll do the same process for ProjectEnvironments.

Do you have a requirement to use the Octopus DLL? I have a PowerShell script that can be modified to do what you need without too much fuss.

Let me know your thoughts at your earliest convenience.

Best Regards,

1 Like

Thank you very much that works!


This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.