Merge branch 'main' into index_search
This commit is contained in:
		@ -1085,8 +1085,7 @@ documents:
 | 
			
		||||
    service_type: waf
 | 
			
		||||
    title: User Guide
 | 
			
		||||
    type: umn
 | 
			
		||||
  - environment: internal
 | 
			
		||||
    hc_location: api/dwaf
 | 
			
		||||
  - hc_location: api/dwaf
 | 
			
		||||
    html_location: docs/wafd/api-ref
 | 
			
		||||
    link: /web-application-firewall-dedicated/api-ref/
 | 
			
		||||
    pdf_name: wafd-api-ref
 | 
			
		||||
@ -1094,8 +1093,7 @@ documents:
 | 
			
		||||
    service_type: wafd
 | 
			
		||||
    title: API Reference
 | 
			
		||||
    type: api-ref
 | 
			
		||||
  - environment: internal
 | 
			
		||||
    hc_location: usermanual/dwaf
 | 
			
		||||
  - hc_location: usermanual/dwaf
 | 
			
		||||
    html_location: docs/wafd/umn
 | 
			
		||||
    link: /web-application-firewall-dedicated/umn/
 | 
			
		||||
    pdf_name: wafd-umn
 | 
			
		||||
@ -2028,7 +2026,7 @@ services:
 | 
			
		||||
    service_title: Dedicated Web Application Firewall
 | 
			
		||||
    service_type: wafd
 | 
			
		||||
    service_uri: web-application-firewall-dedicated
 | 
			
		||||
    environment: internal
 | 
			
		||||
    environment: public
 | 
			
		||||
    teams:
 | 
			
		||||
      - name: docs-security-services-rw
 | 
			
		||||
        permission: write
 | 
			
		||||
 | 
			
		||||
@ -113,6 +113,48 @@ class Services(object):
 | 
			
		||||
            res[cat]["docs"].append(res_doc)
 | 
			
		||||
        return res
 | 
			
		||||
 | 
			
		||||
    def service_types_with_doc_types(self, environment=None):
 | 
			
		||||
        """Retrieve type and title from services and corresponding docs.
 | 
			
		||||
            As well as a list of all doc_types.
 | 
			
		||||
 | 
			
		||||
        :param str environment: Optional service environment.
 | 
			
		||||
        """
 | 
			
		||||
        service_list = []
 | 
			
		||||
        doc_types = []
 | 
			
		||||
 | 
			
		||||
        for service in self.all_services:
 | 
			
		||||
            if not service["service_title"]:
 | 
			
		||||
                continue
 | 
			
		||||
            if not service["service_type"]:
 | 
			
		||||
                continue
 | 
			
		||||
 | 
			
		||||
            doc_list = []
 | 
			
		||||
            for doc in self.all_docs:
 | 
			
		||||
                if "environment" in doc:
 | 
			
		||||
                    if doc["environment"] != environment:
 | 
			
		||||
                        continue
 | 
			
		||||
                if doc["service_type"] == service["service_type"]:
 | 
			
		||||
                    doc_list.append({
 | 
			
		||||
                        "title": doc["title"],
 | 
			
		||||
                        "type": doc["type"]
 | 
			
		||||
                    })
 | 
			
		||||
 | 
			
		||||
                if doc["type"] not in doc_types:
 | 
			
		||||
                    doc_types.append(doc["type"])
 | 
			
		||||
 | 
			
		||||
            service_list.append({
 | 
			
		||||
                "service_title": service["service_title"],
 | 
			
		||||
                "service_type": service["service_type"],
 | 
			
		||||
                "docs": doc_list
 | 
			
		||||
            })
 | 
			
		||||
 | 
			
		||||
        res = {
 | 
			
		||||
            "services": service_list,
 | 
			
		||||
            "doc_types": doc_types
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return res
 | 
			
		||||
 | 
			
		||||
    def docs_by_service_category(self, category, environment=None):
 | 
			
		||||
        """List services matching category
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user