2.0info: 3.15.6 scheduler x-senior-domain: platform x-senior-domain-path: platform x-senior-service-path: scheduler contact: name: Senior X Platform url: https://dev.senior.com.br email: seniorx-dev@senior.com.brhost: platform.senior.com.br /t/senior.com.br/bridge/1.0/rest/platformsecurityDefinitions: APIKeyHeader: type: apiKey in: header name: Authorizationsecurity: – APIKeyHeader: [] – application/json – application/jsonpaths: /scheduler/queries/healthcheck: post: description: Query para o SRE verificar a disponibilidade do serviço tags: – Queries x-senior-visibility: PUBLIC parameters: – name: input in: body required: true schema: type: object responses: 200: description: Ok schema: type: object required: – status – checks properties: status: type: string allOf: – #/definitions/upDown description: Status geral do serviço checks: type: array items: type: object allOf: – #/definitions/checkData minimum: 1 description: Verificações para assegurar o status 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Query para o SRE verificar a disponibilidade do serviço tags: – Queries x-senior-visibility: PUBLIC parameters: responses: 200: description: Ok schema: type: object required: – status – checks properties: status: type: string allOf: – #/definitions/upDown description: Status geral do serviço checks: type: array items: type: object allOf: – #/definitions/checkData minimum: 1 description: Verificações para assegurar o status 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /scheduler/queries/listJobByTag: post: description: List jobs filtering by their tags. If a job has any of the given tags it will be returned. tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – tags properties: tags: type: array items: type: string maxLength: 255 minimum: 1 description: Tags to filter page: type: integer format: int64 description: Index of the first page to be returned size: type: integer format: int64 description: Size of the page responses: 200: description: Ok schema: type: object required: – jobs – total properties: jobs: type: array items: type: object allOf: – #/definitions/job minimum: 1 description: total: type: integer format: int64 description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /scheduler/queries/searchJobs: post: description: API DEPRECIADA: Use platform/scheduler/listJobs instead | DATA: 2024-05-29 | Searches for jobs based on the given term. The search is performed using the job description and tags. tags: – Queries deprecated : true x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – searchTerm properties: searchTerm: type: string maxLength: 255 description: Text used while searching jobs page: type: integer format: int64 description: size: type: integer format: int64 description: responses: 200: description: Ok schema: type: object required: – jobs – total properties: jobs: type: array items: type: object allOf: – #/definitions/job minimum: 1 description: total: type: integer format: int64 description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: API DEPRECIADA: Use platform/scheduler/listJobs instead | DATA: 2024-05-29 | Searches for jobs based on the given term. The search is performed using the job description and tags. tags: – Queries deprecated : true x-senior-visibility: PRIVATE parameters: – name: searchTerm description: Text used while searching jobs in: query required: true type: string maxLength: 255 – name: page description: in: query type: integer format: int64 – name: size description: in: query type: integer format: int64 responses: 200: description: Ok schema: type: object required: – jobs – total properties: jobs: type: array items: type: object allOf: – #/definitions/job minimum: 1 description: total: type: integer format: int64 description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /scheduler/queries/getExecutionHistory: post: description: Get list of scheduled jobs finished executions. All optional filter items are cumulative (i.e. use AND) tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – page – size properties: page: type: integer format: int64 description: Page number to retrieve size: type: integer format: int64 description: Size of the result page jobIds: type: array items: type: string maxLength: 255 description: Job id list to filter results searchTerm: type: string maxLength: 255 description: Search term to filter the job description and tags status: type: string allOf: – #/definitions/executionStatus description: Status to filter the results responses: 200: description: Ok schema: type: object required: – executions – total properties: executions: type: array items: type: object allOf: – #/definitions/execution minimum: 1 description: total: type: integer format: int64 description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /scheduler/queries/listJobs: post: description: tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: page: type: integer format: int64 description: default: 0 size: type: integer format: int64 description: default: 10 searchTerm: type: string maxLength: 255 description: domainName: type: string maxLength: 255 description: serviceName: type: string maxLength: 255 description: responses: 200: description: Ok schema: type: object required: – jobs – listInformation properties: jobs: type: array items: type: object allOf: – #/definitions/jobDto minimum: 1 description: listInformation: type: object allOf: – #/definitions/listInformation description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: tags: – Queries x-senior-visibility: PRIVATE parameters: – name: page description: in: query type: integer format: int64 – name: size description: in: query type: integer format: int64 – name: searchTerm description: in: query type: string maxLength: 255 – name: domainName description: in: query type: string maxLength: 255 – name: serviceName description: in: query type: string maxLength: 255 responses: 200: description: Ok schema: type: object required: – jobs – listInformation properties: jobs: type: array items: type: object allOf: – #/definitions/jobDto minimum: 1 description: listInformation: type: object allOf: – #/definitions/listInformation description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /scheduler/queries/getMetadata: post: description: Default getMetadata query. Every service must handle this command and return metadata in the format requested. tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object properties: metadataFormat: type: string maxLength: 255 description: responses: 200: description: Ok schema: type: object required: – metadata properties: metadata: type: string maxLength: 255 description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Default getMetadata query. Every service must handle this command and return metadata in the format requested. tags: – Queries x-senior-visibility: PRIVATE parameters: – name: metadataFormat description: in: query type: string maxLength: 255 responses: 200: description: Ok schema: type: object required: – metadata properties: metadata: type: string maxLength: 255 description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /scheduler/queries/getDependencies: post: description: Returns a list with all dependencies from this service, along with their respective versions tags: – Queries x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object required: – dependencies properties: dependencies: type: array items: type: object allOf: – #/definitions/dependency minimum: 1 description: List with this service dependencies 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: description: Returns a list with all dependencies from this service, along with their respective versions tags: – Queries x-senior-visibility: PRIVATE responses: 200: description: Ok schema: type: object required: – dependencies properties: dependencies: type: array items: type: object allOf: – #/definitions/dependency minimum: 1 description: List with this service dependencies 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /scheduler/actions/toggleActive: post: description: Activates or deactivates a job. While inactive the job is not executed. tags: – Actions x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – id – active properties: id: type: string maxLength: 255 description: active: type: boolean description: responses: 200: description: Ok schema: type: object required: – previousState properties: previousState: type: boolean description: 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /scheduler/signals/handleJobResponse: post: description: Handles the reply from a job execution. Internal use only! tags: – Signals parameters: – name: input in: body required: true schema: type: object required: – isError – content properties: isError: type: boolean description: content: type: string maxLength: 255 description: responses: 202: description: Accepted default: description: Error response schema: #/definitions/genericError /scheduler/events/jobScheduled: post: description: Notifies that a job has been scheduled, i.e. it has been created or updated. x-senior-event: true tags: – Events parameters: – name: input in: body required: true schema: type: object required: – jobId – jobDescription properties: jobId: type: string maxLength: 255 description: Job identifier. jobDescription: type: string maxLength: 255 description: Job description. responses: 200: description: OK default: description: Error response schema: #/definitions/genericError /scheduler/events/jobDeleted: post: description: Notifies that a job has been deleted. x-senior-event: true tags: – Events parameters: – name: input in: body required: true schema: type: object required: – jobId properties: jobId: type: string maxLength: 255 description: Job identifier. responses: 200: description: OK default: description: Error response schema: #/definitions/genericError /scheduler/events/scheduleDone: post: description: Notifies that a job has been finished. x-senior-event: true tags: – Events parameters: – name: input in: body required: true schema: type: object required: – jobId properties: jobId: type: string maxLength: 255 description: Job identifier. responses: 200: description: OK default: description: Error response schema: #/definitions/genericError /scheduler/entities/job: post: tags: – CRUD x-senior-visibility: PRIVATE parameters: – name: entity in: body required: true schema: type: object allOf: – #/definitions/job responses: 200: description: The created resource schema: #/definitions/job 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError patch: tags: – CRUD x-senior-visibility: PRIVATE parameters: – name: entity in: body required: true schema: type: object allOf: – #/definitions/job responses: 200: description: The created resource schema: #/definitions/job 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: tags: – CRUD x-senior-visibility: PRIVATE parameters: – name: offset in: query type: number – name: size in: query type: number – name: filter in: query type: string – name: groupby in: query type: string – name: displayfields in: query type: string – name: translation in: query type: boolean responses: 200: description: Ok schema: type: array items: #/definitions/job 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /scheduler/entities/job/{id}: put: tags: – CRUD x-senior-visibility: PRIVATE parameters: – name: id in: path required: true type: string – name: entity in: body required: true schema: #/definitions/editJob responses: 200: description: Ok schema: #/definitions/editJob 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError patch: tags: – CRUD x-senior-visibility: PRIVATE parameters: – name: id in: path required: true type: string – name: entity in: body required: true schema: #/definitions/job responses: 200: description: Ok schema: #/definitions/job 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError get: tags: – CRUD x-senior-visibility: PRIVATE parameters: – name: id in: path required: true type: string responses: 200: description: Ok schema: #/definitions/job 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError delete: tags: – CRUD x-senior-visibility: PRIVATE parameters: – name: id in: path required: true type: string responses: 200: description: Ok 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericError /scheduler/entities/job/bulk: post: tags: – Bulk parameters: – name: entities in: body required: true schema: type: array items: #/definitions/job responses: 200: description: The bulk creation has created resources 401: description: Invalid Credentials default: description: Error response schema: #/definitions/genericErrordefinitions: executionStatus: description: type: string enum: – Success – Error primitiveType: description: Type of the primitive, from service metadata type: string enum: – ACTION – LIST – SIGNAL upDown: description: type: string enum: – UP – DOWN userNotificationKind: description: User notification kind. type: string enum: – Operational – Management – News userNotificationPriority: description: User notification priority. type: string enum: – Error – Alert – None eventEmailFormat: description: Format of the email type: string enum: – HTML – PLAIN_TEXT schedule: description: Schedule that can represent an one-time event or a recursive one. type: object required: – start properties: start: type: string format: date-time description: Time to start executing this schedule. If this schedule does not repeat this will be the only time executed. This is a date in UTC 0 format. period: type: object allOf: – #/definitions/period description: Period that defines execution times and dates in case of a repeating schedule. Cannot be informed if interval is informed. timezoneOffset: type: integer format: int64 description: Timezone offset. Ex: -3. Used for period repetition calculation. minimum: -12 maximum: 12 period: description: Period of the schedule repetition. Each field is optional, and its presence defines if it is daily, monthly, etc.\nEach field supports Cron expression, so repetition is possible by using the /{n} syntax. type: object properties: repetitions: type: integer format: int64 description: How many times should this period repeat. This value is ignored if end is informed. end: type: string format: date-time description: When this period stops. If informed, ignores the repetitions value. minute: type: string maxLength: 255 description: The minute of the hour (0 – 59), defaults to 0 hour: type: string maxLength: 255 description: The hour of the day (0 – 23), defaults to 0 dayOfMonth: type: string maxLength: 255 description: Day of the month, to make this monthly month: type: string maxLength: 255 description: Month of the year (1 – 12) dayOfWeek: type: string maxLength: 255 description: In which day of the week should it execute (0 – 6, 0 is sunday) log: description: Log of modifications in the scheduling service. type: object required: – user – when properties: user: type: string maxLength: 255 description: when: type: string format: date-time description: execution: description: Status of the past execution of a scheduled job. type: object required: – id – job – status – start – finish – duration – response properties: id: type: string maxLength: 255 description: Identifier of the execution job: type: object allOf: – #/definitions/jobHeader description: Job info status: type: string allOf: – #/definitions/executionStatus description: Status of the execution start: type: string format: date-time description: Job execution start date/time finish: type: string format: date-time description: Job execution finish date/time duration: type: integer format: int64 description: Duration of the execution, in seconds response: type: string maxLength: 255 description: Response of the job that executed jobHeader: description: Lightweight representation of a job. type: object required: – id – description – primitiveDomain – primitiveService – primitiveName – active properties: id: type: string maxLength: 255 description: Identifier of this job description: type: string maxLength: 255 description: Description of the job primitiveDomain: type: string maxLength: 255 description: Domain that has the primitive primitiveService: type: string maxLength: 255 description: Service that has the primitive primitiveName: type: string maxLength: 255 description: Name of the primitive primitiveVersion: type: integer format: int64 description: Version of the primitive active: type: boolean description: Indicates whether this job is active or not. checkData: description: Dados do healthcheck type: object required: – name – status properties: name: type: string maxLength: 255 description: Nome do healthcheck status: type: string allOf: – #/definitions/upDown description: Status do healthcheck jobDto: description: type: object required: – id – description – primitiveDomain – primitiveService – primitiveName – primitiveType properties: id: type: string maxLength: 255 description: Identifier of this job description: type: string maxLength: 100 description: Description of the job. The length is up to 100 characters. primitiveDomain: type: string maxLength: 255 description: Domain that has the primitive primitiveService: type: string maxLength: 255 description: Service that has the primitive primitiveName: type: string maxLength: 255 description: Name of the primitive primitiveVersion: type: integer format: int64 description: Version of the primitive payloadContent: type: string maxLength: 50000 description: Input payload to the primitive execution, if it is not from an URL payloadScript: type: string maxLength: 50000 description: Script that creates the payload to the execution. Must be written in javascript and return a JSON string. active: type: boolean description: Indicates whether this job is active or not. tags: type: array items: type: string maxLength: 255 description: Tags to classify the job. schedule: type: object allOf: – #/definitions/schedule description: Schedule info to this job. created: type: object allOf: – #/definitions/log description: Info about creation. updated: type: object allOf: – #/definitions/log description: Info about last modification, if any. primitiveType: type: string allOf: – #/definitions/primitiveType description: The kind of primitive, can be ACTION, LIST or SIGNAL immutable: type: boolean description: Whether the job can be update or not default: false factory: type: boolean description: Whether the job is from the factory or not, default value is false default: false listInformation: description: type: object required: – totalPages – totalElements properties: totalPages: type: integer format: int64 description: totalElements: type: integer format: int64 description: job: description: Definition of a scheduled job. type: object required: – id – description – primitiveDomain – primitiveService – primitiveName – primitiveType properties: id: type: string maxLength: 255 description: Identifier of this job description: type: string maxLength: 100 description: Description of the job. The length is up to 100 characters. primitiveDomain: type: string maxLength: 64 description: Domain that has the primitive primitiveService: type: string maxLength: 64 description: Service that has the primitive primitiveName: type: string maxLength: 255 description: Name of the primitive primitiveVersion: type: integer format: int64 description: Version of the primitive payloadContent: type: string maxLength: 50000 description: Input payload to the primitive execution, if it is not from an URL payloadScript: type: string maxLength: 50000 description: Script that creates the payload to the execution. Must be written in javascript and return a JSON string. active: type: boolean description: Indicates whether this job is active or not. tags: type: array items: type: string maxLength: 255 description: Tags to classify the job. schedule: type: object allOf: – #/definitions/schedule description: Schedule info to this job. created: type: object allOf: – #/definitions/log description: Info about creation. updated: type: object allOf: – #/definitions/log description: Info about last modification, if any. primitiveType: type: string allOf: – #/definitions/primitiveType description: The kind of primitive, can be ACTION, LIST or SIGNAL immutable: type: boolean description: Whether the job can be update or not default: false factory: type: boolean description: Whether the job is from the factory or not, default value is false default: false editJob: type: object required: – id allOf: – #/definitions/job notifyUserEventPayload: description: Represents a regular user event notification payload discriminator: _discriminator type: object required: – notificationKind – notificationPriority – notificationSubject – notificationContent – sourceDomain – sourceService – destinationUser – _discriminator properties: notificationClass: type: string maxLength: 255 description: Class of notification notificationOrigin: type: string maxLength: 255 description: Origin of notification. Free text. Optional. notificationKind: type: string allOf: – #/definitions/userNotificationKind description: Notification kind. notificationPriority: type: string allOf: – #/definitions/userNotificationPriority description: Notification priority. notificationSubject: type: string maxLength: 255 description: Notification subject. notificationContent: type: string maxLength: 255 description: Notification content. sourceDomain: type: string maxLength: 255 description: Domain that generates the notification. sourceService: type: string maxLength: 255 description: Service that generates the notification. destinationUser: type: string maxLength: 255 description: Username of the destination user. link: type: string maxLength: 255 description: Notification link _discriminator: type: string maxLength: 255 description: emailNotifyUserEventPayload: description: Represents an email notification payload allOf: – #/definitions/notifyUserEventPayload – type: object required: – from properties: from: type: string maxLength: 255 description: Email sender address sendTo: type: array items: type: string maxLength: 255 description: Additional recipients to send the email to format: type: string allOf: – #/definitions/eventEmailFormat description: Email format pushNotifyUserEventPayload: description: Represents a push notification payload allOf: – #/definitions/notifyUserEventPayload – type: object required: – applicationId properties: applicationId: type: string maxLength: 255 description: Apple/Google application id blobReference: description: Default blob reference type. Every service defines its own. type: object required: – targetObjectId properties: domainName: type: string maxLength: 255 description: The domain the blob belongs to. serviceName: type: string maxLength: 255 description: The service the blob belongs to. targetObjectId: type: string maxLength: 255 description: The basic id of the blob. targetCopyId: type: string maxLength: 255 description: The id of the blob copy. basicErrorPayload: description: Default error payload type. Every service defines its own. type: object properties: message: type: string maxLength: 255 description: The user-facing error message, if any. errorCode: type: string maxLength: 255 description: The program-accessible (and service-specific) error code. dependency: description: Represents a service dependency type: object required: – domain – service – version properties: domain: type: string maxLength: 255 description: Domain of the dependency service service: type: string maxLength: 255 description: Name of the dependency service type: string maxLength: 255 description: Version of the dependency service genericError: properties: message: type: string description: Messaging describing the error. reason: type: string description: A symbolic code identifying the category of the reason of the error. enum: – BAD_REQUEST – UNAUTHORIZED – PAYMENT_REQUIRED – FORBIDDEN – OBJECT_NOT_FOUND – REQUEST_TIMEOUT – GONE – UNPROCESSABLE – INTERNAL_ERROR – NOT_IMPLEMENTED – SERVICE_UNAVAILABLE – INSUFFICIENT_STORAGE