mirror of
https://github.com/Telecominfraproject/wlan-cloud-graphql-gw.git
synced 2025-11-02 11:37:49 +00:00
added Alarms API
This commit is contained in:
@@ -163,4 +163,11 @@ export class API extends RESTDataSource {
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
async getAllAlarms(customerId, cursor, limit) {
|
||||
return this.get('portal/alarm/forCustomer', {
|
||||
customerId,
|
||||
paginationContext: buildPaginationContext(cursor, limit),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,10 @@ const resolvers = {
|
||||
getAllProfiles: async (_, { customerId }, { dataSources }) => {
|
||||
return dataSources.api.getAllProfiles(customerId);
|
||||
},
|
||||
|
||||
getAllAlarms: async (_, { customerId, cursor, limit }, { dataSources }) => {
|
||||
return dataSources.api.getAllAlarms(customerId);
|
||||
},
|
||||
},
|
||||
Mutation: {
|
||||
authenticateUser: async (_, { email, password }, { dataSources }) => {
|
||||
|
||||
@@ -32,6 +32,8 @@ const typeDefs = gql`
|
||||
getProfile(id: Int!): Profile
|
||||
deleteProfile(id: Int!): Profile
|
||||
getAllProfiles(customerId: Int!): ProfilePagination
|
||||
|
||||
getAllAlarms(customerId: Int!, cursor: String, limit: Int): AlarmPagination
|
||||
}
|
||||
|
||||
type PaginationContext {
|
||||
@@ -112,6 +114,20 @@ const typeDefs = gql`
|
||||
context: PaginationContext
|
||||
}
|
||||
|
||||
type Alarm {
|
||||
customerId: Int!
|
||||
equipmentId: Int!
|
||||
alarmCode: String!
|
||||
severity: String!
|
||||
lastModifiedTimestamp: String
|
||||
details: JSONObject
|
||||
}
|
||||
|
||||
type AlarmPagination {
|
||||
items: [Alarm]
|
||||
context: PaginationContext
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
authenticateUser(email: String!, password: String!): Token
|
||||
updateToken(refreshToken: String!): Token
|
||||
|
||||
Reference in New Issue
Block a user