Skip to content

Commit

Permalink
Merge pull request #102 from yunify/add-docs
Browse files Browse the repository at this point in the history
Add docs
  • Loading branch information
runzexia authored Nov 29, 2017
2 parents 185e505 + 9f359a5 commit d1e73a6
Show file tree
Hide file tree
Showing 49 changed files with 1,190 additions and 127 deletions.
5 changes: 5 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Code of Conduct

HashiCorp Community Guidelines apply to you when interacting with the community here on GitHub and contributing code.

Please read the full text at https://www.hashicorp.com/community-guidelines
524 changes: 524 additions & 0 deletions .github/CONTRIBUTING.md

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

### Terraform Version
Run `terraform -v` to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

### Affected Resource(s)
Please list the resources as a list, for example:
- opc_instance
- opc_storage_volume

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

### Terraform Configuration Files
```hcl
# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.
```

### Debug Output
Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

### Panic Output
If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the `crash.log`.

### Expected Behavior
What should have happened?

### Actual Behavior
What actually happened?

### Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
1. `terraform apply`

### Important Factoids
Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?

### References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
- GH-1234
5 changes: 5 additions & 0 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Support

Terraform is a mature project with a growing community. There are active, dedicated people willing to help you through various mediums.

Take a look at those mediums listed at https://www.terraform.io/community.html
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## 0.1.0 (November 29, 2017)
FEATURES:

