Documentation ¶
Index ¶
- Variables
- func NewPageResource() resource.Resource
- func PageSchema() map[string]schema.Attribute
- func PageToPortBody(pm *PageModel) (*cli.Page, error)
- type PageModel
- type PageResource
- func (r *PageResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *PageResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *PageResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *PageResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *PageResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *PageResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *PageResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *PageResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- func (r *PageResource) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, ...)
Constants ¶
This section is empty.
Variables ¶
View Source
var PageResourceMarkdownDescription = `
# Page resource
Docs about the different page types can be found [here](https://docs.getport.io/customize-pages-dashboards-and-plugins/page/catalog-page).
~> **WARNING**
The page resource is currently in beta and is subject to change in future versions.
Use it by setting the Environment Variable ` + "`PORT_BETA_FEATURES_ENABLED=true`" + `.
If this Environment Variable isn't specified, you won't be able to use the resource.
## Example Usage
### Blueprint Entities Page
` + "```hcl" + `
resource "port_page" "microservice_blueprint_page" {
identifier = "microservice_blueprint_page"
title = "Microservices"
type = "blueprint-entities"
icon = "Microservice"
blueprint = port_blueprint.base_blueprint.identifier
widgets = [
jsonencode(
{
"id" : "microservice-table-entities",
"type" : "table-entities-explorer",
"dataset" : {
"combinator" : "and",
"rules" : [
{
"operator" : "=",
"property" : "$blueprint",
"value" : ` + "{{`\"{{blueprint}}\"`}}" + `
}
]
}
}
)
]
}
` + "```" + `
### Dashboard Page
` + "```hcl" + `
resource "port_page" "microservice_dashboard_page" {
identifier = "microservice_dashboard_page"
title = "Microservices"
icon = "GitHub"
type = "dashboard"
widgets = [
jsonencode(
{
"id" : "dashboardWidget",
"layout" : [
{
"height" : 400,
"columns" : [
{
"id" : "microserviceGuide",
"size" : 12
}
]
}
],
"type" : "dashboard-widget",
"widgets" : [
{
"title" : "Microservices Guide",
"icon" : "BlankPage",
"markdown" : "# This is the new Microservice Dashboard",
"type" : "markdown",
"description" : "",
"id" : "microserviceGuide"
}
],
}
)
]
}
` + "```" + `
### Page with parent
Create a page inside a folder.
` + "```hcl" + `
resource "port_page" "microservice_dashboard_page" {
identifier = "microservice_dashboard_page"
title = "Microservices"
icon = "GitHub"
type = "dashboard"
parent = "microservices-folder"
widgets = [
jsonencode(
{
"id" : "dashboardWidget",
"layout" : [
{
"height" : 400,
"columns" : [
{
"id" : "microserviceGuide",
"size" : 12
}
]
}
],
"type" : "dashboard-widget",
"widgets" : [
{
"title" : "Microservices Guide",
"icon" : "BlankPage",
"markdown" : "# This is the new Microservice Dashboard",
"type" : "markdown",
"description" : "",
"id" : "microserviceGuide"
}
],
}
)
]
}
` + "```" + `
### Page with after
Create a page after another page.
` + "```hcl" + `
resource "port_page" "microservice_dashboard_page" {
identifier = "microservice_dashboard_page"
title = "Microservices"
icon = "GitHub"
type = "dashboard"
after = "microservices_entities_page"
widgets = [
jsonencode(
{
"id" : "dashboardWidget",
"layout" : [
{
"height" : 400,
"columns" : [
{
"id" : "microserviceGuide",
"size" : 12
}
]
}
],
"type" : "dashboard-widget",
"widgets" : [
{
"title" : "Microservices Guide",
"icon" : "BlankPage",
"markdown" : "# This is the new Microservice Dashboard",
"type" : "markdown",
"description" : "",
"id" : "microserviceGuide"
}
],
}
)
]
}
` + "```" + `
### Home Page
` + "```hcl" + `
resource "port_page" "home_page" {
identifier = "$home"
title = "Home"
type = "home"
widgets = [
jsonencode(
{
"type" : "dashboard-widget",
"id" : "azkLJD6wLk6nJSvA",
"layout" : [
{
"columns" : [
{
"id" : "markdown",
"size" : 6
},
{
"id" : "overview",
"size" : 6
},
],
"height" : 648
}
],
"widgets" : [
{
"type" : "markdown",
"markdown" : "## Welcome to your internal developer portal",
"icon" : "port",
"title" : "About developer Portal",
"id" : "markdown"
},
{
"type" : "iframe-widget",
"id" : "overview",
"title" : "Overview",
"icon" : "Docs",
"url" : "https://www.youtube.com/embed/ggXL2ZsPVQM?si=xj6XtV0faatoOhss",
"urlType" : "public"
}
]
}
)
]
}
` + "```" + `
The home page is a special page, which is created by default when you create a new organization.
- When deleting the home page resource using terraform, the home page will not be deleted from Port as it isn't deletable page, instead, the home page will be removed from the terraform state.
- Due to only having one home page you'll have to import the state of the home page manually.
` + "```" + `
terraform import port_page.home_page "\$home"
` + "```" + `
`
Functions ¶
func NewPageResource ¶
func PageSchema ¶
Types ¶
type PageModel ¶
type PageModel struct { ID types.String `tfsdk:"id"` Identifier types.String `tfsdk:"identifier"` Title types.String `tfsdk:"title"` Type types.String `tfsdk:"type"` Parent types.String `tfsdk:"parent"` After types.String `tfsdk:"after"` Icon types.String `tfsdk:"icon"` Locked types.Bool `tfsdk:"locked"` Blueprint types.String `tfsdk:"blueprint"` Widgets []types.String `tfsdk:"widgets"` CreatedAt types.String `tfsdk:"created_at"` CreatedBy types.String `tfsdk:"created_by"` UpdatedAt types.String `tfsdk:"updated_at"` UpdatedBy types.String `tfsdk:"updated_by"` }
type PageResource ¶
type PageResource struct {
// contains filtered or unexported fields
}
func (*PageResource) Configure ¶
func (r *PageResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*PageResource) Create ¶
func (r *PageResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*PageResource) Delete ¶
func (r *PageResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (*PageResource) ImportState ¶
func (r *PageResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
func (*PageResource) Metadata ¶
func (r *PageResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*PageResource) Read ¶
func (r *PageResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (*PageResource) Schema ¶
func (r *PageResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
func (*PageResource) Update ¶
func (r *PageResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
func (*PageResource) ValidateConfig ¶
func (r *PageResource) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, resp *resource.ValidateConfigResponse)
Click to show internal directories.
Click to hide internal directories.