-
Notifications
You must be signed in to change notification settings - Fork 63
Adding new data sources to cloudstack-terraform-proivder #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
7229481
create ssh keypair data-source
Damans227 3728391
create a method stub for instance data-source
Damans227 eec69c8
extending instance data-source to use its id as an input
Damans227 f6bf228
use SetId() to define the ID of the instance resource
Damans227 1c9dfbb
implement filters to allow filtering off of any exported attributes
Damans227 99ffd71
add ip-address to schema and allow filtering off of it
Damans227 7ea2d60
create a method stub to acceptance test the instance data-source
Damans227 c4f18cc
basic acceptance test for instance data-source passing
Damans227 0244431
adding comments to improve the readability of code
Damans227 49a279d
add basic acceptance test for ssh keypair data-source
Damans227 2cff5eb
create network offering resource
Damans227 f4d6d3e
complete network offering resource type
Damans227 10d2b8b
create network offering data source
Damans227 fcc5d60
add basic acceptance test for network offering data source
Damans227 2a36da5
create disk offering resource
Damans227 420c5f9
implement create method for disk offering resource
Damans227 1458501
create cloudstack volume resource type
Damans227 6860034
create cloudstack zone resource type
Damans227 4b06faf
create zone data source
Damans227 165ea84
add acceptance test for zone datasource
Damans227 5401174
create service offering resource
Damans227 cc3275c
create service offering data source
Damans227 a8fe27e
add service offering data source
Damans227 4ad74f1
fix typos in comments for network offering resource
Damans227 fc488e0
add volume data source
Damans227 d4ee481
add acceptance test for volume data source
Damans227 eae747c
create account resource
Damans227 c78b1fc
implement delete method in account resource
Damans227 bce3a32
fix a typo in network offering
Damans227 5015e80
create user resource
Damans227 b0f5371
create domain resource
Damans227 0ad1d96
add vpc data-source
Damans227 b406da4
add ip address data-source
Damans227 1c19867
add user data-source
Damans227 4c46983
add vpn connection data-source
Damans227 d8abde2
add acceptance test for vpc data-source
Damans227 4c1e531
add acceptance test for ipaddress data-source
Damans227 447e29f
add acceptance test for user data-source
Damans227 04aae0d
fix a typo in applyNetworkOfferingFilters method of network offering …
Damans227 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
cloudstack/data_source_cloudstack_network_offering_test.go
This file contains hidden or 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,65 @@ | ||
| // | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
| // | ||
|
|
||
| package cloudstack | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/hashicorp/terraform/helper/resource" | ||
| ) | ||
|
|
||
| func TestAccNetworkOfferingDataSource_basic(t *testing.T) { | ||
| resourceName := "cloudstack_network_offering.net-off-resource" | ||
| datasourceName := "data.cloudstack_network_offering.net-off-data-source" | ||
|
|
||
| resource.Test(t, resource.TestCase{ | ||
| PreCheck: func() { testAccPreCheck(t) }, | ||
| Providers: testAccProviders, | ||
| Steps: []resource.TestStep{ | ||
| { | ||
| Config: testNetworkOfferingDataSourceConfig_basic, | ||
| Check: resource.ComposeTestCheckFunc( | ||
| resource.TestCheckResourceAttrPair(datasourceName, "name", resourceName, "name"), | ||
| ), | ||
| ExpectNonEmptyPlan: true, | ||
| }, | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| const testNetworkOfferingDataSourceConfig_basic = ` | ||
| resource "cloudstack_network_offering" "net-off-resource"{ | ||
| name = "TestNetworkDisplay01" | ||
| display_text = "TestNetworkDisplay01" | ||
| guest_ip_type = "Isolated" | ||
| traffic_type = "Guest" | ||
| } | ||
|
|
||
| data "cloudstack_network_offering" "net-off-data-source"{ | ||
|
|
||
| filter{ | ||
| name = "name" | ||
| value="TestNetworkDisplay01" | ||
| } | ||
| depends_on = [ | ||
| cloudstack_network_offering.net-off-resource | ||
| ] | ||
| } | ||
| ` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.