This page provides quick lookup tables for common Pyvider APIs. For complete documentation, see the API Reference.
๐ค AI-Generated Content
This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.
classMyResource(BaseResource):@classmethoddefget_schema(cls)->PvsSchema:"""Define the resource schema."""returns_resource({...})asyncdefread(self,ctx:ResourceContext)->State|None:"""Read current resource state from infrastructure."""passasyncdef_create_apply(self,ctx:ResourceContext)->tuple[State|None,PrivateState|None]:"""Create the resource."""passasyncdef_update_apply(self,ctx:ResourceContext)->tuple[State|None,PrivateState|None]:"""Update the resource."""passasyncdef_delete_apply(self,ctx:ResourceContext)->None:"""Delete the resource."""pass
classMyDataSource(BaseDataSource):@classmethoddefget_schema(cls)->PvsSchema:"""Define the data source schema."""returns_data_source({...})asyncdefread(self,ctx:ResourceContext)->State|None:"""Fetch data from external system."""pass
@register_function(name="my_function")classMyFunction(BaseFunction):@classmethoddefget_schema(cls)->FunctionSchema:"""Define function parameters and return type."""returnFunctionSchema(parameters=[FunctionParameter(name="input",type=a_str()),],return_type=a_str())asyncdefcall(self,ctx:FunctionContext)->Any:"""Execute the function logic."""pass
# Length validationa_str(validators=[lambdax:len(x)>=3or"Must be at least 3 characters"])# Numeric rangea_num(validators=[lambdax:1<=x<=65535or"Port must be 1-65535"])# Regex patterna_str(validators=[lambdax:bool(re.match(r'^[a-z0-9-]+$',x))or"Invalid format"])# Choice/enuma_str(validators=[lambdax:xin["small","medium","large"]or"Invalid size"])