* **New Resource**: `qingcloud_eip` ([#21](https://github.com/yunify/terraform-provider-qingcloud/issues/21))
* **New Resource**: `qingcloud_tag` ([#24](https://github.com/yunify/terraform-provider-qingcloud/issues/24))
* **New Resource**: `qingcloud_security_group` ([#27](https://github.com/yunify/terraform-provider-qingcloud/issues/27))
* **New Resource**: `qingcloud_security_group_rule` ([#30](https://github.com/yunify/terraform-provider-qingcloud/issues/30))
* **New Resource**: `qingcloud_keypair` ([#31](https://github.com/yunify/terraform-provider-qingcloud/issues/31))
* **New Resource**: `qingcloud_vpc` ([#67](https://github.com/yunify/terraform-provider-qingcloud/issues/67))
* **New Resource**: `qingcloud_instance` ([#70](https://github.com/yunify/terraform-provider-qingcloud/issues/70))
* **New Resource**: `qingcloud_vxnet` ([#72](https://github.com/yunify/terraform-provider-qingcloud/issues/72))
* **New Resource**: `qingcloud_volume` ([#75](https://github.com/yunify/terraform-provider-qingcloud/issues/75))
* **New Resource**: `qingcloud_vpc_static` ([#98](https://github.com/yunify/terraform-provider-qingcloud/issues/98))

22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,25 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

The MIT License (MIT)

Copyright (c) 2017 yunify

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@


Terraform-Qingcloud-Plugin [![Build Status](https://travis-ci.org/yunify/terraform-provider-qingcloud.svg?branch=master)](https://travis-ci.org/yunify/terraform-provider-qingcloud)

[![codebeat badge](https://codebeat.co/badges/4559529b-cb96-4120-a489-30ca998c3790)](https://codebeat.co/projects/github-com-yunify-terraform-provider-qingcloud-master)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.jparrowsec.cn%2Fyunify%2Fterraform-provider-qingcloud.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.jparrowsec.cn%2Fyunify%2Fterraform-provider-qingcloud?ref=badge_shield)

## Usage

Expand Down
27 changes: 12 additions & 15 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
// +-------------------------------------------------------------------------
// | Copyright (C) 2017 Yunify, Inc.
// +-------------------------------------------------------------------------
// | Licensed under the Apache License, Version 2.0 (the "License");
// | you may not use this work except in compliance with the License.
// | You may obtain a copy of the License in the LICENSE file, or 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.
// +-------------------------------------------------------------------------
/**
* Copyright (c) 2016 Magicshui
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Copyright (c) 2017 yunify
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package main

Expand Down
13 changes: 13 additions & 0 deletions qingcloud/config.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* Copyright (c) 2016 Magicshui
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Copyright (c) 2017 yunify
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package qingcloud

import (
Expand Down
22 changes: 13 additions & 9 deletions qingcloud/constants.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* Copyright (c) 2016 Magicshui
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Copyright (c) 2017 yunify
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package qingcloud

const (
Expand All @@ -8,15 +21,6 @@ const (
qingcloudResourceTypeVxNet = "vxnet"
qingcloudResourceTypeEIP = "eip"
qingcloudResourceTypeRouter = "router"
qingcloudResourceTypeLoadBalancer = "loadbalancer"
qingcloudResourceTypeS2Server = "s2_server"
qingcloudResourceTypeSnapshot = "snapshot"
qingcloudResourceTypeRDB = "rdb"
qingcloudResourceTypeMongo = "mongo"
qingcloudResourceTypeCache = "cache"
qingcloudResourceTypeZookeeper = "zookeeper"
qingcloudResourceTypeQueue = "queue"
qingcloudResourceTypeSpark = "spark"

DEFAULT_ZONE = "pek3a"

Expand Down
13 changes: 13 additions & 0 deletions qingcloud/doc.go
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
/**
* Copyright (c) 2016 Magicshui
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Copyright (c) 2017 yunify
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package qingcloud
13 changes: 13 additions & 0 deletions qingcloud/errors.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* Copyright (c) 2016 Magicshui
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Copyright (c) 2017 yunify
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package qingcloud

const SERVERBUSY = 5100
16 changes: 13 additions & 3 deletions qingcloud/provider.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
/**
* Copyright (c) 2016 Magicshui
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Copyright (c) 2017 yunify
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package qingcloud

import (
"os"

"github.com/hashicorp/terraform/helper/mutexkv"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/terraform"
)
Expand Down Expand Up @@ -43,8 +55,6 @@ func Provider() terraform.ResourceProvider {
}
}

var qingcloudMutexKV = mutexkv.NewMutexKV()

func providerConfigure(d *schema.ResourceData) (interface{}, error) {
accesskey, ok := d.GetOk("access_key")
if !ok {
Expand Down
13 changes: 13 additions & 0 deletions qingcloud/provider_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* Copyright (c) 2016 Magicshui
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Copyright (c) 2017 yunify
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package qingcloud

import (
Expand Down
13 changes: 13 additions & 0 deletions qingcloud/resource_help.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* Copyright (c) 2016 Magicshui
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Copyright (c) 2017 yunify
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package qingcloud

import (
Expand Down
13 changes: 13 additions & 0 deletions qingcloud/resource_help_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* Copyright (c) 2016 Magicshui
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Copyright (c) 2017 yunify
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package qingcloud

import (
Expand Down
14 changes: 13 additions & 1 deletion qingcloud/resource_qingcloud_eip.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* Copyright (c) 2016 Magicshui
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Copyright (c) 2017 yunify
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package qingcloud

import (
Expand Down Expand Up @@ -111,7 +124,6 @@ func resourceQingcloudEipRead(d *schema.ResourceData, meta interface{}) error {
d.Set(resourceEipBandwidth, qc.IntValue(ip.Bandwidth))
d.Set(resourceEipNeedIcp, qc.IntValue(ip.NeedICP))
d.Set(resourceDescription, qc.StringValue(ip.Description))
// 如下状态是稍等来获取的
d.Set(resourceEipAddr, qc.StringValue(ip.EIPAddr))
if err := d.Set(resourceEipResource, getEIPResourceMap(ip)); err != nil {
return fmt.Errorf("Error set eip resource %v", err)
Expand Down
13 changes: 13 additions & 0 deletions qingcloud/resource_qingcloud_eip_help.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* Copyright (c) 2016 Magicshui
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Copyright (c) 2017 yunify
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package qingcloud

import (
Expand Down
13 changes: 13 additions & 0 deletions qingcloud/resource_qingcloud_eip_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* Copyright (c) 2016 Magicshui
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Copyright (c) 2017 yunify
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package qingcloud

import (
Expand Down
Loading

0 comments on commit d1e73a6

Please sign in to comment.