Documentation ¶
Overview ¶
Package pricing is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterPricingHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterPricingHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PricingClient) error
- func RegisterPricingHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterPricingHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PricingServer) error
- func RegisterPricingServer(s grpc.ServiceRegistrar, srv PricingServer)
- type Attribute
- type ClientOptions
- type GetInfoRequest
- type GetInfoResponse
- type GetPricingRequest
- func (*GetPricingRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetPricingRequest) GetColumns() []string
- func (x *GetPricingRequest) GetFilters() map[string]string
- func (x *GetPricingRequest) GetRegion() string
- func (x *GetPricingRequest) GetService() string
- func (x *GetPricingRequest) GetToken() string
- func (x *GetPricingRequest) GetVendor() string
- func (*GetPricingRequest) ProtoMessage()
- func (x *GetPricingRequest) ProtoReflect() protoreflect.Message
- func (x *GetPricingRequest) Reset()
- func (x *GetPricingRequest) String() string
- type GetPricingResponse
- func (*GetPricingResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetPricingResponse) GetPricingData() []*pricing.PricingData
- func (x *GetPricingResponse) GetToken() string
- func (*GetPricingResponse) ProtoMessage()
- func (x *GetPricingResponse) ProtoReflect() protoreflect.Message
- func (x *GetPricingResponse) Reset()
- func (x *GetPricingResponse) String() string
- type GetSupportedServicesRequest
- func (*GetSupportedServicesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetSupportedServicesRequest) GetVendor() string
- func (*GetSupportedServicesRequest) ProtoMessage()
- func (x *GetSupportedServicesRequest) ProtoReflect() protoreflect.Message
- func (x *GetSupportedServicesRequest) Reset()
- func (x *GetSupportedServicesRequest) String() string
- type GetSupportedServicesResponse
- func (*GetSupportedServicesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetSupportedServicesResponse) GetSupportedServices() []*SupportedService
- func (*GetSupportedServicesResponse) ProtoMessage()
- func (x *GetSupportedServicesResponse) ProtoReflect() protoreflect.Message
- func (x *GetSupportedServicesResponse) Reset()
- func (x *GetSupportedServicesResponse) String() string
- type GrpcClient
- type PricingClient
- type PricingServer
- type SupportedService
- func (*SupportedService) Descriptor() ([]byte, []int)deprecated
- func (x *SupportedService) GetAttributes() []*Attribute
- func (x *SupportedService) GetColumns() []string
- func (x *SupportedService) GetRegions() []string
- func (x *SupportedService) GetService() string
- func (*SupportedService) ProtoMessage()
- func (x *SupportedService) ProtoReflect() protoreflect.Message
- func (x *SupportedService) Reset()
- func (x *SupportedService) String() string
- type UnimplementedPricingServer
- func (UnimplementedPricingServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error)
- func (UnimplementedPricingServer) GetPricing(context.Context, *GetPricingRequest) (*GetPricingResponse, error)
- func (UnimplementedPricingServer) GetSupportedServices(context.Context, *GetSupportedServicesRequest) (*GetSupportedServicesResponse, error)
- type UnsafePricingServer
Constants ¶
const ( Pricing_GetInfo_FullMethodName = "/blueapi.pricing.v1.Pricing/GetInfo" Pricing_GetPricing_FullMethodName = "/blueapi.pricing.v1.Pricing/GetPricing" Pricing_GetSupportedServices_FullMethodName = "/blueapi.pricing.v1.Pricing/GetSupportedServices" )
Variables ¶
var File_pricing_v1_pricing_proto protoreflect.FileDescriptor
var Pricing_ServiceDesc = grpc.ServiceDesc{ ServiceName: "blueapi.pricing.v1.Pricing", HandlerType: (*PricingServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetInfo", Handler: _Pricing_GetInfo_Handler, }, { MethodName: "GetPricing", Handler: _Pricing_GetPricing_Handler, }, { MethodName: "GetSupportedServices", Handler: _Pricing_GetSupportedServices_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pricing/v1/pricing.proto", }
Pricing_ServiceDesc is the grpc.ServiceDesc for Pricing service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPricingHandler ¶
func RegisterPricingHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterPricingHandler registers the http handlers for service Pricing to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterPricingHandlerClient ¶
func RegisterPricingHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PricingClient) error
RegisterPricingHandlerClient registers the http handlers for service Pricing to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PricingClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PricingClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PricingClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterPricingHandlerFromEndpoint ¶
func RegisterPricingHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterPricingHandlerFromEndpoint is same as RegisterPricingHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterPricingHandlerServer ¶
func RegisterPricingHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PricingServer) error
RegisterPricingHandlerServer registers the http handlers for service Pricing to "mux". UnaryRPC :call PricingServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPricingHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterPricingServer ¶
func RegisterPricingServer(s grpc.ServiceRegistrar, srv PricingServer)
Types ¶
type Attribute ¶ added in v0.71.46
type Attribute struct { // Filter key. Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // Array of filter values. Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"` // contains filtered or unexported fields }
func (*Attribute) Descriptor
deprecated
added in
v0.71.46
func (*Attribute) ProtoMessage ¶ added in v0.71.46
func (*Attribute) ProtoMessage()
func (*Attribute) ProtoReflect ¶ added in v0.71.46
func (x *Attribute) ProtoReflect() protoreflect.Message
type ClientOptions ¶ added in v0.71.1
type ClientOptions struct {
Conn *conn.GrpcClientConn
}
ClientOptions represents the optional options to NewClient.
type GetInfoRequest ¶
type GetInfoRequest struct {
// contains filtered or unexported fields
}
Request message for the Pricing.GetInfo rpc.
func (*GetInfoRequest) Descriptor
deprecated
func (*GetInfoRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetInfoRequest.ProtoReflect.Descriptor instead.
func (*GetInfoRequest) ProtoMessage ¶
func (*GetInfoRequest) ProtoMessage()
func (*GetInfoRequest) ProtoReflect ¶
func (x *GetInfoRequest) ProtoReflect() protoreflect.Message
func (*GetInfoRequest) Reset ¶
func (x *GetInfoRequest) Reset()
func (*GetInfoRequest) String ¶
func (x *GetInfoRequest) String() string
type GetInfoResponse ¶
type GetInfoResponse struct { Response string `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` // contains filtered or unexported fields }
Response message for the Pricing.GetInfo rpc.
func (*GetInfoResponse) Descriptor
deprecated
func (*GetInfoResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetInfoResponse.ProtoReflect.Descriptor instead.
func (*GetInfoResponse) GetResponse ¶
func (x *GetInfoResponse) GetResponse() string
func (*GetInfoResponse) ProtoMessage ¶
func (*GetInfoResponse) ProtoMessage()
func (*GetInfoResponse) ProtoReflect ¶
func (x *GetInfoResponse) ProtoReflect() protoreflect.Message
func (*GetInfoResponse) Reset ¶
func (x *GetInfoResponse) Reset()
func (*GetInfoResponse) String ¶
func (x *GetInfoResponse) String() string
type GetPricingRequest ¶ added in v0.71.20
type GetPricingRequest struct { // Required. Cloud vendor, only `aws` and `azure` are currently supported. Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor,omitempty"` // Required. Cloud vendor service. // Supported services can be listed using `/{vendor}/services` endpoint. For usage information visit https://labs.alphaus.cloud/blueapidocs/#/Pricing/Pricing_GetSupportedServices. Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` // Required. Region code. // Supported regions can be listed using `/{vendor}/services` endpoint. For usage information visit https://labs.alphaus.cloud/blueapidocs/#/Pricing/Pricing_GetSupportedServices. // View all available AWS services by region at https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/. // View all available Azure services by region at https://azure.microsoft.com/en-us/explore/global-infrastructure/products-by-region/. Region string `protobuf:"bytes,3,opt,name=region,proto3" json:"region,omitempty"` // Optional. Supply token that is included in the latest response to continue fetching the remaining chunks of data. No further data can be retrieved once the token returned is empty. Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` // Optional. Filters to apply to the pricing data. // This is a map of column names and values to filter pricing items. Each key-value pair in the map represents a filter condition. // Supported filter key-value pairs can be listed using `/{vendor}/services` endpoint. For usage information visit https://labs.alphaus.cloud/blueapidocs/#/Pricing/Pricing_GetSupportedServices. // // For example, if you want to return AWS EC2 items that has All Upfront purchase option, add `"purchaseOption": "All Upfront"` to the filters. // // Multiple key-value pairs are supported but keys should not be duplicated. // For example, for AWS EC2, the following is valid, // “` // // "filters": { // "purchaseOption": "All Upfront", // "operatingSystem": "Windows" // } // // “` // but not the following, // “` // // "filters": { // "purchaseOption": "All Upfront", // "purchaseOption": "Partial Upfront" // } // // “` Filters map[string]string `` /* 155-byte string literal not displayed */ // Optional. Only specified columns will be returned, if provided. // All columns will be returned if this array is empty. // Supported columns can be listed using `/{vendor}/services` endpoint. For usage information visit https://labs.alphaus.cloud/blueapidocs/#/Pricing/Pricing_GetSupportedServices. Columns []string `protobuf:"bytes,5,rep,name=columns,proto3" json:"columns,omitempty"` // contains filtered or unexported fields }
Request message for Pricing.GetPricing rpc.
func (*GetPricingRequest) Descriptor
deprecated
added in
v0.71.20
func (*GetPricingRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetPricingRequest.ProtoReflect.Descriptor instead.
func (*GetPricingRequest) GetColumns ¶ added in v0.71.20
func (x *GetPricingRequest) GetColumns() []string
func (*GetPricingRequest) GetFilters ¶ added in v0.71.49
func (x *GetPricingRequest) GetFilters() map[string]string
func (*GetPricingRequest) GetRegion ¶ added in v0.71.20
func (x *GetPricingRequest) GetRegion() string
func (*GetPricingRequest) GetService ¶ added in v0.71.20
func (x *GetPricingRequest) GetService() string
func (*GetPricingRequest) GetToken ¶ added in v0.71.20
func (x *GetPricingRequest) GetToken() string
func (*GetPricingRequest) GetVendor ¶ added in v0.71.22
func (x *GetPricingRequest) GetVendor() string
func (*GetPricingRequest) ProtoMessage ¶ added in v0.71.20
func (*GetPricingRequest) ProtoMessage()
func (*GetPricingRequest) ProtoReflect ¶ added in v0.71.20
func (x *GetPricingRequest) ProtoReflect() protoreflect.Message
func (*GetPricingRequest) Reset ¶ added in v0.71.20
func (x *GetPricingRequest) Reset()
func (*GetPricingRequest) String ¶ added in v0.71.20
func (x *GetPricingRequest) String() string
type GetPricingResponse ¶ added in v0.71.20
type GetPricingResponse struct { // Use token to retrieve next set of pricing items. An empty string means there are no more items to retrieve. Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // Array of pricing items details. Maximum number of items returned per call is 1000. PricingData []*pricing.PricingData `protobuf:"bytes,2,rep,name=pricingData,proto3" json:"pricingData,omitempty"` // contains filtered or unexported fields }
Response message for Pricing.GetPricing rpc.
func (*GetPricingResponse) Descriptor
deprecated
added in
v0.71.20
func (*GetPricingResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetPricingResponse.ProtoReflect.Descriptor instead.
func (*GetPricingResponse) GetPricingData ¶ added in v0.71.22
func (x *GetPricingResponse) GetPricingData() []*pricing.PricingData
func (*GetPricingResponse) GetToken ¶ added in v0.71.20
func (x *GetPricingResponse) GetToken() string
func (*GetPricingResponse) ProtoMessage ¶ added in v0.71.20
func (*GetPricingResponse) ProtoMessage()
func (*GetPricingResponse) ProtoReflect ¶ added in v0.71.20
func (x *GetPricingResponse) ProtoReflect() protoreflect.Message
func (*GetPricingResponse) Reset ¶ added in v0.71.20
func (x *GetPricingResponse) Reset()
func (*GetPricingResponse) String ¶ added in v0.71.20
func (x *GetPricingResponse) String() string
type GetSupportedServicesRequest ¶ added in v0.71.46
type GetSupportedServicesRequest struct { // Required. Cloud vendor, only `aws` and `azure` are currently supported. Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor,omitempty"` // contains filtered or unexported fields }
Request message for Pricing.GetSupportedServices rpc.
func (*GetSupportedServicesRequest) Descriptor
deprecated
added in
v0.71.46
func (*GetSupportedServicesRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetSupportedServicesRequest.ProtoReflect.Descriptor instead.
func (*GetSupportedServicesRequest) GetVendor ¶ added in v0.71.46
func (x *GetSupportedServicesRequest) GetVendor() string
func (*GetSupportedServicesRequest) ProtoMessage ¶ added in v0.71.46
func (*GetSupportedServicesRequest) ProtoMessage()
func (*GetSupportedServicesRequest) ProtoReflect ¶ added in v0.71.46
func (x *GetSupportedServicesRequest) ProtoReflect() protoreflect.Message
func (*GetSupportedServicesRequest) Reset ¶ added in v0.71.46
func (x *GetSupportedServicesRequest) Reset()
func (*GetSupportedServicesRequest) String ¶ added in v0.71.46
func (x *GetSupportedServicesRequest) String() string
type GetSupportedServicesResponse ¶ added in v0.71.46
type GetSupportedServicesResponse struct { // Suported services, regions, and attributes that can be used to specify which pricing data to retrieve from `/{vendor}/pricing`. // For usage information, visit https://labs.alphaus.cloud/blueapidocs/#/Pricing/Pricing_GetPricing. SupportedServices []*SupportedService `protobuf:"bytes,1,rep,name=supportedServices,proto3" json:"supportedServices,omitempty"` // contains filtered or unexported fields }
Response message for Pricing.GetSupportedServices rpc.
func (*GetSupportedServicesResponse) Descriptor
deprecated
added in
v0.71.46
func (*GetSupportedServicesResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetSupportedServicesResponse.ProtoReflect.Descriptor instead.
func (*GetSupportedServicesResponse) GetSupportedServices ¶ added in v0.71.46
func (x *GetSupportedServicesResponse) GetSupportedServices() []*SupportedService
func (*GetSupportedServicesResponse) ProtoMessage ¶ added in v0.71.46
func (*GetSupportedServicesResponse) ProtoMessage()
func (*GetSupportedServicesResponse) ProtoReflect ¶ added in v0.71.46
func (x *GetSupportedServicesResponse) ProtoReflect() protoreflect.Message
func (*GetSupportedServicesResponse) Reset ¶ added in v0.71.46
func (x *GetSupportedServicesResponse) Reset()
func (*GetSupportedServicesResponse) String ¶ added in v0.71.46
func (x *GetSupportedServicesResponse) String() string
type GrpcClient ¶ added in v0.71.1
type GrpcClient struct { PricingClient // contains filtered or unexported fields }
func NewClient ¶ added in v0.71.1
func NewClient(ctx context.Context, opts ...*ClientOptions) (*GrpcClient, error)
NewClient returns a client connection to the 'pricing' service.
func (*GrpcClient) Close ¶ added in v0.71.1
func (c *GrpcClient) Close()
type PricingClient ¶
type PricingClient interface { // Test endpoint only. GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) // WORK-IN-PROGRESS: Get cloud pricing information GetPricing(ctx context.Context, in *GetPricingRequest, opts ...grpc.CallOption) (*GetPricingResponse, error) // WORK-IN-PROGRESS: Get list of supported services, regions, attributes, and columns for filtering GetSupportedServices(ctx context.Context, in *GetSupportedServicesRequest, opts ...grpc.CallOption) (*GetSupportedServicesResponse, error) }
PricingClient is the client API for Pricing service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
Pricing service definition.
func NewPricingClient ¶
func NewPricingClient(cc grpc.ClientConnInterface) PricingClient
type PricingServer ¶
type PricingServer interface { // Test endpoint only. GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) // WORK-IN-PROGRESS: Get cloud pricing information GetPricing(context.Context, *GetPricingRequest) (*GetPricingResponse, error) // WORK-IN-PROGRESS: Get list of supported services, regions, attributes, and columns for filtering GetSupportedServices(context.Context, *GetSupportedServicesRequest) (*GetSupportedServicesResponse, error) // contains filtered or unexported methods }
PricingServer is the server API for Pricing service. All implementations must embed UnimplementedPricingServer for forward compatibility
Pricing service definition.
type SupportedService ¶ added in v0.71.46
type SupportedService struct { // AWS or Azure services only as of now. Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` // Array of regions supported for the specific service. Regions []string `protobuf:"bytes,2,rep,name=regions,proto3" json:"regions,omitempty"` // Array of attributes that can be used as key-value pairs for filtering. Attributes []*Attribute `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes,omitempty"` // Array of column names that can be used to specify what columns should `/{vendor}/pricing` return. // For usage information, visit https://labs.alphaus.cloud/blueapidocs/#/Pricing/Pricing_GetPricing. Columns []string `protobuf:"bytes,4,rep,name=columns,proto3" json:"columns,omitempty"` // contains filtered or unexported fields }
func (*SupportedService) Descriptor
deprecated
added in
v0.71.46
func (*SupportedService) Descriptor() ([]byte, []int)
Deprecated: Use SupportedService.ProtoReflect.Descriptor instead.
func (*SupportedService) GetAttributes ¶ added in v0.71.46
func (x *SupportedService) GetAttributes() []*Attribute
func (*SupportedService) GetColumns ¶ added in v0.71.46
func (x *SupportedService) GetColumns() []string
func (*SupportedService) GetRegions ¶ added in v0.71.46
func (x *SupportedService) GetRegions() []string
func (*SupportedService) GetService ¶ added in v0.71.46
func (x *SupportedService) GetService() string
func (*SupportedService) ProtoMessage ¶ added in v0.71.46
func (*SupportedService) ProtoMessage()
func (*SupportedService) ProtoReflect ¶ added in v0.71.46
func (x *SupportedService) ProtoReflect() protoreflect.Message
func (*SupportedService) Reset ¶ added in v0.71.46
func (x *SupportedService) Reset()
func (*SupportedService) String ¶ added in v0.71.46
func (x *SupportedService) String() string
type UnimplementedPricingServer ¶
type UnimplementedPricingServer struct { }
UnimplementedPricingServer must be embedded to have forward compatible implementations.
func (UnimplementedPricingServer) GetInfo ¶
func (UnimplementedPricingServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error)
func (UnimplementedPricingServer) GetPricing ¶ added in v0.71.20
func (UnimplementedPricingServer) GetPricing(context.Context, *GetPricingRequest) (*GetPricingResponse, error)
func (UnimplementedPricingServer) GetSupportedServices ¶ added in v0.71.46
func (UnimplementedPricingServer) GetSupportedServices(context.Context, *GetSupportedServicesRequest) (*GetSupportedServicesResponse, error)
type UnsafePricingServer ¶
type UnsafePricingServer interface {
// contains filtered or unexported methods
}
UnsafePricingServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PricingServer will result in compilation errors.