@startuml
title Host Mapping
hide footbox
autonumber
participant "Client" as c
participant "Gateway\nexternal=gw.ext" as gw
box "Hadoop Cluster"
participant "NameNode\nexternal=nn.ext\ninternal=nn.int" as nn
participant "DataNode\nexternal=dn.ext\ninternal=dn.int" as dn
end box
'1
c->gw
note right: POST https://gw.ext:8443/gateway/cluster/webhdfs/v1/temp/file
activate c
'2
gw->nn
note right: POST http://nn.ext:50070/webhdfs/v1/temp/file
activate gw
activate nn
'3
gw<--nn
note right: 201, Location=http://<b><u>dn.int</u></b>:50075/webhdfs/v1/temp/file
deactivate nn
'4
gw->gw
note right: Hostmap: <b><i>dn.int -> dn.ext
'5
c<--gw
note right: 201, Location=https://gw.ext:8443/gateway/cluster/webhdfs/data/temp/file?_=<i><color:green>[loc=http://<b><u>dn.ext</u></b>:50075/webhdfs/v1/temp/file>]</i>
deactivate gw
'6
c->gw
note right: POST https://gw.ext:8443/gateway/cluster/webhdfs/data/temp/file?_=<i><color:green>[loc=http://<b><u>dn.ext</u></b>:50075/webhdfs/v1/temp/file>]</i>
activate gw
'7
gw->dn
note right: POST loc=http://<b><u>dn.ext</u></b>:50075/webhdfs/v1/temp/file>
activate dn
'8
gw<--dn: OK
note right: 200 OK
deactivate dn
'9
c<--gw:
note right: 200 OK
deactivate gw
deactivate c
legend center
  Text show in <i><color:green>[italic green]</color></i> above is encrypted.
endlegend
@enduml