mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-09-27 01:56:03 +08:00
get workflow implementation
This commit is contained in:
@@ -72,6 +72,147 @@ func (m *CreateWorkflowRequest) GetWorkflow() *Workflow {
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetWorkflowRequest struct {
|
||||
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *GetWorkflowRequest) Reset() { *m = GetWorkflowRequest{} }
|
||||
func (m *GetWorkflowRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetWorkflowRequest) ProtoMessage() {}
|
||||
func (*GetWorkflowRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_892c7f566756b0be, []int{1}
|
||||
}
|
||||
|
||||
func (m *GetWorkflowRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetWorkflowRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *GetWorkflowRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_GetWorkflowRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *GetWorkflowRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_GetWorkflowRequest.Merge(m, src)
|
||||
}
|
||||
func (m *GetWorkflowRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_GetWorkflowRequest.Size(m)
|
||||
}
|
||||
func (m *GetWorkflowRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_GetWorkflowRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_GetWorkflowRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *GetWorkflowRequest) GetNamespace() string {
|
||||
if m != nil {
|
||||
return m.Namespace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *GetWorkflowRequest) GetName() string {
|
||||
if m != nil {
|
||||
return m.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ListWorkflowsRequest struct {
|
||||
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
||||
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ListWorkflowsRequest) Reset() { *m = ListWorkflowsRequest{} }
|
||||
func (m *ListWorkflowsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ListWorkflowsRequest) ProtoMessage() {}
|
||||
func (*ListWorkflowsRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_892c7f566756b0be, []int{2}
|
||||
}
|
||||
|
||||
func (m *ListWorkflowsRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ListWorkflowsRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ListWorkflowsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ListWorkflowsRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ListWorkflowsRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ListWorkflowsRequest.Merge(m, src)
|
||||
}
|
||||
func (m *ListWorkflowsRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_ListWorkflowsRequest.Size(m)
|
||||
}
|
||||
func (m *ListWorkflowsRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ListWorkflowsRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ListWorkflowsRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *ListWorkflowsRequest) GetNamespace() string {
|
||||
if m != nil {
|
||||
return m.Namespace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *ListWorkflowsRequest) GetUid() string {
|
||||
if m != nil {
|
||||
return m.Uid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ListWorkflowsResponse struct {
|
||||
Workflows []*Workflow `protobuf:"bytes,1,rep,name=workflows,proto3" json:"workflows,omitempty"`
|
||||
Count int32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ListWorkflowsResponse) Reset() { *m = ListWorkflowsResponse{} }
|
||||
func (m *ListWorkflowsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ListWorkflowsResponse) ProtoMessage() {}
|
||||
func (*ListWorkflowsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_892c7f566756b0be, []int{3}
|
||||
}
|
||||
|
||||
func (m *ListWorkflowsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ListWorkflowsResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ListWorkflowsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ListWorkflowsResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ListWorkflowsResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ListWorkflowsResponse.Merge(m, src)
|
||||
}
|
||||
func (m *ListWorkflowsResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_ListWorkflowsResponse.Size(m)
|
||||
}
|
||||
func (m *ListWorkflowsResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ListWorkflowsResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ListWorkflowsResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *ListWorkflowsResponse) GetWorkflows() []*Workflow {
|
||||
if m != nil {
|
||||
return m.Workflows
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ListWorkflowsResponse) GetCount() int32 {
|
||||
if m != nil {
|
||||
return m.Count
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Workflow struct {
|
||||
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
@@ -86,7 +227,7 @@ func (m *Workflow) Reset() { *m = Workflow{} }
|
||||
func (m *Workflow) String() string { return proto.CompactTextString(m) }
|
||||
func (*Workflow) ProtoMessage() {}
|
||||
func (*Workflow) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_892c7f566756b0be, []int{1}
|
||||
return fileDescriptor_892c7f566756b0be, []int{4}
|
||||
}
|
||||
|
||||
func (m *Workflow) XXX_Unmarshal(b []byte) error {
|
||||
@@ -147,7 +288,7 @@ func (m *Parameter) Reset() { *m = Parameter{} }
|
||||
func (m *Parameter) String() string { return proto.CompactTextString(m) }
|
||||
func (*Parameter) ProtoMessage() {}
|
||||
func (*Parameter) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_892c7f566756b0be, []int{2}
|
||||
return fileDescriptor_892c7f566756b0be, []int{5}
|
||||
}
|
||||
|
||||
func (m *Parameter) XXX_Unmarshal(b []byte) error {
|
||||
@@ -184,6 +325,9 @@ func (m *Parameter) GetValue() string {
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*CreateWorkflowRequest)(nil), "api.CreateWorkflowRequest")
|
||||
proto.RegisterType((*GetWorkflowRequest)(nil), "api.GetWorkflowRequest")
|
||||
proto.RegisterType((*ListWorkflowsRequest)(nil), "api.ListWorkflowsRequest")
|
||||
proto.RegisterType((*ListWorkflowsResponse)(nil), "api.ListWorkflowsResponse")
|
||||
proto.RegisterType((*Workflow)(nil), "api.Workflow")
|
||||
proto.RegisterType((*Parameter)(nil), "api.Parameter")
|
||||
}
|
||||
@@ -191,36 +335,42 @@ func init() {
|
||||
func init() { proto.RegisterFile("workflow.proto", fileDescriptor_892c7f566756b0be) }
|
||||
|
||||
var fileDescriptor_892c7f566756b0be = []byte{
|
||||
// 449 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xc1, 0x6a, 0x53, 0x41,
|
||||
0x14, 0x86, 0x99, 0xa6, 0x95, 0xe6, 0x14, 0x63, 0x39, 0x5a, 0x0d, 0x21, 0x60, 0x18, 0x37, 0x29,
|
||||
0x48, 0x86, 0x46, 0xba, 0xa9, 0x08, 0x4a, 0xd1, 0x6e, 0x5c, 0xc8, 0x55, 0x14, 0xdc, 0xe8, 0xb4,
|
||||
0x3d, 0x96, 0xc1, 0xe4, 0xce, 0x38, 0x33, 0x49, 0x17, 0x21, 0x1b, 0x7d, 0x04, 0x97, 0x2e, 0x7d,
|
||||
0x05, 0x17, 0xbe, 0x47, 0x5f, 0xc1, 0x07, 0x91, 0x4c, 0xee, 0x8c, 0xbd, 0xdc, 0x8b, 0x35, 0xb8,
|
||||
0x9b, 0x9c, 0xf3, 0xcf, 0x7f, 0xbe, 0xf3, 0xe7, 0x0e, 0xb4, 0xce, 0xb5, 0xfd, 0xf8, 0x61, 0xa4,
|
||||
0xcf, 0x07, 0xc6, 0x6a, 0xaf, 0xb1, 0x21, 0x8d, 0xea, 0x74, 0xcf, 0xb4, 0x3e, 0x1b, 0x91, 0x90,
|
||||
0x46, 0x09, 0x99, 0xe7, 0xda, 0x4b, 0xaf, 0x74, 0xee, 0x96, 0x92, 0xce, 0x9d, 0x78, 0xe5, 0x9d,
|
||||
0xa7, 0xb1, 0x19, 0x49, 0x4f, 0xcb, 0x06, 0x7f, 0x0f, 0x3b, 0x87, 0x96, 0xa4, 0xa7, 0x37, 0x85,
|
||||
0x20, 0xa3, 0x4f, 0x13, 0x72, 0x1e, 0xbb, 0xd0, 0xcc, 0xe5, 0x98, 0x9c, 0x91, 0x27, 0xd4, 0x66,
|
||||
0x3d, 0xd6, 0x6f, 0x66, 0x7f, 0x0a, 0xb8, 0x0b, 0x9b, 0xd1, 0xb1, 0xbd, 0xd6, 0x63, 0xfd, 0xad,
|
||||
0xe1, 0xf5, 0x81, 0x34, 0x6a, 0x90, 0x5c, 0x52, 0x9b, 0x7f, 0x67, 0xb0, 0x19, 0xcb, 0xb8, 0x0d,
|
||||
0x8d, 0x89, 0x3a, 0x2d, 0xfc, 0x16, 0x47, 0x44, 0x58, 0x5f, 0xd8, 0x06, 0x97, 0x66, 0x16, 0xce,
|
||||
0x38, 0x00, 0x30, 0xd2, 0xca, 0x31, 0x79, 0xb2, 0xae, 0xdd, 0xe8, 0x35, 0xfa, 0x5b, 0xc3, 0x56,
|
||||
0xf0, 0x7f, 0x11, 0xcb, 0xd9, 0x25, 0x05, 0x3e, 0x81, 0xed, 0x38, 0xee, 0x55, 0xb1, 0x5e, 0x7b,
|
||||
0x3d, 0x50, 0xed, 0x94, 0xa8, 0x62, 0x33, 0xab, 0xc8, 0xf9, 0x3e, 0x34, 0x93, 0x77, 0x62, 0x62,
|
||||
0x97, 0x98, 0x6e, 0xc1, 0xc6, 0x54, 0x8e, 0x26, 0x11, 0x74, 0xf9, 0x63, 0xf8, 0x63, 0x03, 0x6e,
|
||||
0x44, 0xf7, 0x97, 0x64, 0xa7, 0xea, 0x84, 0xd0, 0x42, 0xab, 0x1c, 0x29, 0x76, 0x02, 0x45, 0x6d,
|
||||
0xce, 0x9d, 0x72, 0x6e, 0x7c, 0xff, 0xf3, 0xc5, 0xaf, 0xaf, 0x6b, 0x82, 0xdf, 0x5b, 0xfc, 0x91,
|
||||
0x4e, 0x4c, 0xf7, 0x8e, 0xc9, 0xcb, 0x3d, 0x31, 0x4b, 0xd1, 0xcf, 0x45, 0x64, 0x77, 0x07, 0x29,
|
||||
0x64, 0xfc, 0xc6, 0xe0, 0x76, 0xd9, 0x3f, 0x6e, 0x86, 0xbc, 0x66, 0x78, 0x0a, 0xa2, 0x80, 0xa8,
|
||||
0x8f, 0x89, 0x3f, 0x0b, 0x30, 0x8f, 0xf9, 0xfd, 0xab, 0x61, 0xd2, 0x77, 0xe5, 0x0e, 0x2a, 0xe1,
|
||||
0xe2, 0x05, 0x83, 0x9b, 0x47, 0xe4, 0x2b, 0x68, 0x77, 0xc3, 0xd8, 0x9a, 0xce, 0x15, 0x5c, 0x5f,
|
||||
0x58, 0x00, 0x9b, 0xe3, 0x70, 0x15, 0x30, 0x31, 0x9b, 0xa8, 0xd3, 0xf9, 0xdb, 0x23, 0x7c, 0xba,
|
||||
0xfa, 0x2d, 0x31, 0x25, 0xeb, 0x16, 0xef, 0x49, 0xcc, 0x8a, 0xd3, 0x1c, 0x7f, 0x32, 0xe8, 0x3e,
|
||||
0x57, 0xae, 0x02, 0xff, 0xba, 0x90, 0x62, 0x3f, 0xd0, 0xff, 0x4d, 0x12, 0xf7, 0xdc, 0xfd, 0x07,
|
||||
0xa5, 0x33, 0x3a, 0x77, 0xc4, 0x0f, 0xc3, 0xea, 0x8f, 0xf0, 0xe1, 0x7f, 0x2c, 0x71, 0x7c, 0x2d,
|
||||
0x3c, 0xfe, 0x07, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe4, 0x92, 0x6b, 0x2e, 0x4a, 0x04, 0x00,
|
||||
0x00,
|
||||
// 549 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xc1, 0x6e, 0xd3, 0x40,
|
||||
0x10, 0xd5, 0x36, 0x2d, 0x34, 0x53, 0x35, 0x54, 0x43, 0x42, 0x83, 0x15, 0x89, 0x68, 0x11, 0x52,
|
||||
0x4a, 0xab, 0x58, 0x0d, 0xea, 0xa5, 0x08, 0x09, 0x54, 0x91, 0x5e, 0x38, 0x20, 0x83, 0x40, 0xea,
|
||||
0x05, 0xb6, 0xe9, 0x52, 0x59, 0x24, 0x5e, 0xe3, 0xdd, 0xa4, 0x87, 0xc8, 0x17, 0xf8, 0x04, 0xb8,
|
||||
0x71, 0xe4, 0x27, 0xf8, 0x8f, 0xfe, 0x02, 0x1f, 0x82, 0xb2, 0xf6, 0x6e, 0xed, 0xd8, 0x12, 0x8e,
|
||||
0xb8, 0xed, 0xce, 0xcc, 0xbe, 0x79, 0x33, 0xef, 0x69, 0xa1, 0x71, 0x25, 0xa2, 0xcf, 0x9f, 0xc6,
|
||||
0xe2, 0xaa, 0x1f, 0x46, 0x42, 0x09, 0xac, 0xb1, 0xd0, 0x77, 0x3a, 0x97, 0x42, 0x5c, 0x8e, 0xb9,
|
||||
0xcb, 0x42, 0xdf, 0x65, 0x41, 0x20, 0x14, 0x53, 0xbe, 0x08, 0x64, 0x52, 0xe2, 0xec, 0x9a, 0x27,
|
||||
0x1f, 0x14, 0x9f, 0x84, 0x63, 0xa6, 0x78, 0x92, 0xa0, 0x1f, 0xa1, 0x75, 0x12, 0x71, 0xa6, 0xf8,
|
||||
0xfb, 0xb4, 0xc0, 0xe3, 0x5f, 0xa6, 0x5c, 0x2a, 0xec, 0x40, 0x3d, 0x60, 0x13, 0x2e, 0x43, 0x36,
|
||||
0xe2, 0x6d, 0xd2, 0x25, 0xbd, 0xba, 0x77, 0x13, 0xc0, 0x3d, 0xd8, 0x34, 0x88, 0xed, 0xb5, 0x2e,
|
||||
0xe9, 0x6d, 0x0d, 0xb6, 0xfb, 0x2c, 0xf4, 0xfb, 0x16, 0xc5, 0xa6, 0xe9, 0x10, 0xf0, 0x94, 0xab,
|
||||
0xd5, 0xe0, 0x11, 0xd6, 0x17, 0x17, 0x0d, 0x5d, 0xf7, 0xf4, 0x99, 0x0e, 0xa1, 0xf9, 0xca, 0x97,
|
||||
0x16, 0x48, 0x56, 0x43, 0xda, 0x81, 0xda, 0xd4, 0xbf, 0x48, 0x81, 0x16, 0x47, 0x7a, 0x06, 0xad,
|
||||
0x25, 0x1c, 0x19, 0x8a, 0x40, 0x72, 0xdc, 0x87, 0xba, 0x21, 0x2d, 0xdb, 0xa4, 0x5b, 0x2b, 0x0e,
|
||||
0x75, 0x93, 0xc7, 0x26, 0x6c, 0x8c, 0xc4, 0x34, 0x50, 0x1a, 0x79, 0xc3, 0x4b, 0x2e, 0xf4, 0x17,
|
||||
0x81, 0x4d, 0x53, 0x6d, 0x5a, 0x13, 0xdb, 0xba, 0x6c, 0x2c, 0xec, 0x03, 0x84, 0x2c, 0x62, 0x13,
|
||||
0xae, 0x78, 0x24, 0xdb, 0x35, 0xdd, 0xb6, 0xa1, 0xdb, 0xbe, 0x36, 0x61, 0x2f, 0x53, 0x81, 0x2f,
|
||||
0x60, 0xc7, 0xb0, 0x78, 0x9b, 0x4a, 0xd9, 0x5e, 0xd7, 0x0a, 0xb4, 0x72, 0x64, 0x4d, 0xd2, 0x2b,
|
||||
0x94, 0xd3, 0x23, 0xa8, 0x5b, 0x6c, 0xcb, 0x89, 0x64, 0x38, 0x35, 0x61, 0x63, 0xc6, 0xc6, 0x53,
|
||||
0x43, 0x34, 0xb9, 0x0c, 0x7e, 0xdc, 0x86, 0x3b, 0x06, 0xfd, 0x0d, 0x8f, 0x66, 0xfe, 0x88, 0x63,
|
||||
0x04, 0x8d, 0xbc, 0x7d, 0xd0, 0xd1, 0x2c, 0x4a, 0x3d, 0xe5, 0xe4, 0xd7, 0x49, 0x8f, 0xbe, 0x5e,
|
||||
0xff, 0xf9, 0xbe, 0xe6, 0xd2, 0x87, 0x0b, 0xd3, 0x4a, 0x77, 0x76, 0x78, 0xce, 0x15, 0x3b, 0x74,
|
||||
0xe7, 0x56, 0xbd, 0xd8, 0xb5, 0x0b, 0x3f, 0xb6, 0x86, 0x42, 0x1f, 0xb6, 0x32, 0x86, 0xc2, 0x5d,
|
||||
0x0d, 0x5a, 0xb4, 0xd8, 0x72, 0xb7, 0x81, 0xee, 0x76, 0x80, 0x8f, 0x2b, 0x74, 0x4b, 0xa2, 0x31,
|
||||
0x4a, 0xd8, 0xce, 0x79, 0x05, 0xef, 0x6b, 0xcc, 0x32, 0x1f, 0x3a, 0x4e, 0x59, 0x2a, 0xb1, 0x16,
|
||||
0xdd, 0xd7, 0xbd, 0x1f, 0x61, 0x95, 0x49, 0xf1, 0x27, 0x81, 0x7b, 0xf9, 0xfd, 0x19, 0xe5, 0x90,
|
||||
0x96, 0x2c, 0xd7, 0x0a, 0x9d, 0xf2, 0x28, 0xb7, 0x01, 0x1d, 0x6a, 0x0a, 0xcf, 0xe9, 0xc1, 0xbf,
|
||||
0x29, 0xd8, 0x3f, 0x42, 0x1e, 0x17, 0xcc, 0x83, 0xd7, 0x04, 0xee, 0x66, 0x96, 0x6d, 0xe3, 0x0f,
|
||||
0x96, 0x65, 0xa8, 0xc8, 0xeb, 0x1b, 0xd1, 0xc4, 0x62, 0x1c, 0xac, 0x42, 0xcc, 0x9d, 0x4f, 0xfd,
|
||||
0x8b, 0xf8, 0xec, 0x14, 0x5f, 0xae, 0xfe, 0xca, 0x9d, 0xf1, 0x48, 0x2e, 0xfe, 0x46, 0x77, 0x9e,
|
||||
0x9e, 0x62, 0xfc, 0x4d, 0xa0, 0x93, 0x95, 0xce, 0xd0, 0x7b, 0x97, 0x96, 0x62, 0xaf, 0xa0, 0xee,
|
||||
0x72, 0x89, 0x99, 0x73, 0xaf, 0x42, 0x65, 0x6a, 0x8b, 0x13, 0x3d, 0xfa, 0x33, 0x7c, 0xfa, 0x1f,
|
||||
0x43, 0x9c, 0xdf, 0xd2, 0x1f, 0xf9, 0x93, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe3, 0xaa, 0xa3,
|
||||
0xc7, 0x16, 0x06, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -237,6 +387,8 @@ const _ = grpc.SupportPackageIsVersion4
|
||||
type WorkflowServiceClient interface {
|
||||
// Creates a Workflow
|
||||
CreateWorkflow(ctx context.Context, in *CreateWorkflowRequest, opts ...grpc.CallOption) (*Workflow, error)
|
||||
GetWorkflow(ctx context.Context, in *GetWorkflowRequest, opts ...grpc.CallOption) (*Workflow, error)
|
||||
ListWorkflows(ctx context.Context, in *ListWorkflowsRequest, opts ...grpc.CallOption) (*ListWorkflowsResponse, error)
|
||||
CreateWorkflowTemplate(ctx context.Context, in *CreateWorkflowTemplateRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error)
|
||||
GetWorkflowTemplate(ctx context.Context, in *GetWorkflowTemplateRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error)
|
||||
ListWorkflowTemplateVersions(ctx context.Context, in *ListWorkflowTemplateVersionsRequest, opts ...grpc.CallOption) (*ListWorkflowTemplateVersionsResponse, error)
|
||||
@@ -259,6 +411,24 @@ func (c *workflowServiceClient) CreateWorkflow(ctx context.Context, in *CreateWo
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *workflowServiceClient) GetWorkflow(ctx context.Context, in *GetWorkflowRequest, opts ...grpc.CallOption) (*Workflow, error) {
|
||||
out := new(Workflow)
|
||||
err := c.cc.Invoke(ctx, "/api.WorkflowService/GetWorkflow", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *workflowServiceClient) ListWorkflows(ctx context.Context, in *ListWorkflowsRequest, opts ...grpc.CallOption) (*ListWorkflowsResponse, error) {
|
||||
out := new(ListWorkflowsResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.WorkflowService/ListWorkflows", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *workflowServiceClient) CreateWorkflowTemplate(ctx context.Context, in *CreateWorkflowTemplateRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error) {
|
||||
out := new(WorkflowTemplate)
|
||||
err := c.cc.Invoke(ctx, "/api.WorkflowService/CreateWorkflowTemplate", in, out, opts...)
|
||||
@@ -290,6 +460,8 @@ func (c *workflowServiceClient) ListWorkflowTemplateVersions(ctx context.Context
|
||||
type WorkflowServiceServer interface {
|
||||
// Creates a Workflow
|
||||
CreateWorkflow(context.Context, *CreateWorkflowRequest) (*Workflow, error)
|
||||
GetWorkflow(context.Context, *GetWorkflowRequest) (*Workflow, error)
|
||||
ListWorkflows(context.Context, *ListWorkflowsRequest) (*ListWorkflowsResponse, error)
|
||||
CreateWorkflowTemplate(context.Context, *CreateWorkflowTemplateRequest) (*WorkflowTemplate, error)
|
||||
GetWorkflowTemplate(context.Context, *GetWorkflowTemplateRequest) (*WorkflowTemplate, error)
|
||||
ListWorkflowTemplateVersions(context.Context, *ListWorkflowTemplateVersionsRequest) (*ListWorkflowTemplateVersionsResponse, error)
|
||||
@@ -302,6 +474,12 @@ type UnimplementedWorkflowServiceServer struct {
|
||||
func (*UnimplementedWorkflowServiceServer) CreateWorkflow(ctx context.Context, req *CreateWorkflowRequest) (*Workflow, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateWorkflow not implemented")
|
||||
}
|
||||
func (*UnimplementedWorkflowServiceServer) GetWorkflow(ctx context.Context, req *GetWorkflowRequest) (*Workflow, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetWorkflow not implemented")
|
||||
}
|
||||
func (*UnimplementedWorkflowServiceServer) ListWorkflows(ctx context.Context, req *ListWorkflowsRequest) (*ListWorkflowsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListWorkflows not implemented")
|
||||
}
|
||||
func (*UnimplementedWorkflowServiceServer) CreateWorkflowTemplate(ctx context.Context, req *CreateWorkflowTemplateRequest) (*WorkflowTemplate, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateWorkflowTemplate not implemented")
|
||||
}
|
||||
@@ -334,6 +512,42 @@ func _WorkflowService_CreateWorkflow_Handler(srv interface{}, ctx context.Contex
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _WorkflowService_GetWorkflow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetWorkflowRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(WorkflowServiceServer).GetWorkflow(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.WorkflowService/GetWorkflow",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(WorkflowServiceServer).GetWorkflow(ctx, req.(*GetWorkflowRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _WorkflowService_ListWorkflows_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListWorkflowsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(WorkflowServiceServer).ListWorkflows(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.WorkflowService/ListWorkflows",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(WorkflowServiceServer).ListWorkflows(ctx, req.(*ListWorkflowsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _WorkflowService_CreateWorkflowTemplate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateWorkflowTemplateRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -396,6 +610,14 @@ var _WorkflowService_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "CreateWorkflow",
|
||||
Handler: _WorkflowService_CreateWorkflow_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetWorkflow",
|
||||
Handler: _WorkflowService_GetWorkflow_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListWorkflows",
|
||||
Handler: _WorkflowService_ListWorkflows_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateWorkflowTemplate",
|
||||
Handler: _WorkflowService_CreateWorkflowTemplate_Handler,
|
||||
|
@@ -101,6 +101,151 @@ func local_request_WorkflowService_CreateWorkflow_0(ctx context.Context, marshal
|
||||
|
||||
}
|
||||
|
||||
func request_WorkflowService_GetWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetWorkflowRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||
}
|
||||
|
||||
protoReq.Name, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_WorkflowService_GetWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetWorkflowRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||
}
|
||||
|
||||
protoReq.Name, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetWorkflow(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_WorkflowService_ListWorkflows_0 = &utilities.DoubleArray{Encoding: map[string]int{"namespace": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
|
||||
)
|
||||
|
||||
func request_WorkflowService_ListWorkflows_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListWorkflowsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WorkflowService_ListWorkflows_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.ListWorkflows(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_WorkflowService_ListWorkflows_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListWorkflowsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_WorkflowService_ListWorkflows_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.ListWorkflows(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_WorkflowService_CreateWorkflowTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CreateWorkflowTemplateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
@@ -461,6 +606,46 @@ func RegisterWorkflowServiceHandlerServer(ctx context.Context, mux *runtime.Serv
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_WorkflowService_GetWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_WorkflowService_GetWorkflow_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkflowService_GetWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_WorkflowService_ListWorkflows_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_WorkflowService_ListWorkflows_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkflowService_ListWorkflows_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_WorkflowService_CreateWorkflowTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -602,6 +787,46 @@ func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.Serv
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_WorkflowService_GetWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_WorkflowService_GetWorkflow_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkflowService_GetWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_WorkflowService_ListWorkflows_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_WorkflowService_ListWorkflows_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkflowService_ListWorkflows_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_WorkflowService_CreateWorkflowTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -688,6 +913,10 @@ func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.Serv
|
||||
var (
|
||||
pattern_WorkflowService_CreateWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "workflows"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_WorkflowService_GetWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "workflows", "name"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_WorkflowService_ListWorkflows_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "workflows"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_WorkflowService_CreateWorkflowTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "workflow_templates"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_WorkflowService_GetWorkflowTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "workflow_templates", "uid"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
@@ -700,6 +929,10 @@ var (
|
||||
var (
|
||||
forward_WorkflowService_CreateWorkflow_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_WorkflowService_GetWorkflow_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_WorkflowService_ListWorkflows_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_WorkflowService_CreateWorkflowTemplate_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_WorkflowService_GetWorkflowTemplate_0 = runtime.ForwardResponseMessage
|
||||
|
@@ -14,6 +14,18 @@ service WorkflowService {
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetWorkflow (GetWorkflowRequest) returns (Workflow) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflows/{name}"
|
||||
};
|
||||
}
|
||||
|
||||
rpc ListWorkflows (ListWorkflowsRequest) returns (ListWorkflowsResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflows"
|
||||
};
|
||||
}
|
||||
|
||||
rpc CreateWorkflowTemplate (CreateWorkflowTemplateRequest) returns (WorkflowTemplate) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/{namespace}/workflow_templates"
|
||||
@@ -42,6 +54,21 @@ message CreateWorkflowRequest {
|
||||
Workflow workflow = 2;
|
||||
}
|
||||
|
||||
message GetWorkflowRequest {
|
||||
string namespace = 1;
|
||||
string name = 2;
|
||||
}
|
||||
|
||||
message ListWorkflowsRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
}
|
||||
|
||||
message ListWorkflowsResponse {
|
||||
repeated Workflow workflows = 1;
|
||||
int32 count = 2;
|
||||
}
|
||||
|
||||
message Workflow {
|
||||
string uid = 1;
|
||||
string name = 2;
|
||||
|
@@ -148,6 +148,34 @@
|
||||
}
|
||||
},
|
||||
"/apis/v1beta1/{namespace}/workflows": {
|
||||
"get": {
|
||||
"operationId": "ListWorkflows",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/apiListWorkflowsResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "namespace",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "uid",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"WorkflowService"
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"summary": "Creates a Workflow",
|
||||
"operationId": "CreateWorkflow",
|
||||
@@ -179,6 +207,36 @@
|
||||
"WorkflowService"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/apis/v1beta1/{namespace}/workflows/{name}": {
|
||||
"get": {
|
||||
"operationId": "GetWorkflow",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/apiWorkflow"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "namespace",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"WorkflowService"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
@@ -197,6 +255,21 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"apiListWorkflowsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"workflows": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/apiWorkflow"
|
||||
}
|
||||
},
|
||||
"count": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
}
|
||||
}
|
||||
},
|
||||
"apiParameter": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@@ -21,7 +21,7 @@ message ListWorkflowTemplateVersionsRequest {
|
||||
message ListWorkflowTemplateVersionsResponse {
|
||||
repeated WorkflowTemplate workflowTemplates = 1;
|
||||
int32 count = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message WorkflowTemplate {
|
||||
string uid = 1;
|
||||
|
@@ -4,6 +4,7 @@ import (
|
||||
wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1"
|
||||
"github.com/argoproj/argo/workflow/common"
|
||||
"github.com/argoproj/pkg/json"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
_ "k8s.io/client-go/plugin/pkg/client/auth"
|
||||
)
|
||||
|
||||
@@ -100,3 +101,9 @@ func (c *Client) Create(manifest []byte, opts *Options) (createdWorkflows []*Wor
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (c *Client) Get(name string, opts *Options) (workflow *Workflow, err error) {
|
||||
workflow, err = c.Clientset.ArgoprojV1alpha1().Workflows(opts.Namespace).Get(name, v1.GetOptions{})
|
||||
|
||||
return
|
||||
}
|
||||
|
2
go.mod
2
go.mod
@@ -39,7 +39,7 @@ require (
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.2.7 // indirect
|
||||
k8s.io/api v0.0.0-20190313235455-40a48860b5ab // indirect
|
||||
k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1 // indirect
|
||||
k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1
|
||||
k8s.io/client-go v11.0.0+incompatible
|
||||
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a // indirect
|
||||
k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 // indirect
|
||||
|
@@ -2,6 +2,7 @@ package manager
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/onepanelio/core/argo"
|
||||
"github.com/onepanelio/core/model"
|
||||
@@ -43,6 +44,32 @@ func (r *ResourceManager) CreateWorkflow(namespace string, workflow *model.Workf
|
||||
return
|
||||
}
|
||||
|
||||
func (r *ResourceManager) GetWorkflow(namespace, name string) (workflow *model.Workflow, err error) {
|
||||
wf, err := r.argClient.Get(name, &argo.Options{Namespace: namespace})
|
||||
if err != nil {
|
||||
return nil, util.NewUserError(codes.NotFound, "Workflow not found.")
|
||||
}
|
||||
|
||||
version, err := strconv.ParseInt(
|
||||
wf.ObjectMeta.Labels[viper.GetString("k8s.labelKeyPrefix")+"workflow-template-version"],
|
||||
10,
|
||||
32,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, util.NewUserError(codes.InvalidArgument, "Bad version number.")
|
||||
}
|
||||
workflow = &model.Workflow{
|
||||
UID: string(wf.UID),
|
||||
Name: wf.Name,
|
||||
WorkflowTemplate: model.WorkflowTemplate{
|
||||
UID: wf.ObjectMeta.Labels[viper.GetString("k8s.labelKeyPrefix")+"workflow-template-uid"],
|
||||
Version: int32(version),
|
||||
},
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (r *ResourceManager) CreateWorkflowTemplate(namespace string, workflowTemplate *model.WorkflowTemplate) (createdWorkflowTemplate *model.WorkflowTemplate, err error) {
|
||||
createdWorkflowTemplate, err = r.workflowRepository.CreateWorkflowTemplate(namespace, workflowTemplate)
|
||||
if err != nil {
|
||||
|
@@ -47,6 +47,28 @@ func (s *WorkflowServer) CreateWorkflow(ctx context.Context, req *api.CreateWork
|
||||
return req.Workflow, nil
|
||||
}
|
||||
|
||||
func (s *WorkflowServer) GetWorkflow(ctx context.Context, req *api.GetWorkflowRequest) (*api.Workflow, error) {
|
||||
wf, err := s.resourceManager.GetWorkflow(req.Namespace, req.Name)
|
||||
if errors.As(err, &userError) {
|
||||
return nil, userError.GRPCError()
|
||||
}
|
||||
|
||||
workflow := &api.Workflow{
|
||||
Uid: string(wf.UID),
|
||||
Name: wf.Name,
|
||||
WorkflowTemplate: &api.WorkflowTemplate{
|
||||
Uid: wf.WorkflowTemplate.UID,
|
||||
Version: wf.WorkflowTemplate.Version,
|
||||
},
|
||||
}
|
||||
|
||||
return workflow, nil
|
||||
}
|
||||
|
||||
func (s *WorkflowServer) ListWorkflows(ctx context.Context, req *api.ListWorkflowsRequest) (*api.ListWorkflowsResponse, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (s *WorkflowServer) CreateWorkflowTemplate(ctx context.Context, req *api.CreateWorkflowTemplateRequest) (*api.WorkflowTemplate, error) {
|
||||
workflowTemplate := &model.WorkflowTemplate{
|
||||
Name: req.WorkflowTemplate.Name,
|
||||
|
Reference in New Issue
Block a user