iscsi still failing to save current attribute, check on disable and enable portal/iscsi targets
This commit is contained in:
@@ -88,7 +88,14 @@ export interface AddInitiatorRequest {
|
||||
|
||||
export const scstAPI = {
|
||||
listTargets: async (): Promise<SCSTTarget[]> => {
|
||||
const response = await apiClient.get('/scst/targets')
|
||||
const response = await apiClient.get('/scst/targets', {
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache',
|
||||
},
|
||||
params: {
|
||||
_t: Date.now(), // Add timestamp to prevent browser caching
|
||||
},
|
||||
})
|
||||
return response.data.targets || []
|
||||
},
|
||||
|
||||
@@ -97,7 +104,14 @@ export const scstAPI = {
|
||||
luns: SCSTLUN[]
|
||||
initiator_groups?: SCSTInitiatorGroup[]
|
||||
}> => {
|
||||
const response = await apiClient.get(`/scst/targets/${id}`)
|
||||
const response = await apiClient.get(`/scst/targets/${id}`, {
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache',
|
||||
},
|
||||
params: {
|
||||
_t: Date.now(), // Add timestamp to prevent browser caching
|
||||
},
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
|
||||
@@ -112,6 +126,11 @@ export const scstAPI = {
|
||||
return response.data
|
||||
},
|
||||
|
||||
removeLUN: async (targetId: string, lunId: string): Promise<{ message: string }> => {
|
||||
const response = await apiClient.delete(`/scst/targets/${targetId}/luns/${lunId}`)
|
||||
return response.data
|
||||
},
|
||||
|
||||
addInitiator: async (targetId: string, data: AddInitiatorRequest): Promise<{ task_id: string }> => {
|
||||
const response = await apiClient.post(`/scst/targets/${targetId}/initiators`, data)
|
||||
return response.data
|
||||
@@ -123,17 +142,38 @@ export const scstAPI = {
|
||||
},
|
||||
|
||||
listHandlers: async (): Promise<SCSTHandler[]> => {
|
||||
const response = await apiClient.get('/scst/handlers')
|
||||
const response = await apiClient.get('/scst/handlers', {
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache',
|
||||
},
|
||||
params: {
|
||||
_t: Date.now(),
|
||||
},
|
||||
})
|
||||
return response.data.handlers || []
|
||||
},
|
||||
|
||||
listPortals: async (): Promise<SCSTPortal[]> => {
|
||||
const response = await apiClient.get('/scst/portals')
|
||||
const response = await apiClient.get('/scst/portals', {
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache',
|
||||
},
|
||||
params: {
|
||||
_t: Date.now(), // Add timestamp to prevent browser caching
|
||||
},
|
||||
})
|
||||
return response.data.portals || []
|
||||
},
|
||||
|
||||
getPortal: async (id: string): Promise<SCSTPortal> => {
|
||||
const response = await apiClient.get(`/scst/portals/${id}`)
|
||||
const response = await apiClient.get(`/scst/portals/${id}`, {
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache',
|
||||
},
|
||||
params: {
|
||||
_t: Date.now(),
|
||||
},
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
|
||||
@@ -161,13 +201,32 @@ export const scstAPI = {
|
||||
return response.data
|
||||
},
|
||||
|
||||
deleteTarget: async (targetId: string): Promise<{ message: string }> => {
|
||||
const response = await apiClient.delete(`/scst/targets/${targetId}`)
|
||||
return response.data
|
||||
},
|
||||
|
||||
listInitiators: async (): Promise<SCSTInitiator[]> => {
|
||||
const response = await apiClient.get('/scst/initiators')
|
||||
const response = await apiClient.get('/scst/initiators', {
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache',
|
||||
},
|
||||
params: {
|
||||
_t: Date.now(),
|
||||
},
|
||||
})
|
||||
return response.data.initiators || []
|
||||
},
|
||||
|
||||
getInitiator: async (id: string): Promise<SCSTInitiator> => {
|
||||
const response = await apiClient.get(`/scst/initiators/${id}`)
|
||||
const response = await apiClient.get(`/scst/initiators/${id}`, {
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache',
|
||||
},
|
||||
params: {
|
||||
_t: Date.now(),
|
||||
},
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
|
||||
@@ -176,7 +235,14 @@ export const scstAPI = {
|
||||
},
|
||||
|
||||
listExtents: async (): Promise<SCSTExtent[]> => {
|
||||
const response = await apiClient.get('/scst/extents')
|
||||
const response = await apiClient.get('/scst/extents', {
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache',
|
||||
},
|
||||
params: {
|
||||
_t: Date.now(), // Add timestamp to prevent browser caching
|
||||
},
|
||||
})
|
||||
return response.data.extents || []
|
||||
},
|
||||
|
||||
@@ -188,6 +254,52 @@ export const scstAPI = {
|
||||
deleteExtent: async (deviceName: string): Promise<void> => {
|
||||
await apiClient.delete(`/scst/extents/${deviceName}`)
|
||||
},
|
||||
|
||||
// Initiator Groups
|
||||
listInitiatorGroups: async (): Promise<SCSTInitiatorGroup[]> => {
|
||||
const response = await apiClient.get('/scst/initiator-groups', {
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache',
|
||||
},
|
||||
params: {
|
||||
_t: Date.now(), // Add timestamp to prevent browser caching
|
||||
},
|
||||
})
|
||||
return response.data.groups || []
|
||||
},
|
||||
|
||||
getInitiatorGroup: async (id: string): Promise<SCSTInitiatorGroup> => {
|
||||
const response = await apiClient.get(`/scst/initiator-groups/${id}`, {
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache',
|
||||
},
|
||||
params: {
|
||||
_t: Date.now(),
|
||||
},
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
|
||||
createInitiatorGroup: async (data: { target_id: string; group_name: string }): Promise<SCSTInitiatorGroup> => {
|
||||
const response = await apiClient.post('/scst/initiator-groups', data)
|
||||
return response.data
|
||||
},
|
||||
|
||||
updateInitiatorGroup: async (id: string, data: { group_name: string }): Promise<SCSTInitiatorGroup> => {
|
||||
const response = await apiClient.put(`/scst/initiator-groups/${id}`, data)
|
||||
return response.data
|
||||
},
|
||||
|
||||
deleteInitiatorGroup: async (id: string): Promise<void> => {
|
||||
await apiClient.delete(`/scst/initiator-groups/${id}`)
|
||||
},
|
||||
|
||||
addInitiatorToGroup: async (groupId: string, initiatorIQN: string): Promise<{ message: string }> => {
|
||||
const response = await apiClient.post(`/scst/initiator-groups/${groupId}/initiators`, {
|
||||
initiator_iqn: initiatorIQN,
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
}
|
||||
|
||||
export interface SCSTExtent {
|
||||
|
||||
Reference in New Issue
Block a user