cpts

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PkgVersion added in v0.0.2

func PkgVersion() (semver.Version, error)

PkgVersion uses reflection to determine the version of the current package. If a version cannot be determined, v1 will be assumed. The second return value is always nil.

Types

type Project

type Project struct {
	pulumi.CustomResourceState

	// The creation time, in UTC format.
	CreatedAt pulumi.StringOutput `pulumi:"createdAt"`
	// Specifies the description of the project, which can contain a maximum of
	// 50 characters.
	Description pulumi.StringPtrOutput `pulumi:"description"`
	// Specifies a name for the project, which can contain a maximum of 42 characters.
	Name pulumi.StringOutput `pulumi:"name"`
	// Specifies the region in which to create the project resource. If omitted, the
	// provider-level region will be used. Changing this parameter will create a new resource.
	Region pulumi.StringOutput `pulumi:"region"`
	// The last update time, in UTC format.
	UpdatedAt pulumi.StringOutput `pulumi:"updatedAt"`
}

Manages a project resource within HuaweiCloud CPTS.

## Example Usage

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Cpts"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Cpts.NewProject(ctx, "test", &Cpts.ProjectArgs{
			Description: pulumi.String("cpts project description"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

Projects can be imported using the `id`, e.g.

```sh

$ pulumi import huaweicloud:Cpts/project:Project test 1090

```

func GetProject

func GetProject(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *ProjectState, opts ...pulumi.ResourceOption) (*Project, error)

GetProject gets an existing Project resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewProject

func NewProject(ctx *pulumi.Context,
	name string, args *ProjectArgs, opts ...pulumi.ResourceOption) (*Project, error)

NewProject registers a new resource with the given unique name, arguments, and options.

func (*Project) ElementType

func (*Project) ElementType() reflect.Type

func (*Project) ToProjectOutput

func (i *Project) ToProjectOutput() ProjectOutput

func (*Project) ToProjectOutputWithContext

func (i *Project) ToProjectOutputWithContext(ctx context.Context) ProjectOutput

type ProjectArgs

type ProjectArgs struct {
	// Specifies the description of the project, which can contain a maximum of
	// 50 characters.
	Description pulumi.StringPtrInput
	// Specifies a name for the project, which can contain a maximum of 42 characters.
	Name pulumi.StringPtrInput
	// Specifies the region in which to create the project resource. If omitted, the
	// provider-level region will be used. Changing this parameter will create a new resource.
	Region pulumi.StringPtrInput
}

The set of arguments for constructing a Project resource.

func (ProjectArgs) ElementType

func (ProjectArgs) ElementType() reflect.Type

type ProjectArray

type ProjectArray []ProjectInput

func (ProjectArray) ElementType

func (ProjectArray) ElementType() reflect.Type

func (ProjectArray) ToProjectArrayOutput

func (i ProjectArray) ToProjectArrayOutput() ProjectArrayOutput

func (ProjectArray) ToProjectArrayOutputWithContext

func (i ProjectArray) ToProjectArrayOutputWithContext(ctx context.Context) ProjectArrayOutput

type ProjectArrayInput

type ProjectArrayInput interface {
	pulumi.Input

	ToProjectArrayOutput() ProjectArrayOutput
	ToProjectArrayOutputWithContext(context.Context) ProjectArrayOutput
}

ProjectArrayInput is an input type that accepts ProjectArray and ProjectArrayOutput values. You can construct a concrete instance of `ProjectArrayInput` via:

ProjectArray{ ProjectArgs{...} }

type ProjectArrayOutput

type ProjectArrayOutput struct{ *pulumi.OutputState }

func (ProjectArrayOutput) ElementType

func (ProjectArrayOutput) ElementType() reflect.Type

func (ProjectArrayOutput) Index

func (ProjectArrayOutput) ToProjectArrayOutput

func (o ProjectArrayOutput) ToProjectArrayOutput() ProjectArrayOutput

func (ProjectArrayOutput) ToProjectArrayOutputWithContext

func (o ProjectArrayOutput) ToProjectArrayOutputWithContext(ctx context.Context) ProjectArrayOutput

type ProjectInput

type ProjectInput interface {
	pulumi.Input

	ToProjectOutput() ProjectOutput
	ToProjectOutputWithContext(ctx context.Context) ProjectOutput
}

type ProjectMap

type ProjectMap map[string]ProjectInput

func (ProjectMap) ElementType

func (ProjectMap) ElementType() reflect.Type

func (ProjectMap) ToProjectMapOutput

func (i ProjectMap) ToProjectMapOutput() ProjectMapOutput

func (ProjectMap) ToProjectMapOutputWithContext

func (i ProjectMap) ToProjectMapOutputWithContext(ctx context.Context) ProjectMapOutput

type ProjectMapInput

type ProjectMapInput interface {
	pulumi.Input

	ToProjectMapOutput() ProjectMapOutput
	ToProjectMapOutputWithContext(context.Context) ProjectMapOutput
}

ProjectMapInput is an input type that accepts ProjectMap and ProjectMapOutput values. You can construct a concrete instance of `ProjectMapInput` via:

ProjectMap{ "key": ProjectArgs{...} }

type ProjectMapOutput

type ProjectMapOutput struct{ *pulumi.OutputState }

func (ProjectMapOutput) ElementType

func (ProjectMapOutput) ElementType() reflect.Type

func (ProjectMapOutput) MapIndex

func (ProjectMapOutput) ToProjectMapOutput

func (o ProjectMapOutput) ToProjectMapOutput() ProjectMapOutput

func (ProjectMapOutput) ToProjectMapOutputWithContext

func (o ProjectMapOutput) ToProjectMapOutputWithContext(ctx context.Context) ProjectMapOutput

type ProjectOutput

type ProjectOutput struct{ *pulumi.OutputState }

func (ProjectOutput) CreatedAt

func (o ProjectOutput) CreatedAt() pulumi.StringOutput

The creation time, in UTC format.

func (ProjectOutput) Description

func (o ProjectOutput) Description() pulumi.StringPtrOutput

Specifies the description of the project, which can contain a maximum of 50 characters.

func (ProjectOutput) ElementType

func (ProjectOutput) ElementType() reflect.Type

func (ProjectOutput) Name

Specifies a name for the project, which can contain a maximum of 42 characters.

func (ProjectOutput) Region

func (o ProjectOutput) Region() pulumi.StringOutput

Specifies the region in which to create the project resource. If omitted, the provider-level region will be used. Changing this parameter will create a new resource.

func (ProjectOutput) ToProjectOutput

func (o ProjectOutput) ToProjectOutput() ProjectOutput

func (ProjectOutput) ToProjectOutputWithContext

func (o ProjectOutput) ToProjectOutputWithContext(ctx context.Context) ProjectOutput

func (ProjectOutput) UpdatedAt

func (o ProjectOutput) UpdatedAt() pulumi.StringOutput

The last update time, in UTC format.

type ProjectState

type ProjectState struct {
	// The creation time, in UTC format.
	CreatedAt pulumi.StringPtrInput
	// Specifies the description of the project, which can contain a maximum of
	// 50 characters.
	Description pulumi.StringPtrInput
	// Specifies a name for the project, which can contain a maximum of 42 characters.
	Name pulumi.StringPtrInput
	// Specifies the region in which to create the project resource. If omitted, the
	// provider-level region will be used. Changing this parameter will create a new resource.
	Region pulumi.StringPtrInput
	// The last update time, in UTC format.
	UpdatedAt pulumi.StringPtrInput
}

func (ProjectState) ElementType

func (ProjectState) ElementType() reflect.Type

type Task

type Task struct {
	pulumi.CustomResourceState

	// Specifies benchmark concurrency of the task, the value range is 0 to
	// 2000000. The default value is `100`. Reference for the calculation of the number of concurrent users.
	// `Number of concurrent users` = `benchmark concurrency` * `concurrency ratio`.
	BenchmarkConcurrency pulumi.IntPtrOutput `pulumi:"benchmarkConcurrency"`
	// Specifies a cluster ID of the CPTS resource group. If the number of concurrent users
	// is less than 1000, you can use a shared resource group for testing and do not have to create a resource group.
	ClusterId pulumi.IntPtrOutput `pulumi:"clusterId"`
	// Specifies the name of the task, which can contain a maximum of 42 characters.
	Name pulumi.StringOutput `pulumi:"name"`
	// Specifies whether to enable the task or stop the task. The options are as follows:
	// + **enable**: Starting the pressure test task.
	// + **stop**: Stop the pressure test tasks.
	Operation pulumi.StringPtrOutput `pulumi:"operation"`
	// Specifies the CPTS project ID which the task belongs to.
	// Changing this parameter will create a new resource.
	ProjectId pulumi.IntOutput `pulumi:"projectId"`
	// Specifies the region in which to create the task resource. If omitted, the
	// provider-level region will be used. Changing this parameter will create a new resource.
	Region pulumi.StringOutput `pulumi:"region"`
	// The status of the task. The options are as follows:
	// + **0**: The task is running.
	// + **2**: The task is idle.
	Status pulumi.IntOutput `pulumi:"status"`
}

Manages a pressure Test Task resource within HuaweiCloud CPTS. The task resource only supports serial execution mode.

## Example Usage

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Cpts"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		testProject, err := Cpts.NewProject(ctx, "testProject", nil)
		if err != nil {
			return err
		}
		_, err = Cpts.NewTask(ctx, "testTask", &Cpts.TaskArgs{
			ProjectId: testProject.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

Tasks can be imported using the `id`, e.g.

```sh

$ pulumi import huaweicloud:Cpts/task:Task test 1090

```

Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`operation`. It is generally recommended running `terraform plan` after importing an instance. You can then decide if changes should be applied to the instance, or the resource definition should be updated to align with the instance. Also you can ignore changes as below. resource "huaweicloud_cpts_task" "test" {

...

lifecycle {

ignore_changes = [

operation,

]

} }

func GetTask

func GetTask(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *TaskState, opts ...pulumi.ResourceOption) (*Task, error)

GetTask gets an existing Task resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewTask

func NewTask(ctx *pulumi.Context,
	name string, args *TaskArgs, opts ...pulumi.ResourceOption) (*Task, error)

NewTask registers a new resource with the given unique name, arguments, and options.

func (*Task) ElementType

func (*Task) ElementType() reflect.Type

func (*Task) ToTaskOutput

func (i *Task) ToTaskOutput() TaskOutput

func (*Task) ToTaskOutputWithContext

func (i *Task) ToTaskOutputWithContext(ctx context.Context) TaskOutput

type TaskArgs

type TaskArgs struct {
	// Specifies benchmark concurrency of the task, the value range is 0 to
	// 2000000. The default value is `100`. Reference for the calculation of the number of concurrent users.
	// `Number of concurrent users` = `benchmark concurrency` * `concurrency ratio`.
	BenchmarkConcurrency pulumi.IntPtrInput
	// Specifies a cluster ID of the CPTS resource group. If the number of concurrent users
	// is less than 1000, you can use a shared resource group for testing and do not have to create a resource group.
	ClusterId pulumi.IntPtrInput
	// Specifies the name of the task, which can contain a maximum of 42 characters.
	Name pulumi.StringPtrInput
	// Specifies whether to enable the task or stop the task. The options are as follows:
	// + **enable**: Starting the pressure test task.
	// + **stop**: Stop the pressure test tasks.
	Operation pulumi.StringPtrInput
	// Specifies the CPTS project ID which the task belongs to.
	// Changing this parameter will create a new resource.
	ProjectId pulumi.IntInput
	// Specifies the region in which to create the task resource. If omitted, the
	// provider-level region will be used. Changing this parameter will create a new resource.
	Region pulumi.StringPtrInput
}

The set of arguments for constructing a Task resource.

func (TaskArgs) ElementType

func (TaskArgs) ElementType() reflect.Type

type TaskArray

type TaskArray []TaskInput

func (TaskArray) ElementType

func (TaskArray) ElementType() reflect.Type

func (TaskArray) ToTaskArrayOutput

func (i TaskArray) ToTaskArrayOutput() TaskArrayOutput

func (TaskArray) ToTaskArrayOutputWithContext

func (i TaskArray) ToTaskArrayOutputWithContext(ctx context.Context) TaskArrayOutput

type TaskArrayInput

type TaskArrayInput interface {
	pulumi.Input

	ToTaskArrayOutput() TaskArrayOutput
	ToTaskArrayOutputWithContext(context.Context) TaskArrayOutput
}

TaskArrayInput is an input type that accepts TaskArray and TaskArrayOutput values. You can construct a concrete instance of `TaskArrayInput` via:

TaskArray{ TaskArgs{...} }

type TaskArrayOutput

type TaskArrayOutput struct{ *pulumi.OutputState }

func (TaskArrayOutput) ElementType

func (TaskArrayOutput) ElementType() reflect.Type

func (TaskArrayOutput) Index

func (TaskArrayOutput) ToTaskArrayOutput

func (o TaskArrayOutput) ToTaskArrayOutput() TaskArrayOutput

func (TaskArrayOutput) ToTaskArrayOutputWithContext

func (o TaskArrayOutput) ToTaskArrayOutputWithContext(ctx context.Context) TaskArrayOutput

type TaskInput

type TaskInput interface {
	pulumi.Input

	ToTaskOutput() TaskOutput
	ToTaskOutputWithContext(ctx context.Context) TaskOutput
}

type TaskMap

type TaskMap map[string]TaskInput

func (TaskMap) ElementType

func (TaskMap) ElementType() reflect.Type

func (TaskMap) ToTaskMapOutput

func (i TaskMap) ToTaskMapOutput() TaskMapOutput

func (TaskMap) ToTaskMapOutputWithContext

func (i TaskMap) ToTaskMapOutputWithContext(ctx context.Context) TaskMapOutput

type TaskMapInput

type TaskMapInput interface {
	pulumi.Input

	ToTaskMapOutput() TaskMapOutput
	ToTaskMapOutputWithContext(context.Context) TaskMapOutput
}

TaskMapInput is an input type that accepts TaskMap and TaskMapOutput values. You can construct a concrete instance of `TaskMapInput` via:

TaskMap{ "key": TaskArgs{...} }

type TaskMapOutput

type TaskMapOutput struct{ *pulumi.OutputState }

func (TaskMapOutput) ElementType

func (TaskMapOutput) ElementType() reflect.Type

func (TaskMapOutput) MapIndex

func (TaskMapOutput) ToTaskMapOutput

func (o TaskMapOutput) ToTaskMapOutput() TaskMapOutput

func (TaskMapOutput) ToTaskMapOutputWithContext

func (o TaskMapOutput) ToTaskMapOutputWithContext(ctx context.Context) TaskMapOutput

type TaskOutput

type TaskOutput struct{ *pulumi.OutputState }

func (TaskOutput) BenchmarkConcurrency

func (o TaskOutput) BenchmarkConcurrency() pulumi.IntPtrOutput

Specifies benchmark concurrency of the task, the value range is 0 to 2000000. The default value is `100`. Reference for the calculation of the number of concurrent users. `Number of concurrent users` = `benchmark concurrency` * `concurrency ratio`.

func (TaskOutput) ClusterId

func (o TaskOutput) ClusterId() pulumi.IntPtrOutput

Specifies a cluster ID of the CPTS resource group. If the number of concurrent users is less than 1000, you can use a shared resource group for testing and do not have to create a resource group.

func (TaskOutput) ElementType

func (TaskOutput) ElementType() reflect.Type

func (TaskOutput) Name

func (o TaskOutput) Name() pulumi.StringOutput

Specifies the name of the task, which can contain a maximum of 42 characters.

func (TaskOutput) Operation

func (o TaskOutput) Operation() pulumi.StringPtrOutput

Specifies whether to enable the task or stop the task. The options are as follows: + **enable**: Starting the pressure test task. + **stop**: Stop the pressure test tasks.

func (TaskOutput) ProjectId

func (o TaskOutput) ProjectId() pulumi.IntOutput

Specifies the CPTS project ID which the task belongs to. Changing this parameter will create a new resource.

func (TaskOutput) Region

func (o TaskOutput) Region() pulumi.StringOutput

Specifies the region in which to create the task resource. If omitted, the provider-level region will be used. Changing this parameter will create a new resource.

func (TaskOutput) Status

func (o TaskOutput) Status() pulumi.IntOutput

The status of the task. The options are as follows: + **0**: The task is running. + **2**: The task is idle.

func (TaskOutput) ToTaskOutput

func (o TaskOutput) ToTaskOutput() TaskOutput

func (TaskOutput) ToTaskOutputWithContext

func (o TaskOutput) ToTaskOutputWithContext(ctx context.Context) TaskOutput

type TaskState

type TaskState struct {
	// Specifies benchmark concurrency of the task, the value range is 0 to
	// 2000000. The default value is `100`. Reference for the calculation of the number of concurrent users.
	// `Number of concurrent users` = `benchmark concurrency` * `concurrency ratio`.
	BenchmarkConcurrency pulumi.IntPtrInput
	// Specifies a cluster ID of the CPTS resource group. If the number of concurrent users
	// is less than 1000, you can use a shared resource group for testing and do not have to create a resource group.
	ClusterId pulumi.IntPtrInput
	// Specifies the name of the task, which can contain a maximum of 42 characters.
	Name pulumi.StringPtrInput
	// Specifies whether to enable the task or stop the task. The options are as follows:
	// + **enable**: Starting the pressure test task.
	// + **stop**: Stop the pressure test tasks.
	Operation pulumi.StringPtrInput
	// Specifies the CPTS project ID which the task belongs to.
	// Changing this parameter will create a new resource.
	ProjectId pulumi.IntPtrInput
	// Specifies the region in which to create the task resource. If omitted, the
	// provider-level region will be used. Changing this parameter will create a new resource.
	Region pulumi.StringPtrInput
	// The status of the task. The options are as follows:
	// + **0**: The task is running.
	// + **2**: The task is idle.
	Status pulumi.IntPtrInput
}

func (TaskState) ElementType

func (TaskState) ElementType() reflect.Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL