-
Notifications
You must be signed in to change notification settings - Fork 2
/
URL_Translation.yaml
128 lines (126 loc) · 4.61 KB
/
URL_Translation.yaml
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
---
name: URL_Translation
version: "2.0"
namespace: com.One2Any.stylebooks
display-name: "URL Transform Module management"
description: "Centralized and simplified management of URL Translation rewriting FQDN"
schema-version: "1.0"
author: "[email protected]"
# Notes:
# ADM version: 13.0.47.22
# ADC version: 13.0.47.24
# 2.0 26 OCT 2020 target-fqdn can be changed
# 1.4 02 JUL 2020 Made sample data generic
# 1.1 08 MAR 2020 optimized foreach components
# 1.0 06 MAR 2020
import-stylebooks:
-
namespace: netscaler.nitro.config
version: "12.1"
prefix: ns
parameters:
-
key: true
name: configpack-name
label: "Configpack Name"
description: "This is what the configuration pack will be labeled in ADM"
type: string
default: "Provider Search"
required: true
-
name: cfg
label: "Binding Location & Priority"
type: object
required: true
gui:
collapse_pane: Yes
columns: 2
updatable: false
parameters:
-
name: vserver-name
label: "Virtual Server Name"
description: "This non-updatable value is the virtual server name to which this configuration is bound"
type: string
default: "Find-a-Provider"
required: true
updatable: false
-
name: target-fqdn
label: "Tranlate incomming requests into this name"
type: string
default: "findaprovider-v2.ckp-dmz.company.com"
required: true
updatable: true
-
name: priority-start
label: "Starting Priority value"
description: "This is the priority of the first policy bound to the virtual server. Subsequent bindings will be incremented by 10."
type: number
min-value: 1000
max-value: 1000000
default: 8000
required: true
updatable: true
-
name: list-of-domains
label: Transform Domains
description: "List of client facing domains"
type: object[]
parameters:
-
name: client-domain
label: Client Domain Name
type: string
pattern: "^[A-z_][ A-z0-9_#.:@=-]+"
required: true
components:
-
name: transformprofile-comp
type: ns::transformprofile
repeat: $parameters.list-of-domains
repeat-item: each-item
properties:
name: $parameters.cfg.vserver-name + "_" + $each-item.client-domain + "_profile"
comment: str("ADM Stylebook managed. Do not change")
description: create each tranform profile and associated actions, policy, vserver binding, and DNS records.
components:
-
name: transformpaction-comp
type: ns::transformaction
properties:
profilename: $parameters.cfg.vserver-name + "_" + $each-item.client-domain + "_profile"
name: $each-item.client-domain
priority: 100
state: ENABLED
requrlfrom: str( "https://%{$each-item.client-domain}%/(.*)" )
requrlinto: str( "https://%{$parameters.cfg.target-fqdn}%/$1" )
# requrlinto: str(~{https://}~) + $parameters.cfg.target-fqdn + str(~{/$1}~) # verbatim string operator
resUrlFrom: str( "https://%{$parameters.cfg.target-fqdn}%/(.*)" )
resUrlInto: str( "https://%{$each-item.client-domain}%/$1" )
cookiedomainfrom?:
cookiedomaininto?:
comment?: str("ADM Stylebook managed. Do not change")
-
name: transformpolicy-comp
type: ns::transformpolicy
properties:
name: $parameters.cfg.vserver-name + "_" + $each-item.client-domain + "_policy"
rule: str("HTTP.REQ.HOSTNAME.EQ(%{quotewrap($each-item.client-domain)}%)")
profilename: $parameters.cfg.vserver-name + "_" + $each-item.client-domain + "_profile"
comment?: str("ADM Stylebook managed")
#Ref: https://developer-docs.citrix.com/projects/netscaler-nitro-api/en/12.0/configuration/transform/transformpolicy/transformpolicy/
-
name: lbvserver_rewritepolicy_binding-comp
type: ns::lbvserver_rewritepolicy_binding
properties:
priority?: $parameters.cfg.priority-start + 10 * $repeat-index
bindpoint?: REQUEST
policyname?: $parameters.cfg.vserver-name + "_" + $each-item.client-domain + "_policy"
name: $parameters.cfg.vserver-name
#Ref: https://developer-docs.citrix.com/projects/netscaler-nitro-api/en/12.0/configuration/load-balancing/lbvserver_rewritepolicy_binding/lbvserver_rewritepolicy_binding/
outputs:
-
name: transformprofile-comp
value: $components.transformprofile-comp
description: The component that builds the URL-T configuration.