# Import GatewayContext

**URL:** <https://forum.inductiveautomation.com/t/import-gatewaycontext/70337>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [February 26, 2023, 10:38pm UTC](https://forum.inductiveautomation.com/t/import-gatewaycontext/70337 "2023-02-26T22:38:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![theerthraj.munusamy](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@theerthraj.munusamy](https://forum.inductiveautomation.com/u/theerthraj.munusamy)\
**Post date:** [February 26, 2023, 10:38pm UTC](https://forum.inductiveautomation.com/t/import-gatewaycontext/70337/1 "2023-02-26T22:38:12Z")

</div>

Hi,

I am using Ignition 8.1.17 and trying to import GatewayContext in gateway script. But it says module cannot be imported. Am I missing something to perform this:

from com.inductiveautomation.ignition.gateway import GatewayContext

Thanks,  
Raj

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 26, 2023, 10:40pm UTC](https://forum.inductiveautomation.com/t/import-gatewaycontext/70337/2 "2023-02-26T22:40:56Z")

</div>

This would only work in script executing in the gateway scope.

Where are you writing this script and executing it from?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 26, 2023, 10:42pm UTC](https://forum.inductiveautomation.com/t/import-gatewaycontext/70337/3 "2023-02-26T22:42:30Z")

</div>

Ah, actually, that’s not even the correct package: [GatewayContext](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.25/com/inductiveautomation/ignition/gateway/model/GatewayContext.html)

---

<div class="post-metadata">

**Author:** ![theerthraj.munusamy](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@theerthraj.munusamy](https://forum.inductiveautomation.com/u/theerthraj.munusamy)\
**Post date:** [February 27, 2023, 12:02am UTC](https://forum.inductiveautomation.com/t/import-gatewaycontext/70337/4 "2023-02-27T00:02:35Z")

</div>

Thanks much @Kevin.Herron. I am able to import it now.

However, my code doesn't seem to clear S&F quarantine items. I tried many ways to clear it. Can you help me clear this using script.

```auto

from com.inductiveautomation.ignition.gateway.history import QuarantineManager

quarantined_data_info = QuarantineManager.getQuarantinedDataInfo()

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 27, 2023, 2:15am UTC](https://forum.inductiveautomation.com/t/import-gatewaycontext/70337/5 "2023-02-27T02:15:07Z")

</div>

You are trying use classes as if they are instances. Your starting point needs to be an instance of an implementation of the `GatewayContext` interface. That is very much an undocumented and unsupported action, but you can find such techniques scattered across this forum. They are undocumented and unsupported because they expose things, that if mishandled, can and will crash your gateway.

I recommend you spend some time studying the SDK API.
