You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
321 lines
7.3 KiB
321 lines
7.3 KiB
/*
|
|
Copyright (c) 2019-2022 Digital Energy Cloud Solutions LLC. All Rights Reserved.
|
|
Authors:
|
|
Petr Krutov, <petr.krutov@digitalenergy.online>
|
|
Stanislav Solovev, <spsolovev@digitalenergy.online>
|
|
|
|
Licensed 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.
|
|
*/
|
|
|
|
/*
|
|
Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
|
|
Orchestration Technology) with Terraform by Hashicorp.
|
|
|
|
Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
|
|
|
|
Please see README.md to learn where to place source code so that it
|
|
builds seamlessly.
|
|
|
|
Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
|
|
*/
|
|
|
|
package account
|
|
|
|
import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
|
|
|
func resourceAccountSchemaMake() map[string]*schema.Schema {
|
|
return map[string]*schema.Schema{
|
|
"account_name": {
|
|
Type: schema.TypeString,
|
|
Required: true,
|
|
Description: "account name",
|
|
},
|
|
"username": {
|
|
Type: schema.TypeString,
|
|
Required: true,
|
|
Description: "username of owner the account",
|
|
},
|
|
"emailaddress": {
|
|
Type: schema.TypeString,
|
|
Optional: true,
|
|
Description: "email",
|
|
},
|
|
"send_access_emails": {
|
|
Type: schema.TypeBool,
|
|
Optional: true,
|
|
Default: true,
|
|
Description: "if true send emails when a user is granted access to resources",
|
|
},
|
|
"users": {
|
|
Type: schema.TypeList,
|
|
Optional: true,
|
|
Elem: &schema.Resource{
|
|
Schema: map[string]*schema.Schema{
|
|
"user_id": {
|
|
Type: schema.TypeString,
|
|
Required: true,
|
|
},
|
|
"access_type": {
|
|
Type: schema.TypeString,
|
|
Required: true,
|
|
},
|
|
"recursive_delete": {
|
|
Type: schema.TypeBool,
|
|
Optional: true,
|
|
Default: false,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"restore": {
|
|
Type: schema.TypeBool,
|
|
Optional: true,
|
|
Description: "restore a deleted account",
|
|
},
|
|
"permanently": {
|
|
Type: schema.TypeBool,
|
|
Optional: true,
|
|
Default: false,
|
|
Description: "whether to completely delete the account",
|
|
},
|
|
"enable": {
|
|
Type: schema.TypeBool,
|
|
Optional: true,
|
|
Description: "enable/disable account",
|
|
},
|
|
"resource_limits": {
|
|
Type: schema.TypeList,
|
|
Optional: true,
|
|
Computed: true,
|
|
MaxItems: 1,
|
|
Elem: &schema.Resource{
|
|
Schema: map[string]*schema.Schema{
|
|
"cu_c": {
|
|
Type: schema.TypeFloat,
|
|
Optional: true,
|
|
Computed: true,
|
|
},
|
|
"cu_d": {
|
|
Type: schema.TypeFloat,
|
|
Optional: true,
|
|
Computed: true,
|
|
},
|
|
"cu_i": {
|
|
Type: schema.TypeFloat,
|
|
Optional: true,
|
|
Computed: true,
|
|
},
|
|
"cu_m": {
|
|
Type: schema.TypeFloat,
|
|
Optional: true,
|
|
Computed: true,
|
|
},
|
|
"cu_np": {
|
|
Type: schema.TypeFloat,
|
|
Optional: true,
|
|
Computed: true,
|
|
},
|
|
"gpu_units": {
|
|
Type: schema.TypeFloat,
|
|
Optional: true,
|
|
Computed: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"account_id": {
|
|
Type: schema.TypeInt,
|
|
Optional: true,
|
|
Computed: true,
|
|
},
|
|
"dc_location": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"resources": {
|
|
Type: schema.TypeList,
|
|
Computed: true,
|
|
Elem: &schema.Resource{
|
|
Schema: map[string]*schema.Schema{
|
|
"current": {
|
|
Type: schema.TypeList,
|
|
Computed: true,
|
|
Elem: &schema.Resource{
|
|
Schema: map[string]*schema.Schema{
|
|
"cpu": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"disksize": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"extips": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"exttraffic": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"gpu": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"ram": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"reserved": {
|
|
Type: schema.TypeList,
|
|
Computed: true,
|
|
Elem: &schema.Resource{
|
|
Schema: map[string]*schema.Schema{
|
|
"cpu": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"disksize": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"extips": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"exttraffic": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"gpu": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"ram": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"ckey": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
// "meta": {
|
|
// Type: schema.TypeList,
|
|
// Computed: true,
|
|
// Elem: &schema.Schema{
|
|
// Type: schema.TypeString,
|
|
// },
|
|
// },
|
|
"acl": {
|
|
Type: schema.TypeList,
|
|
Computed: true,
|
|
Elem: &schema.Resource{
|
|
Schema: map[string]*schema.Schema{
|
|
"explicit": {
|
|
Type: schema.TypeBool,
|
|
Computed: true,
|
|
},
|
|
"guid": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"right": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"status": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"type": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"user_group_id": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"company": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"companyurl": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"created_by": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"created_time": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"deactivation_time": {
|
|
Type: schema.TypeFloat,
|
|
Computed: true,
|
|
},
|
|
"deleted_by": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"deleted_time": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"displayname": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"guid": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
// "service_account": {
|
|
// Type: schema.TypeBool,
|
|
// Computed: true,
|
|
// },
|
|
"status": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"updated_time": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"version": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"vins": {
|
|
Type: schema.TypeList,
|
|
Computed: true,
|
|
Elem: &schema.Schema{
|
|
Type: schema.TypeInt,
|
|
},
|
|
},
|
|
}
|
|
}
|