예제 #1
0
        public List <TagApiTemplateResource> CreateTagAPITemplateResources(APIConfig api, string[] dependsOn)
        {
            // create a tag/apis association resource for each tag in the config file
            List <TagApiTemplateResource> tagAPITemplates = new List <TagApiTemplateResource>();

            // tags is comma seperated list pf tags
            string[] tagIDs = api.tags.Split(", ");
            foreach (string tagID in tagIDs)
            {
                TagApiTemplateResource tagAPITemplate = this.CreateTagAPITemplateResource(tagID, api.name, dependsOn);
                tagAPITemplates.Add(tagAPITemplate);
            }
            return(tagAPITemplates);
        }
예제 #2
0
        public TagApiTemplateResource CreateTagAPITemplateResource(string tagName, string apiName, string[] dependsOn)
        {
            // create tags/apis resource with properties
            TagApiTemplateResource tagAPITemplateResource = new TagApiTemplateResource()
            {
                Name       = $"[concat(parameters('{ParameterNames.ApimServiceName}'), '/{apiName}/{tagName}')]",
                Type       = ResourceTypeConstants.APITag,
                ApiVersion = GlobalConstants.ApiVersion,
                Properties = new TagApiProperties()
                {
                    DisplayName = tagName
                },
                DependsOn = dependsOn
            };

            return(tagAPITemplateResource);
        }
예제 #3
0
        public List <TagApiTemplateResource> CreateTagApiTemplateResources(ApiDeploymentDefinition api, string[] dependsOn)
        {
            var tagApiTemplates = new List <TagApiTemplateResource>();

            var tagDisplayNames = api.TagList;

            foreach (string tagDisplayName in tagDisplayNames)
            {
                var tagName = GetTagName(tagDisplayName);

                var tagApiTemplate = new TagApiTemplateResource()
                {
                    Name       = $"[concat(parameters('ApimServiceName'), '/{api.Name}/{tagName}')]",
                    Properties = new TagApiTemplateProperties(),
                    DependsOn  = dependsOn
                };

                tagApiTemplates.Add(tagApiTemplate);
            }
            return(tagApiTemplates);
        }