Aviatrix APIs For Datacenter Extension
Aviatrix APIs For Datacenter Extension
APIs
for
Datacenter
Extension
Usecase
Version
12-09-2016
Copyright
2014-2016
Aviatrix
Systems,
Inc.
All
rights
reserved.
Introduction
The
APIs
for
Aviatrix
CloudN
can
be
alternatively
used
for
the
tasks
that
are
done
through
the
Web
UI.
The
following
is
an
example
to
utilize
the
APIs
to
create
a
VPC/VNet
under
Datacenter
Extension.
Datacenter
Extension
capability
manages
your
cloud
address
range.
It
creates
VPC/VNet,
subnets,
routing
tables
and
create
a
IPSec
tunnel
to
the
virtual
appliance
(Aviatrix
CloudN),
so
that
on-premise
VMs
and
servers
can
communicate
with
instances
in
created
VPC
with
packet
encryption
and
private
IP
addresses.
Replace
the
value
of
CID with
the
one
in
step
1.
Replace
the
value
of
customer_id
with
your
license.
Make
sure
the
license
is
successfully
entered
and
it
returns
the
license
information
correctly.
{
"return": true,
"results": {
"license_list": [
{
"Lic-1436678987.59": {
"Verified": 0,
"Type": "c4.4xlarge",
"Expiration": "2017-12-09",
"Allocated": 0,
"IssueDate": "2016-12-09",
"Quantity": 20
}
}
],
"CustomerID": "carmelodev-1234567898.64"
}
}
3. Set
up
the
maximum
number
of
VPC/VNet
https://IP_Address_of_CloudN/v1/api?CID=584b4b57a42f2&action=
setup_max_vpc_containers&vpc_num=4
Replace
the
value
of
CID with
the
one
in
step
1.
Replace
the
value
of
vpc_num
with
the
number
you
desire
to
set
up.
{
"return": true,
"result": {
"cidr_list": [
"10.16.32.0\/19",
"10.16.64.0\/19",
"10.16.96.0\/19",
"10.16.128.0\/19"
]
}
}
4. Create
a
User
Account
Before
calling
the
API
to
set
up
an
account
that
enables
CloudN
to
access
the
cloud,
gather
the
account
information
from
the
cloud
provider.
AWS
(
cloud_type
=
1
):
Account
Number,
Access
key
and
Secret
Key
Azure
(
cloud_type
=
2
):
Azure
Subscription
ID
Azure
RM
(
cloud_type
=
8
):
Azure
Subscription
ID,
Application
Endpoint,
Application
Client
ID
and
Application
Client
Secret
This
API
needs
to
use
POST
method
of
HTTP
to
send
the
account
information.
Use
any
tool
of
your
preference
to
send
the
POST
HTTP
request:
POST
https://192.168.0.251/v1/api
Body
{
"CID": "584b4b57a42f2",
"action": "setup_account_profile",
"account_name": "user2",
"account_password": "12345",
"account_email": "[email protected]",
"cloud_type": "1",
"aws_account_number": "982805288348",
"aws_access_key": "AKIAIQDAABCPKKKWQA",
"aws_secret_key": "9ttSESnQvb\/OlWZKCjyPsbcdYgamthksK2+1G"
}
The
above
example
is
to
set
up
an
AWS
account
(cloud_type
is
1
).
The
others
are
the
account
information
from
AWS.
{
"return": true,
"results": "An email with instructions has been sent to
[email protected]"
}
5. Create
a
VPC/VNet
for
Datacenter
Extension
Currently,
two
cloud
types
are
available
for
Datacenter
Extension.
They
are
AWS
and
Azure
ARM.
Hence,
it
either
to
create
a
VPC
or
VNet.
The
CIDR
of
this
VPC/VNet
can
only
be
one
of
the
available
CIDRs
you
set
up
in
step
3.
Enter
the
CIDR
as
the
value
of
vpc_net
in
this
API.
POST https://172.16.150.15/v1/api
Body
{
"CID": "584b4b57a42f2",
"action": "create_container",
"cloud_type": "1",
"account_name": "user2",
"vpc_name": "dc-us-west-1",
"vpc_reg": "us-west-2",
"vpc_size": "t2.micro",
"vpc_net": "10.16.96.0\/19"
}
The
result
is
expected
to
return
after
a
while.
There
are
other
options
you
can
specify
when
you
use
this
API
to
create
a
VPC/VNet.
Refer
to
the
reference
document
for
more
details
about
the
options.