-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
1,628 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require 'fog/openstack/models/collection' | ||
require 'fog/openstack/models/network/ike_policy' | ||
|
||
module Fog | ||
module Network | ||
class OpenStack | ||
class IkePolicies < Fog::OpenStack::Collection | ||
attribute :filters | ||
|
||
model Fog::Network::OpenStack::IkePolicy | ||
|
||
def initialize(attributes) | ||
self.filters ||= {} | ||
super | ||
end | ||
|
||
def all(filters_arg = filters) | ||
filters = filters_arg | ||
load_response(service.list_ike_policies(filters), 'ikepolicies') | ||
end | ||
|
||
def get(ike_policy_id) | ||
if ike_policy = service.get_ike_policy(ike_policy_id).body['ikepolicy'] | ||
new(ike_policy) | ||
end | ||
rescue Fog::Network::OpenStack::NotFound | ||
nil | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
require 'fog/openstack/models/model' | ||
|
||
module Fog | ||
module Network | ||
class OpenStack | ||
class IkePolicy < Fog::OpenStack::Model | ||
identity :id | ||
|
||
attribute :name | ||
attribute :description | ||
attribute :status | ||
attribute :admin_state_up | ||
attribute :tenant_id | ||
attribute :auth_algorithm | ||
attribute :encryption_algorithm | ||
attribute :pfs | ||
attribute :phase1_negotiation_mode | ||
attribute :lifetime | ||
attribute :ike_version | ||
|
||
def create | ||
requires :name, :auth_algorithm, :encryption_algorithm, :ike_version, | ||
:lifetime, :pfs, :phase1_negotiation_mode | ||
merge_attributes(service.create_ike_policy(self.attributes).body['ikepolicy']) | ||
self | ||
end | ||
|
||
def update | ||
requires :id, :name, :auth_algorithm, :encryption_algorithm, :ike_version, | ||
:lifetime, :pfs, :phase1_negotiation_mode | ||
merge_attributes(service.update_ike_policy(self.id, | ||
self.attributes).body['ikepolicy']) | ||
self | ||
end | ||
|
||
def destroy | ||
requires :id | ||
service.delete_ike_policy(self.id) | ||
true | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require 'fog/openstack/models/collection' | ||
require 'fog/openstack/models/network/ipsec_policy' | ||
|
||
module Fog | ||
module Network | ||
class OpenStack | ||
class IpsecPolicies < Fog::OpenStack::Collection | ||
attribute :filters | ||
|
||
model Fog::Network::OpenStack::IpsecPolicy | ||
|
||
def initialize(attributes) | ||
self.filters ||= {} | ||
super | ||
end | ||
|
||
def all(filters_arg = filters) | ||
filters = filters_arg | ||
load_response(service.list_ipsec_policies(filters), 'ipsecpolicies') | ||
end | ||
|
||
def get(ipsec_policy_id) | ||
if ipsec_policy = service.get_ipsec_policy(ipsec_policy_id).body['ipsecpolicy'] | ||
new(ipsec_policy) | ||
end | ||
rescue Fog::Network::OpenStack::NotFound | ||
nil | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
require 'fog/openstack/models/model' | ||
|
||
module Fog | ||
module Network | ||
class OpenStack | ||
class IpsecPolicy < Fog::OpenStack::Model | ||
identity :id | ||
|
||
attribute :name | ||
attribute :description | ||
attribute :status | ||
attribute :admin_state_up | ||
attribute :tenant_id | ||
attribute :auth_algorithm | ||
attribute :encryption_algorithm | ||
attribute :pfs | ||
attribute :transform_protocol | ||
attribute :encapsulation_mode | ||
attribute :lifetime | ||
|
||
def create | ||
requires :name, :auth_algorithm, :encryption_algorithm, | ||
:lifetime, :pfs, :transform_protocol, | ||
:encapsulation_mode | ||
merge_attributes(service.create_ipsec_policy(self.attributes).body['ipsecpolicy']) | ||
self | ||
end | ||
|
||
def update | ||
requires :id, :name, :auth_algorithm, :encryption_algorithm, | ||
:lifetime, :pfs, :transform_protocol, | ||
:encapsulation_mode | ||
merge_attributes(service.update_ipsec_policy(self.id, | ||
self.attributes).body['ipsecpolicy']) | ||
self | ||
end | ||
|
||
def destroy | ||
requires :id | ||
service.delete_ipsec_policy(self.id) | ||
true | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
require 'fog/openstack/models/model' | ||
|
||
module Fog | ||
module Network | ||
class OpenStack | ||
class IpsecSiteConnection < Fog::OpenStack::Model | ||
identity :id | ||
|
||
attribute :name | ||
attribute :description | ||
attribute :status | ||
attribute :admin_state_up | ||
attribute :tenant_id | ||
attribute :vpnservice_id | ||
attribute :ikepolicy_id | ||
attribute :ipsecpolicy_id | ||
attribute :peer_address | ||
attribute :peer_id | ||
attribute :peer_cidrs | ||
attribute :psk | ||
attribute :mtu | ||
attribute :dpd | ||
attribute :initiator | ||
attribute :admin_state_up | ||
|
||
def create | ||
requires :name, :vpnservice_id, :ikepolicy_id, :ipsecpolicy_id, | ||
:peer_address, :peer_id, :peer_cidrs, :psk | ||
merge_attributes(service.create_ipsec_site_connection(vpnservice_id, | ||
ikepolicy_id, | ||
ipsecpolicy_id, | ||
self.attributes).body['ipsec_site_connection']) | ||
self | ||
end | ||
|
||
def update | ||
requires :id, :name, :vpnservice_id, :ikepolicy_id, :ipsecpolicy_id, | ||
:peer_address, :peer_id, :peer_cidrs, :psk | ||
merge_attributes(service.update_ipsec_site_connection(self.id, | ||
self.attributes).body['ipsec_site_connection']) | ||
self | ||
end | ||
|
||
def destroy | ||
requires :id | ||
service.delete_ipsec_site_connection(self.id) | ||
true | ||
end | ||
end | ||
end | ||
end | ||
end |
32 changes: 32 additions & 0 deletions
32
lib/fog/openstack/models/network/ipsec_site_connections.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require 'fog/openstack/models/collection' | ||
require 'fog/openstack/models/network/ipsec_site_connection' | ||
|
||
module Fog | ||
module Network | ||
class OpenStack | ||
class IpsecSiteConnections < Fog::OpenStack::Collection | ||
attribute :filters | ||
|
||
model Fog::Network::OpenStack::IpsecSiteConnection | ||
|
||
def initialize(attributes) | ||
self.filters ||= {} | ||
super | ||
end | ||
|
||
def all(filters_arg = filters) | ||
filters = filters_arg | ||
load_response(service.list_ipsec_site_connections(filters), 'ipsec_site_connections') | ||
end | ||
|
||
def get(ipsec_site_connection_id) | ||
if ipsec_site_connection = service.get_ipsec_site_connection(ipsec_site_connection_id).body['ipsec_site_connection'] | ||
new(ipsec_site_connection) | ||
end | ||
rescue Fog::Network::OpenStack::NotFound | ||
nil | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
require 'fog/openstack/models/model' | ||
|
||
module Fog | ||
module Network | ||
class OpenStack | ||
class VpnService < Fog::OpenStack::Model | ||
identity :id | ||
|
||
attribute :subnet_id | ||
attribute :router_id | ||
attribute :name | ||
attribute :description | ||
attribute :status | ||
attribute :admin_state_up | ||
attribute :tenant_id | ||
attribute :external_v4_ip | ||
attribute :external_v6_ip | ||
|
||
def create | ||
requires :subnet_id, :router_id, :name, :admin_state_up | ||
merge_attributes(service.create_vpn_service(self.subnet_id, | ||
self.router_id, | ||
self.attributes).body['vpnservice']) | ||
self | ||
end | ||
|
||
def update | ||
requires :id, :subnet_id, :router_id, :name, :admin_state_up | ||
merge_attributes(service.update_vpn_service(self.id, | ||
self.attributes).body['vpnservice']) | ||
self | ||
end | ||
|
||
def destroy | ||
requires :id | ||
service.delete_vpn_service(self.id) | ||
true | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require 'fog/openstack/models/collection' | ||
require 'fog/openstack/models/network/vpn_service' | ||
|
||
module Fog | ||
module Network | ||
class OpenStack | ||
class VpnServices < Fog::OpenStack::Collection | ||
attribute :filters | ||
|
||
model Fog::Network::OpenStack::VpnService | ||
|
||
def initialize(attributes) | ||
self.filters ||= {} | ||
super | ||
end | ||
|
||
def all(filters_arg = filters) | ||
filters = filters_arg | ||
load_response(service.list_vpn_services(filters), 'vpnservices') | ||
end | ||
|
||
def get(vpn_service_id) | ||
if vpn_service = service.get_vpn_service(vpn_service_id).body['vpnservice'] | ||
new(vpn_service) | ||
end | ||
rescue Fog::Network::OpenStack::NotFound | ||
nil | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.