|
21 | 21 | DslCompileResponse, |
22 | 22 | # System models |
23 | 23 | HealthResponse, |
| 24 | + # HTTP Input models |
| 25 | + HttpInputCreateRequest, |
| 26 | + HttpInputServerInfo, |
| 27 | + HttpInputUpdateRequest, |
24 | 28 | HumanReviewDecision, |
25 | 29 | # Vector Database & RAG models |
26 | 30 | KnowledgeItem, |
|
44 | 48 | SystemMetrics, |
45 | 49 | VectorSearchRequest, |
46 | 50 | VectorSearchResponse, |
| 51 | + WebhookTriggerRequest, |
| 52 | + WebhookTriggerResponse, |
47 | 53 | WorkflowExecutionRequest, |
48 | 54 | ) |
49 | 55 |
|
@@ -661,3 +667,121 @@ def stop_agent_deployment(self, deployment_id: str) -> Dict[str, Any]: |
661 | 667 | """ |
662 | 668 | response = self._request("POST", f"agents/deployments/{deployment_id}/stop") |
663 | 669 | return response.json() |
| 670 | + |
| 671 | + # ============================================================================= |
| 672 | + # HTTP Input Methods |
| 673 | + # ============================================================================= |
| 674 | + |
| 675 | + def create_http_input_server(self, request: Union[HttpInputCreateRequest, Dict[str, Any]]) -> HttpInputServerInfo: |
| 676 | + """Create and start an HTTP input server. |
| 677 | +
|
| 678 | + Args: |
| 679 | + request: HTTP input server creation request |
| 680 | +
|
| 681 | + Returns: |
| 682 | + HttpInputServerInfo: Server information |
| 683 | + """ |
| 684 | + if isinstance(request, dict): |
| 685 | + request = HttpInputCreateRequest(**request) |
| 686 | + |
| 687 | + response = self._request("POST", "http-input/servers", json=request.dict()) |
| 688 | + return HttpInputServerInfo(**response.json()) |
| 689 | + |
| 690 | + def list_http_input_servers(self) -> List[HttpInputServerInfo]: |
| 691 | + """List all HTTP input servers. |
| 692 | +
|
| 693 | + Returns: |
| 694 | + List[HttpInputServerInfo]: List of server information |
| 695 | + """ |
| 696 | + response = self._request("GET", "http-input/servers") |
| 697 | + return [HttpInputServerInfo(**server) for server in response.json()] |
| 698 | + |
| 699 | + def get_http_input_server(self, server_id: str) -> HttpInputServerInfo: |
| 700 | + """Get information about a specific HTTP input server. |
| 701 | +
|
| 702 | + Args: |
| 703 | + server_id: The server identifier |
| 704 | +
|
| 705 | + Returns: |
| 706 | + HttpInputServerInfo: Server information |
| 707 | + """ |
| 708 | + response = self._request("GET", f"http-input/servers/{server_id}") |
| 709 | + return HttpInputServerInfo(**response.json()) |
| 710 | + |
| 711 | + def update_http_input_server(self, request: Union[HttpInputUpdateRequest, Dict[str, Any]]) -> HttpInputServerInfo: |
| 712 | + """Update an HTTP input server configuration. |
| 713 | +
|
| 714 | + Args: |
| 715 | + request: HTTP input server update request |
| 716 | +
|
| 717 | + Returns: |
| 718 | + HttpInputServerInfo: Updated server information |
| 719 | + """ |
| 720 | + if isinstance(request, dict): |
| 721 | + request = HttpInputUpdateRequest(**request) |
| 722 | + |
| 723 | + response = self._request("PUT", f"http-input/servers/{request.server_id}", json=request.dict()) |
| 724 | + return HttpInputServerInfo(**response.json()) |
| 725 | + |
| 726 | + def start_http_input_server(self, server_id: str) -> Dict[str, Any]: |
| 727 | + """Start an HTTP input server. |
| 728 | +
|
| 729 | + Args: |
| 730 | + server_id: The server identifier |
| 731 | +
|
| 732 | + Returns: |
| 733 | + Dict[str, Any]: Start confirmation |
| 734 | + """ |
| 735 | + response = self._request("POST", f"http-input/servers/{server_id}/start") |
| 736 | + return response.json() |
| 737 | + |
| 738 | + def stop_http_input_server(self, server_id: str) -> Dict[str, Any]: |
| 739 | + """Stop an HTTP input server. |
| 740 | +
|
| 741 | + Args: |
| 742 | + server_id: The server identifier |
| 743 | +
|
| 744 | + Returns: |
| 745 | + Dict[str, Any]: Stop confirmation |
| 746 | + """ |
| 747 | + response = self._request("POST", f"http-input/servers/{server_id}/stop") |
| 748 | + return response.json() |
| 749 | + |
| 750 | + def delete_http_input_server(self, server_id: str) -> Dict[str, Any]: |
| 751 | + """Delete an HTTP input server. |
| 752 | +
|
| 753 | + Args: |
| 754 | + server_id: The server identifier |
| 755 | +
|
| 756 | + Returns: |
| 757 | + Dict[str, Any]: Deletion confirmation |
| 758 | + """ |
| 759 | + response = self._request("DELETE", f"http-input/servers/{server_id}") |
| 760 | + return response.json() |
| 761 | + |
| 762 | + def trigger_webhook(self, request: Union[WebhookTriggerRequest, Dict[str, Any]]) -> WebhookTriggerResponse: |
| 763 | + """Manually trigger a webhook for testing purposes. |
| 764 | +
|
| 765 | + Args: |
| 766 | + request: Webhook trigger request |
| 767 | +
|
| 768 | + Returns: |
| 769 | + WebhookTriggerResponse: Trigger response |
| 770 | + """ |
| 771 | + if isinstance(request, dict): |
| 772 | + request = WebhookTriggerRequest(**request) |
| 773 | + |
| 774 | + response = self._request("POST", f"http-input/servers/{request.server_id}/trigger", json=request.dict()) |
| 775 | + return WebhookTriggerResponse(**response.json()) |
| 776 | + |
| 777 | + def get_http_input_metrics(self, server_id: str) -> Dict[str, Any]: |
| 778 | + """Get metrics for an HTTP input server. |
| 779 | +
|
| 780 | + Args: |
| 781 | + server_id: The server identifier |
| 782 | +
|
| 783 | + Returns: |
| 784 | + Dict[str, Any]: Server metrics |
| 785 | + """ |
| 786 | + response = self._request("GET", f"http-input/servers/{server_id}/metrics") |
| 787 | + return response.json() |
0 commit comments