2.0info: 3.13.1 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 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 get: 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: tags description: Tags to filter in: query required: true type: array items: type: string minimum: 1 – name: page description: Index of the first page to be returned in: query type: integer format: int64 – name: size description: Size of the page 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/searchJobs: post: description: Searches for jobs based on the given term. The search is performed using the job description and tags. tags: – Queries x-senior-visibility: PRIVATE parameters: – name: input in: body required: true schema: type: object required: – searchTerm properties: searchTerm: type: string 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: Searches for jobs based on the given term. The search is performed using the job description and tags. tags: – Queries x-senior-visibility: PRIVATE parameters: – name: searchTerm description: Text used while searching jobs in: query required: true type: string – 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 description: Job id list to filter results searchTerm: type: string 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/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 description: responses: 200: description: Ok schema: type: object required: – metadata properties: metadata: type: string 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 responses: 200: description: Ok schema: type: object required: – metadata properties: metadata: type: string 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: PUBLIC 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: PUBLIC 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 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 description: responses: 202: description: Accepted 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 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/job responses: 200: description: Ok schema: #/definitions/job 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/genericError definitions: 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.\n Each 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 description: The minute of the hour (0 – 59), defaults to 0 hour: type: string description: The hour of the day (0 – 23), defaults to 0 dayOfMonth: type: string description: Day of the month, to make this monthly month: type: string description: Month of the year (1 – 12) dayOfWeek: type: string 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 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 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 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 description: Identifier of this job description: type: string description: Description of the job primitiveDomain: type: string description: Domain that has the primitive primitiveService: type: string description: Service that has the primitive primitiveName: type: string 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 description: Nome do healthcheck status: type: string allOf: – #/definitions/upDown description: Status do healthcheck job: description: Definition of a scheduled job. type: object required: – id – description – primitiveDomain – primitiveService – primitiveName – primitiveType properties: id: type: string 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 description: Domain that has the primitive primitiveService: type: string description: Service that has the primitive primitiveName: type: string description: Name of the primitive primitiveVersion: type: integer format: int64 description: Version of the primitive payloadContent: type: string description: Input payload to the primitive execution, if it is not from an URL payloadScript: type: string 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 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 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 description: Class of notification notificationOrigin: type: string 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 description: Notification subject. notificationContent: type: string description: Notification content. sourceDomain: type: string description: Domain that generates the notification. sourceService: type: string description: Service that generates the notification. destinationUser: type: string description: Username of the destination user. link: type: string description: Notification link _discriminator: type: string description: emailNotifyUserEventPayload: description: Represents an email notification payload allOf: – #/definitions/notifyUserEventPayload – type: object required: – from properties: from: type: string description: Email sender address sendTo: type: array items: type: string 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 description: Apple/Google application id blobReference: description: Default blob reference type. Every service defines its own. type: object required: – targetObjectId properties: domainName: type: string description: The domain the blob belongs to. serviceName: type: string description: The service the blob belongs to. targetObjectId: type: string description: The basic id of the blob. targetCopyId: type: string description: The id of the blob copy. basicErrorPayload: description: Default error payload type. Every service defines its own. type: object properties: message: type: string description: The user-facing error message, if any. errorCode: type: string 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 description: Domain of the dependency service service: type: string description: Name of the dependency service type: string 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