Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToPascalCase ¶
ToPascalCase converts a string to PascalCase.
Types ¶
type CRUDOperationsMap ¶
type CRUDOperationsMap struct { // C represents the POST (create) endpoint. C *string `json:"c,omitempty"` // R represents the GET (read) endpoint. R *string `json:"r,omitempty"` // U represents the PATCH endpoint. U *string `json:"u,omitempty"` // D represents the DELETE endpoint. D *string `json:"d,omitempty"` // P represents the PUT (overwrite/update) endpoint. P *string `json:"p,omitempty"` }
CRUDOperationsMap identifies the endpoints to perform create, read, update and delete (CRUD) operations.
type OpenAPIContext ¶
type OpenAPIContext struct { // Doc is the parsed, validated OpenAPI spec. Doc openapi3.T // Pkg is the Pulumi schema spec. Pkg *pschema.PackageSpec // ExcludedPaths is a slice of API endpoint paths // that should be skipped. ExcludedPaths []string // UseParentResourceAsModule indicates whether an endpoint // operation's parent resource should be used as the module // for a resource rather than using the root path of the // endpoint. // For example, when extracting a resource for the endpoint // `/rootResource/v1/subResource`, with this set to `true`, // the `subResource` will be under the module `subResource` // instead of `rootResource` module. This is useful to avoid // conflicts arising from properties named similarly in different // resource that are actually different despite their names. // // Another example is `rootResource/v1/subResource/{id}/secondResource`. // The resource called `secondResource` will be in a module called // `subResource` instead of a module called `rootResource`. UseParentResourceAsModule bool // OperationIdsHaveTypeSpecNamespace indicates if the API operation IDs // are separated by the CADL namespace they were defined in. OperationIdsHaveTypeSpecNamespace bool // TypeSpecNamespaceSeparator is the separator used in the operationId value. TypeSpecNamespaceSeparator string // AllowedPluralResources is a slice of resource names that should not // be converted to their singular version. AllowedPluralResources []string // contains filtered or unexported fields }
OpenAPIContext represents an OpenAPI spec from which a Pulumi package spec can be extracted.
func (*OpenAPIContext) GatherResourcesFromAPI ¶
func (o *OpenAPIContext) GatherResourcesFromAPI(csharpNamespaces map[string]string) (*ProviderMetadata, openapi3.T, error)
GatherResourcesFromAPI gathers resources from API endpoints. The goal is to extract resources and map their corresponding CRUD operations.
- The "create" operation (denoted by a Post request) determines the schema for the resource.
- The "read" operation (denoted by a Get request) determines the schema for "invokes" or "resource get's".
- The "update" operation (denoted by a Patch request) determines the schema for resource updates. The Patch request schema is used to determine which properties can be patched when changes are detected in Diff() vs. which ones will force a resource replacement.
type ProviderMetadata ¶
type ProviderMetadata struct { // ResourceToOperationMap identifies the endpoint that will // handle the CRUD for a given Pulumi resource type token. ResourceCRUDMap map[string]*CRUDOperationsMap `json:"crudMap"` // AutoNameMap is a map of resource type token and the name // property that can be auto-named by the provider. AutoNameMap map[string]string `json:"autoNameMap"` // SDKToAPINameMap is a map of a property's name in the Pulumi // schema to its actual API name. Can be nil. SDKToAPINameMap map[string]string `json:"sdkToApiNameMap"` // APIToSDKNameMap is the inverse of SDKToAPINameMap. APIToSDKNameMap map[string]string `json:"apiToSdkNameMap"` // PathParamNameMap is a map of a path param's original name to // its Pulumi schema name. Can be nil. PathParamNameMap map[string]string `json:"pathParamNameMap"` }
ProviderMetadata represents metadata used by a provider.
Click to show internal directories.
Click to hide internal directories.