-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest_template.yml
162 lines (162 loc) · 4.55 KB
/
manifest_template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
SERVICE_NAME: nrl-consumer-api
PRODUCT_DISPLAY_NAME: nrl-consumer-api
DESCRIPTION: example description
APIGEE_ENVIRONMENTS:
- name: internal-dev
display_name: Internal Development
has_mock_auth: true
approval_type: auto
ratelimiting:
quota:
enabled: false
spikeArrest:
enabled: false
- name: internal-dev-sandbox
display_name: Internal Development Sandbox
portal_visibility: false
approval_type: auto
ratelimiting:
quota:
enabled: false
spikeArrest:
enabled: false
- name: internal-qa
display_name: Internal QA
has_mock_auth: true
approval_type: auto
ratelimiting:
quota:
enabled: false
spikeArrest:
enabled: false
- name: internal-qa-sandbox
display_name: Internal QA Sandbox
portal_visibility: false
approval_type: auto
ratelimiting:
quota:
enabled: false
spikeArrest:
enabled: false
- name: ref
display_name: Ref
has_mock_auth: true
approval_type: auto
ratelimiting:
quota:
enabled: true
limit: 30000 # 500/s
interval: 1
timeunit: minute
spikeArrest:
enabled: true
ratelimit: '30000pm' # 500/s
- name: sandbox
display_name: Sandbox
portal_visibility: false
approval_type: auto
ratelimiting:
quota:
enabled: true
limit: 300 # 5/s
interval: 1
timeunit: minute
spikeArrest:
enabled: true
ratelimit: '300pm' # 5/s
- name: int
display_name: Integration Testing
has_mock_auth: true
approval_type: manual
ratelimiting:
quota:
enabled: true
limit: 30000 # 500/s
interval: 1
timeunit: minute
spikeArrest:
enabled: true
ratelimit: '30000pm' # 500/s
- name: prod
display_name: Production
approval_type: manual
ratelimiting:
quota:
enabled: true
limit: 30000 # 500/s
interval: 1
timeunit: minute
spikeArrest:
enabled: true
ratelimit: '30000pm' # 500/s
---
meta:
api:
name: nrl-consumer-api
guid: e2ee307a-1e7e-4f2e-ae45-788912caa268
spec_guids:
- 458e4b8f-509a-4427-8d1a-1ba75223c28c
schema_version: 1.3
apigee:
environments:
{% for ENV in APIGEE_ENVIRONMENTS %}
{% set TITLE = PRODUCT_DISPLAY_NAME + ' (' + ENV.display_name + ' Environment)' %}
{% set NAME = SERVICE_NAME + '-' + ENV.name %}
{% set APPROVAL_TYPE = ENV.APPROVAL_TYPE | default('manual' if ENV.name == 'prod' else 'auto') %}
- name: {{ ENV.name }}
products:
- name: {{ NAME }}
approvalType: {{ APPROVAL_TYPE }}
attributes:
- name: access
value: public
# For a parameterised example of rate limiting per environment,
# see https://github.com/NHSDigital/personal-demographics-service-api/blob/master/manifest_template.yml
- name: ratelimiting
value:
{{ NAME }}:
quota:
{% if ENV.ratelimiting.quota.enabled | default(true) %}
enabled: true
limit: {{ ENV.ratelimiting.quota.limit | default(300) }}
interval: {{ ENV.ratelimiting.quota.interval | default(1) }}
timeunit: {{ ENV.ratelimiting.quota.timeunit | default('minute') }}
{% else %}
enabled: false
{% endif %}
spikeArrest:
{% if ENV.ratelimiting.spikeArrest.enabled | default(true) %}
enabled: true
ratelimit: {{ ENV.ratelimiting.spikeArrest.ratelimit | default('300pm') }}
{% else %}
enabled: false
{% endif %}
app:
quota:
enabled: false
spikeArrest:
enabled: false
description: {{ DESCRIPTION }}
displayName: {{ TITLE }}
environments: [ {{ ENV.name }} ]
proxies:
- {{ NAME }}
- identity-service-{{ ENV.name }}
{% if ENV.has_mock_auth | default(false) %}
- identity-service-mock-{{ ENV.name }}
{% endif %}
scopes:
- 'urn:nhsd:apim:app:level3:{{ SERVICE_NAME }}'
- 'urn:nhsd:apim:user-nhs-id:aal3:{{ SERVICE_NAME }}'
specs:
- name: {{ NAME }}
path: {{ SERVICE_NAME }}.json
api_catalog:
- edgeAPIProductName: {{ NAME }}
anonAllowed: true
description: {{ DESCRIPTION }}
requireCallbackUrl: false
title: {{ TITLE }}
visibility: {{ ENV.portal_visibility | default(true) }}
specId: {{ NAME }}
{% endfor %}