Documentation ¶
Overview ¶
Package agentTokens provides the implementation of the Entitle Agent Token data source for Terraform. This data source allows Terraform to query information about Agent Tokens from the Entitle API.
Package agentTokens provides the implementation of the Entitle Agent Token resource for Terraform. It defines the resource type, its schema, and the CRUD operations for managing Agent Tokens.
Index ¶
- func NewAgentTokenDataSource() datasource.DataSource
- func NewAgentTokenResource() resource.Resource
- type AgentTokenDataSource
- func (d *AgentTokenDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, ...)
- func (d *AgentTokenDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, ...)
- func (d *AgentTokenDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *AgentTokenDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, ...)
- type AgentTokenDataSourceModel
- type AgentTokenResource
- func (r *AgentTokenResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *AgentTokenResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *AgentTokenResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *AgentTokenResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *AgentTokenResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *AgentTokenResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *AgentTokenResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *AgentTokenResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type AgentTokenResourceModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAgentTokenDataSource ¶
func NewAgentTokenDataSource() datasource.DataSource
NewAgentTokenDataSource creates a new instance of AgentTokenDataSource.
func NewAgentTokenResource ¶
NewAgentTokenResource creates a new instance of the AgentTokenResource.
Types ¶
type AgentTokenDataSource ¶
type AgentTokenDataSource struct {
// contains filtered or unexported fields
}
AgentTokenDataSource defines the implementation of the data source.
func (*AgentTokenDataSource) Configure ¶
func (d *AgentTokenDataSource) Configure( ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse, )
Configure configures the data source with the provided client.
func (*AgentTokenDataSource) Metadata ¶
func (d *AgentTokenDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata sets the metadata for the data source.
func (*AgentTokenDataSource) Read ¶
func (d *AgentTokenDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
Read retrieves data from the Entitle API and populates the data source state. This function is responsible for fetching details about an Agent Token from the Entitle API based on the provided Terraform configuration. It reads the configuration data into a model, sends a request to the Entitle API, and processes the API response. The retrieved data is then saved into Terraform state for further use in the Terraform plan.
func (*AgentTokenDataSource) Schema ¶
func (d *AgentTokenDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse)
Schema sets the schema for the data source.
type AgentTokenDataSourceModel ¶
type AgentTokenDataSourceModel struct { ID types.String `tfsdk:"id"` Name types.String `tfsdk:"name"` }
AgentTokenDataSourceModel describes the data source data model.
type AgentTokenResource ¶
type AgentTokenResource struct {
// contains filtered or unexported fields
}
AgentTokenResource defines the resource implementation.
func (*AgentTokenResource) Configure ¶
func (r *AgentTokenResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure configures the resource with the provided client.
func (*AgentTokenResource) Create ¶
func (r *AgentTokenResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
Create handles the creation of a new resource of type Entitle AgentToken.
It reads the Terraform plan data, maps it to the AgentTokenResourceModel, sends a request to the Entitle API to create the resource, and saves the resource's data into Terraform state.
func (*AgentTokenResource) Delete ¶
func (r *AgentTokenResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
Delete is responsible for deleting an existing resource of type Entitle AgentToken.
It reads the resource's data from Terraform state, extracts the unique identifier, and sends a request to delete the resource using API requests. If the deletion is successful, it removes the resource from Terraform state.
func (*AgentTokenResource) ImportState ¶
func (r *AgentTokenResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState is used to import an existing resource's state into Terraform.
It extracts the resource's identifier from the import request and sets it in Terraform state using resource.ImportStatePassthroughID.
func (*AgentTokenResource) Metadata ¶
func (r *AgentTokenResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata sets the metadata for the resource.
func (*AgentTokenResource) Read ¶
func (r *AgentTokenResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
Read retrieves an existing resource of type Entitle AgentToken.
It retrieves the resource's data from the provider API requests, maps it to the AgentTokenResourceModel, and saves the data to Terraform state.
func (*AgentTokenResource) Schema ¶
func (r *AgentTokenResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
Schema sets the schema for the resource.
func (*AgentTokenResource) Update ¶
func (r *AgentTokenResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
Update handles updates to an existing resource of type Entitle AgentToken.
It reads the updated Terraform plan data, sends a request to the Entitle API to update the resource, and saves the updated resource data into Terraform state.