feat: weather-demo MQ pipeline + sqs-consumer v1.2 with JWT auto-refresh
- sqs-consumer: new Go binary v1.2 with tokenManager (auto-login /auth/login, 5min cache, retry on 401) - console: add MQ/KW triggers UI (mqtriggers.go, kwtriggers.go, mq.js) - console: update python-env image to v1.1 (boto3+psycopg2+requests) - weather-demo: fix consumer/main.py (Flask Request.get_json instead of dict access) - weather-demo: fix fetcher/main.py (boto3 SQS publish, 5 cities) - weather-demo: update main.tf (python-env v1.1, deploy_type=literal) - python-env: add psycopg2-binary to Dockerfile (v1.1) - terraform provider: client auth fix
This commit is contained in:
@@ -26,6 +26,28 @@ type CreateTimeTriggerRequest struct {
|
||||
SubPath string `json:"subpath"`
|
||||
}
|
||||
|
||||
// CreateMQTriggerRequest — тело POST /console/api/mqtriggers.
|
||||
// Архитектура: Console создаёт K8s Deployment (sqs-consumer) + Secret с credentials
|
||||
// в namespace пользователя. sqs-consumer поллит shared-sqs → вызывает Fission-функцию.
|
||||
type CreateMQTriggerRequest struct {
|
||||
Name string `json:"name"`
|
||||
FunctionName string `json:"functionName"`
|
||||
Queue string `json:"queue"` // имя очереди в SQS
|
||||
SqsEndpoint string `json:"sqsEndpoint"` // URL SQS сервиса (default: internal shared-sqs)
|
||||
AccessKey string `json:"accessKey"` // SQS access key тенанта
|
||||
SecretKey string `json:"secretKey"` // SQS secret key тенанта
|
||||
}
|
||||
|
||||
// CreateKWTriggerRequest — тело POST /console/api/kwtriggers.
|
||||
// Документация полей: kubectl get crd kuberneteswatchtriggers.fission.io -o json
|
||||
type CreateKWTriggerRequest struct {
|
||||
Name string `json:"name"`
|
||||
FunctionName string `json:"functionName"`
|
||||
ResourceType string `json:"resourceType"` // Pod, Service, Deployment и т.д.
|
||||
Namespace string `json:"namespace"` // пустое = namespace пользователя
|
||||
LabelSelector string `json:"labelSelector"` // "app=foo" или "" для всех
|
||||
}
|
||||
|
||||
// UpdateCodeRequest — тело PUT /console/api/functions/:name/code.
|
||||
type UpdateCodeRequest struct {
|
||||
Code string `json:"code"`
|
||||
|
||||
Reference in New Issue
Block a user