feat: add service registry target helper

This commit is contained in:
2026-04-28 15:42:16 +00:00
parent b22f3b6d64
commit 665d3aca90
3 changed files with 27 additions and 7 deletions
+20
View File
@@ -31,6 +31,22 @@ export class Service implements plugins.servezoneInterfaces.data.IService {
return newService;
}
public static async getServiceRegistryTarget(
cloudlyClientRef: CloudlyApiClient,
serviceIdArg: string,
tagArg = 'latest',
) {
const getServiceRegistryTargetTR = cloudlyClientRef.typedsocketClient.createTypedRequest<plugins.servezoneInterfaces.requests.service.IRequest_Any_Cloudly_GetServiceRegistryTarget>(
'getServiceRegistryTarget'
);
const response = await getServiceRegistryTargetTR.fire({
identity: cloudlyClientRef.identity,
serviceId: serviceIdArg,
tag: tagArg,
});
return response.registryTarget;
}
/**
* creates a new service
*/
@@ -75,4 +91,8 @@ export class Service implements plugins.servezoneInterfaces.data.IService {
return flatKeyValueObject;
}
public async getRegistryTarget(tagArg = 'latest') {
return Service.getServiceRegistryTarget(this.cloudlyClientRef, this.id, tagArg);
}
}