예제 #1
0
        public async Task RenamePodTemplateAsync(int podID, string templateName, RenameTemplateRequest req)
        {
            if (podID < 1)
            {
                throw new Client.Exception.UKFastClientValidationException("Invalid pod id");
            }
            if (string.IsNullOrEmpty(templateName))
            {
                throw new Client.Exception.UKFastClientValidationException("Invalid template name");
            }

            await this.Client.PostAsync($"/ecloud/v1/pods/{podID}/templates/{templateName}/move", req);
        }
        public async Task RenameSolutionTemplateAsync_ValidParameters_ExpectedResult()
        {
            IUKFastECloudClient client = Substitute.For <IUKFastECloudClient>();

            var req = new RenameTemplateRequest()
            {
                Destination = "newtemplate"
            };

            var ops = new SolutionTemplateOperations <Template>(client);
            await ops.RenameSolutionTemplateAsync(123, "testtemplate", req);

            await client.Received().PostAsync("/ecloud/v1/solutions/123/templates/testtemplate/move", req);
        }