KDDIクラウドプラットフォームサービス ナレッジサイト

  • HOME
  • 提供API一覧
  • createPortForwardingRule

createPortForwardingRule

処理概要

ポート転送ルールを作成

 

注意事項

・なし

 

リクエスト

・リクエストパラメータ

Parameter Name Description Required
ipaddressid the IP address id of the port forwarding rule true
privateport the starting port of port forwarding rule’s private port range true
protocol the protocol for the port forwarding rule. Valid values are TCP or UDP. true
publicport the starting port of port forwarding rule’s public port range true
virtualmachineid the ID of the virtual machine for the port forwarding rule true
privateendport the ending port of port forwarding rule’s private port range false
publicendport the ending port of port forwarding rule’s private port range false
vmguestip VM guest nic secondary IP address for the port forwarding rule false

 

・リクエストサンプル

$ ./kick_api.sh command=createPortForwardingRule ipaddressid=23897133-7ec2-4719-abec-a1990c183be0 privateport=22 protocol=tcp publicport=22 virtualmachineid=14aa749d-bd33-4a55-a441-e1d4126f2633

 

レスポンス

・レスポンスボディ

Response Name Description
id the ID of the port forwarding rule
cidrlist the cidr list to forward traffic from
fordisplay is firewall for display to the regular user
ipaddress the public ip address for the port forwarding rule
ipaddressid the public ip address id for the port forwarding rule
networkid the id of the guest network the port forwarding rule belongs to
privateendport the ending port of port forwarding rule’s private port range
privateport the starting port of port forwarding rule’s private port range
protocol the protocol of the port forwarding rule
publicendport the ending port of port forwarding rule’s private port range
publicport the starting port of port forwarding rule’s public port range
state the state of the rule
virtualmachinedisplayname the VM display name for the port forwarding rule
virtualmachineid the VM ID for the port forwarding rule
virtualmachinename the VM name for the port forwarding rule
vmguestip the vm ip address for the port forwarding rule
tags(*) the list of resource tags associated with the rule
account the account associated with the tag
customer customer associated with the tag
domain the domain associated with the tag
domainid the ID of the domain associated with the tag
key tag key name
project the project name where tag belongs to
projectid the project id the tag belongs to
resourceid id of the resource
resourcetype resource type
value tag value

 

・レスポンスサンプル

【API実行結果】
<?xml version=”1.0″ encoding=”UTF-8″?>
<createportforwardingruleresponse cloud-stack-version=”4.3.0.2″>
<id>564509f1-8877-415e-b1d3-04e6cdedb6db</id>
<jobid>eb7d5642-675f-4789-a5ea-c85ea4ae62d8</jobid>
</createportforwardingruleresponse>

 

【queryAsyncJobResultでの確認結果】
<?xml version=”1.0″ encoding=”UTF-8″?>
<queryasyncjobresultresponse cloud-stack-version=”4.3.0.2″>
<accountid>d344caf5-24dc-4194-ac5f-2d78d5e38039</accountid>
<userid>0212ea46-0529-4250-9e3e-bcb03c114002</userid>
<cmd>org.apache.cloudstack.api.command.user.firewall.CreatePortForwardingRuleCmd</cmd>
<jobstatus>1</jobstatus>
<jobprocstatus>0</jobprocstatus>
<jobresultcode>0</jobresultcode>
<jobresulttype>object</jobresulttype>
<jobresult>
<portforwardingrule>
<id>564509f1-8877-415e-b1d3-04e6cdedb6db</id>
<privateport>22</privateport>
<privateendport>22</privateendport>
<protocol>tcp</protocol>
<publicport>22</publicport>
<publicendport>22</publicendport>
<virtualmachineid>14aa749d-bd33-4a55-a441-e1d4126f2633</virtualmachineid>
<virtualmachinename>v-TEST01-MXXXXXXXX</virtualmachinename>
<virtualmachinedisplayname>v-TEST01-MXXXXXXXX</virtualmachinedisplayname>
<ipaddressid>23897133-7ec2-4719-abec-a1990c183be0</ipaddressid>
<ipaddress>27.XXX.XXX.98</ipaddress>
<state>Active</state>
<cidrlist/>
<vmguestip>10.1.1.163</vmguestip>
<networkid>dfab0cf8-c56f-437c-9816-14e47d127235</networkid>
</portforwardingrule>
</jobresult>
<created>2016-09-22T14:46:54+0900</created>
<jobid>eb7d5642-675f-4789-a5ea-c85ea4ae62d8</jobid>
</queryasyncjobresultresponse>

提供API一覧

2022/07/05 2022/07/05